From 51ce5b9e48a2c8fb786b8a9fc042574b5103656d Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 14 Dec 2021 18:46:32 +0100 Subject: [PATCH 001/555] fix(web): partial arguments --- example.php | 2 +- specs/swagger-appwrite.0.12.0.json | 1 + src/SDK/Language.php | 9 ++ src/SDK/Language/Web.php | 176 ++++++++++++++++++++++++++++- src/SDK/SDK.php | 8 ++ templates/web/src/sdk.ts.twig | 10 +- 6 files changed, 196 insertions(+), 10 deletions(-) create mode 100644 specs/swagger-appwrite.0.12.0.json diff --git a/example.php b/example.php index 91ce5bb94c..e1abed18cf 100644 --- a/example.php +++ b/example.php @@ -39,7 +39,7 @@ function getSSLPage($url) { // $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1'); // Enable only with Appwrite local server running on port 80 // $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1&platform=console'); // Enable only with Appwrite local server running on port 80 // $spec = file_get_contents('https://appwrite.io/specs/swagger2?platform=client'); - $spec = file_get_contents('./specs/swagger-appwrite.0.11.0.json'); + $spec = file_get_contents('./specs/swagger-appwrite.0.12.0.json'); if(empty($spec)) { throw new Exception('Failed to fetch spec from Appwrite server'); diff --git a/specs/swagger-appwrite.0.12.0.json b/specs/swagger-appwrite.0.12.0.json new file mode 100644 index 0000000000..2f413a7920 --- /dev/null +++ b/specs/swagger-appwrite.0.12.0.json @@ -0,0 +1 @@ +{"swagger":"2.0","info":{"version":"0.12.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":47,"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":37,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete 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":56,"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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":54,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":46,"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:{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":50,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs 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"}]}},"\/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":52,"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":53,"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":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Old user password. Must be at least 8 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":48,"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":55,"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":{},"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":59,"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":60,"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":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"New password again. Must be at least 8 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":49,"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":38,"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 at least 8 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":58,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":45,"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\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":43,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":44,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique ID.","default":null,"x-example":null},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":39,"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":"","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":"","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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":51,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"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":57,"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":61,"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},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":62,"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":64,"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":63,"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":67,"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":65,"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":66,"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":69,"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":68,"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":71,"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":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":70,"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":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/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":72,"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":76,"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]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}}},"required":["name","permission"]}}]},"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":77,"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}\/attributes":{"get":{"summary":"List Attributes","operationId":"databaseListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":86,"cookies":false,"type":"","demo":"database\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databaseCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a boolean attribute.\n","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":85,"cookies":false,"type":"","demo":"database\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databaseCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an email attribute.\n","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":79,"cookies":false,"type":"","demo":"database\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databaseCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":80,"cookies":false,"type":"","demo":"database\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","elements","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databaseCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":84,"cookies":false,"type":"","demo":"database\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"string","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"string","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databaseCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":83,"cookies":false,"type":"","demo":"database\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databaseCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create IP address attribute.\n","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":81,"cookies":false,"type":"","demo":"database\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databaseCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new string attribute.\n","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":78,"cookies":false,"type":"","demo":"database\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","size","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databaseCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a URL attribute.\n","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":82,"cookies":false,"type":"","demo":"database\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/{attributeId}":{"get":{"summary":"Get Attribute","operationId":"databaseGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":87,"cookies":false,"type":"","demo":"database\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"attributeId","description":"Attribute ID.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databaseDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":88,"cookies":false,"type":"","demo":"database\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"attributeId","description":"Attribute ID.","required":true,"type":"string","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":94,"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 using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings.","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":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"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":93,"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":{"documentId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","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":95,"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 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":97,"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":{},"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":"[\"role:all\"]","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":"[\"role:all\"]","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":98,"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 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"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databaseListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the document activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":96,"cookies":false,"type":"","demo":"database\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","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":"limit","description":"Maximum number of logs 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"}]}},"\/database\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databaseListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":90,"cookies":false,"type":"","demo":"database\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databaseCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":89,"cookies":false,"type":"","demo":"database\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"indexId":{"type":"string","description":"Index ID.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["indexId","type","attributes"]}}]}},"\/database\/collections\/{collectionId}\/indexes\/{indexId}":{"get":{"summary":"Get Index","operationId":"databaseGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":91,"cookies":false,"type":"","demo":"database\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"indexId","description":"Index ID.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databaseDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":92,"cookies":false,"type":"","demo":"database\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"indexId","description":"Index ID.","required":true,"type":"string","in":"path"}]}},"\/database\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databaseListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":75,"cookies":false,"type":"","demo":"database\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs 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"}]}},"\/database\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databaseGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getUsage","weight":73,"cookies":false,"type":"","demo":"database\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/database\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databaseGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":74,"cookies":false,"type":"","demo":"database\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_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":187,"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":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":186,"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":{"functionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"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"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"dotnet-5.0"},"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":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List the currently active function runtimes.","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active in your project.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":188,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":189,"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":191,"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":193,"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":199,"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":"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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":198,"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":200,"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":192,"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":195,"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":"cursor","description":"ID of the tag used as the starting point for the query, excluding the tag itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":194,"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":196,"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":197,"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":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":190,"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":106,"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":117,"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":109,"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":108,"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 Certificates 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":114,"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":115,"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":112,"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\/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":113,"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":111,"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":116,"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":110,"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":99,"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":103,"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":100,"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":101,"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":102,"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":104,"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":105,"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":120,"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":"cursor","description":"ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":119,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"name":{"type":"string","description":"Project name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"teamId":{"type":"string","description":"Team unique ID.","default":null,"x-example":"[TEAM_ID]"},"description":{"type":"string","description":"Project description. Max length: 256 chars.","default":"","x-example":"[DESCRIPTION]"},"logo":{"type":"string","description":"Project logo.","default":"","x-example":"[LOGO]"},"url":{"type":"string","description":"Project URL.","default":"","x-example":"https:\/\/example.com"},"legalName":{"type":"string","description":"Project legal Name. Max length: 256 chars.","default":"","x-example":"[LEGAL_NAME]"},"legalCountry":{"type":"string","description":"Project legal Country. Max length: 256 chars.","default":"","x-example":"[LEGAL_COUNTRY]"},"legalState":{"type":"string","description":"Project legal State. Max length: 256 chars.","default":"","x-example":"[LEGAL_STATE]"},"legalCity":{"type":"string","description":"Project legal City. Max length: 256 chars.","default":"","x-example":"[LEGAL_CITY]"},"legalAddress":{"type":"string","description":"Project legal Address. Max length: 256 chars.","default":"","x-example":"[LEGAL_ADDRESS]"},"legalTaxId":{"type":"string","description":"Project legal Tax ID. Max length: 256 chars.","default":"","x-example":"[LEGAL_TAX_ID]"}},"required":["projectId","name","teamId"]}}]}},"\/projects\/{projectId}":{"get":{"summary":"Get Project","operationId":"projectsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"get","weight":121,"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":123,"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":128,"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 at least 8 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":126,"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":"integer","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":127,"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,magic-url,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":145,"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":144,"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":146,"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":148,"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":147,"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":135,"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":134,"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":136,"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":137,"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":138,"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":125,"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":140,"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":139,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":"[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":141,"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":142,"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":143,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":124,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":122,"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":130,"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":129,"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":131,"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":132,"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":133,"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":150,"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":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":149,"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":"fileId","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"type":"string","in":"formData"},{"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":151,"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":155,"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":156,"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":153,"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":152,"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":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","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":154,"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"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":157,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":158,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/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":160,"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":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":159,"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":{"teamId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"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":["teamId","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":161,"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":162,"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":163,"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":165,"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":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. If initiated from Client SDK, an email with a link to join the team will be sent to the new member's email address if the member doesn't exist in the project it will be created automatically. If initiated from server side SDKs, new member will automatically be added to the team.\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. While calling from side SDKs the redirect url can be empty string.\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":164,"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"},"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"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":166,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"membership unique ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"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":167,"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":169,"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 received by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":168,"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":171,"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":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":170,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":185,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":172,"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":184,"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}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":180,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":175,"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"},{"name":"limit","description":"Maximum number of logs 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"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":178,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":179,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/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":173,"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":181,"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":{},"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":174,"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":183,"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":182,"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":176,"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":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateVerification","weight":177,"cookies":false,"type":"","demo":"users\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User Email Verification Status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}}},"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":{"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["sum","collections"]},"indexList":{"description":"Indexes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["sum","indexes"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["sum","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["sum","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["sum","runtimes"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["sum","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["sum","metrics"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$read","$write","name","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["sum","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"size":{"type":"string","description":"Attribute size.","x-example":128},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":""},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"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","$read","$write","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"},"execute":{"type":"string","description":"Execution permissions.","x-example":"role:member"},"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"},"runtime":{"type":"string","description":"Function execution runtime.","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","execute","name","dateCreated","dateUpdated","status","runtime","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"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"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"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. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$read","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"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerVkAppid":{"type":"string","description":"VK OAuth app ID.","x-example":"123247283472834787438"},"providerVkSecret":{"type":"string","description":"VK OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabase":{"type":"boolean","description":"Database service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDiscordAppid","providerDiscordSecret","providerDropboxAppid","providerDropboxSecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerVkAppid","providerVkSecret","providerYahooAppid","providerYahooSecret","providerYandexAppid","providerYandexSecret","providerWordpressAppid","providerWordpressSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabase","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"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"]},"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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"metric":{"description":"Metric","type":"object","properties":{"value":{"type":"integer","description":"The value of this metric at the timestamp.","x-example":1,"format":"int32"},"timestamp":{"type":"integer","description":"The UNIX timestamp at which this metric was aggregated.","x-example":1592981250,"format":"int32"}},"required":["value","timestamp"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"files":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","storage","files"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"functionsExecutions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsFailures":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsCompute":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","functionsExecutions","functionsFailures","functionsCompute"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","functions","documents","collections","users","storage"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file diff --git a/src/SDK/Language.php b/src/SDK/Language.php index 9d902357f1..3b6ef10c2f 100644 --- a/src/SDK/Language.php +++ b/src/SDK/Language.php @@ -74,4 +74,13 @@ public function getParams() { return $this->params; } + + /** + * Language specific filters. + * @return array + */ + public function getFilters(): array + { + return []; + } } \ No newline at end of file diff --git a/src/SDK/Language/Web.php b/src/SDK/Language/Web.php index 32f75d592a..e60240b597 100644 --- a/src/SDK/Language/Web.php +++ b/src/SDK/Language/Web.php @@ -2,7 +2,10 @@ namespace Appwrite\SDK\Language; -class Web extends JS { +use Twig\TwigFilter; + +class Web extends JS +{ /** * @return string @@ -98,7 +101,7 @@ public function getParamExample(array $param) $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -118,8 +121,7 @@ public function getParamExample(array $param) $output .= "document.getElementById('uploader').files[0]"; break; } - } - else { + } else { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -141,4 +143,170 @@ public function getParamExample(array $param) return $output; } + + public function getTypeName($type, $method = []): string + { + switch ($type) { + case self::TYPE_INTEGER: + case self::TYPE_NUMBER: + return 'number'; + break; + case self::TYPE_ARRAY: + return 'string[]'; + case self::TYPE_FILE: + return 'File'; + case self::TYPE_OBJECT: + if (empty($method)) { + return $type; + } + + switch ($method['responseModel']) { + case 'user': + return "Partial"; + break; + case 'document': + if ($method['method'] === 'post') { + return "Omit"; + } + if ($method['method'] === 'patch') { + return "Partial>"; + } + } + break; + } + + return $type; + } + + protected function populateGenerics(string $model, array $spec, array &$generics, bool $skipFirst = false) + { + if (!$skipFirst && $spec['definitions'][$model]['additionalProperties']) { + $generics[] = $this->toUpperCase($model); + } + + $properties = $spec['definitions'][$model]['properties']; + + foreach ($properties as $property) { + if (array_key_exists('sub_schema', $property) && $property['sub_schema']) { + $this->populateGenerics($property['sub_schema'], $spec, $generics, false); + } + } + } + + public function getGenerics(string $model, array $spec, bool $skipFirst = false): string + { + $generics = []; + + if (array_key_exists($model, $spec['definitions'])) { + $this->populateGenerics($model, $spec, $generics, $skipFirst); + } + + if (empty($generics)) return ''; + + $generics = array_unique($generics); + $generics = array_map(fn ($type) => "{$type} extends Models.{$type}", $generics); + + return '<' . implode(', ', $generics) . '>'; + } + + public function getReturn(array $method, array $spec): string + { + if ($method['type'] === 'webAuth') { + return 'void | URL'; + } elseif ($method['type'] === 'location') { + return 'URL'; + } + + if (array_key_exists('responseModel', $method) && !empty($method['responseModel']) && $method['responseModel'] !== 'any') { + $ret = 'Promise<'; + + if ( + array_key_exists($method['responseModel'], $spec['definitions']) && + array_key_exists('additionalProperties', $spec['definitions'][$method['responseModel']]) && + !$spec['definitions'][$method['responseModel']]['additionalProperties'] + ) { + $ret .= 'Models.'; + } + + $ret .= $this->toUpperCase($method['responseModel']); + + $models = []; + + if ($method['responseModel']) { + $this->populateGenerics($method['responseModel'], $spec, $models); + } + + $models = array_unique($models); + $models = array_filter($models, fn ($model) => $model != $this->toUpperCase($method['responseModel'])); + + if (!empty($models)) { + $ret .= '<' . implode(', ', $models) . '>'; + } + + $ret .= '>'; + + return $ret; + } else { + return 'Promise<{}>'; + } + + return ""; + } + + public function toUpperCase(string $value): string + { + return ucfirst((string)$this->helperCamelCase($value)); + } + + protected function helperCamelCase($str) + { + $str = preg_replace('/[^a-z0-9' . implode("", []) . ']+/i', ' ', $str); + $str = trim($str); + $str = ucwords($str); + $str = str_replace(" ", "", $str); + $str = lcfirst($str); + + return $str; + } + + public function getSubSchema(array $property, array $spec): string + { + if (array_key_exists('sub_schema', $property)) { + $ret = ''; + $generics = []; + $this->populateGenerics($property['sub_schema'], $spec, $generics); + + $generics = array_filter($generics, fn ($model) => $model != $this->toUpperCase($property['sub_schema'])); + + $ret .= $this->toUpperCase($property['sub_schema']); + if (!empty($generics)) { + $ret .= '<' . implode(', ', $generics) . '>'; + } + if ($property['type'] === 'array') { + $ret .= '[]'; + } + + return $ret; + } + + return $this->getTypeName($property['type']); + } + + public function getFilters(): array + { + return [ + new TwigFilter('getPropertyType', function ($value, $method = []) { + return $this->getTypeName($value, $method); + }), + new TwigFilter('getSubSchema', function (array $property, array $spec) { + return $this->getSubSchema($property, $spec); + }), + new TwigFilter('getGenerics', function (string $model, array $spec, bool $skipAdditional = false) { + return $this->getGenerics($model, $spec, $skipAdditional); + }), + new TwigFilter('getReturn', function (array $method, array $spec) { + return $this->getReturn($method, $spec); + }), + ]; + } } diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index 3d96c5ed3b..f58e38832f 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -74,6 +74,14 @@ public function __construct(Language $language, Spec $spec) $this->twig = new Environment(new FilesystemLoader(__DIR__ . '/../../templates'), [ 'debug' => true ] ); + + /** + * Add language specific filters + */ + foreach ($this->language->getFilters() as $filter) { + $this->twig->addFilter($filter); + } + $this->twig->addExtension(new \Twig\Extension\DebugExtension()); $this->twig->addFilter(new TwigFilter('caseLower', function ($value) { diff --git a/templates/web/src/sdk.ts.twig b/templates/web/src/sdk.ts.twig index 204ae49ec0..1aa72b6f54 100644 --- a/templates/web/src/sdk.ts.twig +++ b/templates/web/src/sdk.ts.twig @@ -1,4 +1,3 @@ -{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}{{property.sub_schema | caseUcfirst}}[]{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{{property.type | typeName}}{% endif %}{% endmacro %} import 'isomorphic-form-data'; import { fetch } from 'cross-fetch'; @@ -7,12 +6,13 @@ namespace Models { /** * {{ definition.description }} */ - export type {{ definition.name | caseUcfirst }}<{% for property in definition.properties %}{% if spec.definitions[property.sub_schema].additionalProperties %}{{property.sub_schema | caseUcfirst}} extends Models.{{property.sub_schema | caseUcfirst}}{% endif %}{% endfor %}> = { + + export type {{ definition.name | caseUcfirst }}{{ definition.name | getGenerics(spec, true) | raw }} = { {% for property in definition.properties %} /** * {{ property.description }} */ - {{ property.name | escapeKeyword }}{% if not property.required %}?{% endif %}: {{_self.sub_schema(property)}}; + {{ property.name | escapeKeyword }}{% if not property.required %}?{% endif %}: {{ property | getSubSchema(spec) | raw }}; {% endfor %} } {% endfor %} @@ -445,13 +445,13 @@ class {{ spec.title | caseUcfirst }} { {% endif %} * {% for parameter in method.parameters.all %} - * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} + * @param {{ '{' }}{{ parameter.type | getPropertyType(method) | raw }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {% if method.type == 'webAuth' %}{void|string}{% elseif method.type == 'location' %}{URL}{% else %}{Promise}{% endif %} */ - {{ method.name | caseCamel }}: {% if method.type != 'location' and method.type != 'webAuth'%}async {% if spec.definitions[method.responseModel].additionalProperties %}<{{method.responseModel | caseUcfirst}} extends Models.{{method.responseModel | caseUcfirst}}>{% endif %}{% for property in spec.definitions[method.responseModel].properties %}{% if spec.definitions[property.sub_schema].additionalProperties %}<{{property.sub_schema | caseUcfirst}} extends Models.{{property.sub_schema | caseUcfirst}}>{% endif %}{% endfor %}{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}): {% if method.type == 'webAuth' %}void | URL{% elseif method.type == 'location' %}URL{% else %}Promise<{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% for property in spec.definitions[method.responseModel].properties %}{% if spec.definitions[property.sub_schema].additionalProperties %}<{{property.sub_schema | caseUcfirst}}>{% endif %}{% endfor %}{% else %}{}{% endif %}>{% endif %} => { + {{ method.name | caseCamel }}: {% if method.type != 'location' and method.type != 'webAuth'%}async {{ method.responseModel | getGenerics(spec) | raw }}{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | getPropertyType(method) | raw }}{% if not loop.last %}, {% endif %}{% endfor %}): {{ method | getReturn(spec) | raw }} => { {% for parameter in method.parameters.all %} {% if parameter.required %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { From 173d4c4b3253830090f45f5493e9c675ed1a0bfd Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 14 Dec 2021 18:52:02 +0100 Subject: [PATCH 002/555] delete old spec --- specs/swagger-appwrite-0.12.0.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 specs/swagger-appwrite-0.12.0.json diff --git a/specs/swagger-appwrite-0.12.0.json b/specs/swagger-appwrite-0.12.0.json deleted file mode 100644 index f34bb89024..0000000000 --- a/specs/swagger-appwrite-0.12.0.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"version":"0.12.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":47,"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":56,"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":54,"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":50,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs 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"}]}},"\/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":52,"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":53,"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":48,"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":55,"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":59,"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":60,"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":49,"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":58,"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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":51,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"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":57,"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":61,"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},userId:{userId}","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":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":62,"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":64,"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":63,"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":67,"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":65,"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":66,"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":69,"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":68,"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":71,"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":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":70,"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":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/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":72,"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":76,"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]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}}},"required":["name","permission"]}}]},"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":77,"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}\/attributes":{"get":{"summary":"List Attributes","operationId":"databaseListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":86,"cookies":false,"type":"","demo":"database\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databaseCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a boolean attribute.\n","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":85,"cookies":false,"type":"","demo":"database\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databaseCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an email attribute.\n","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":79,"cookies":false,"type":"","demo":"database\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databaseCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":80,"cookies":false,"type":"","demo":"database\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","elements","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databaseCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":84,"cookies":false,"type":"","demo":"database\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"string","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"string","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databaseCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":83,"cookies":false,"type":"","demo":"database\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databaseCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create IP address attribute.\n","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":81,"cookies":false,"type":"","demo":"database\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databaseCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new string attribute.\n","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":78,"cookies":false,"type":"","demo":"database\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","size","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databaseCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a URL attribute.\n","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":82,"cookies":false,"type":"","demo":"database\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/{attributeId}":{"get":{"summary":"Get Attribute","operationId":"databaseGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":87,"cookies":false,"type":"","demo":"database\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"attributeId","description":"Attribute ID.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databaseDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":88,"cookies":false,"type":"","demo":"database\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"attributeId","description":"Attribute ID.","required":true,"type":"string","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":94,"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 using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings.","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":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"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":93,"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":{"documentId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","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":95,"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 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":97,"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":"[\"role:all\"]","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":"[\"role:all\"]","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":98,"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 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"}]}},"\/database\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databaseListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":90,"cookies":false,"type":"","demo":"database\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databaseCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":89,"cookies":false,"type":"","demo":"database\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"indexId":{"type":"string","description":"Index ID.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["indexId","type","attributes"]}}]}},"\/database\/collections\/{collectionId}\/indexes\/{indexId}":{"get":{"summary":"Get Index","operationId":"databaseGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":91,"cookies":false,"type":"","demo":"database\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"indexId","description":"Index ID.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databaseDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":92,"cookies":false,"type":"","demo":"database\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"indexId","description":"Index ID.","required":true,"type":"string","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":187,"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":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":186,"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":{"functionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"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"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"dotnet-5.0"},"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":["functionId","name","execute","runtime"]}}]}},"\/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":188,"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":190,"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":192,"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":198,"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":"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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":197,"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":199,"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":191,"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":194,"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":"cursor","description":"ID of the tag used as the starting point for the query, excluding the tag itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":193,"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":195,"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":196,"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":106,"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":117,"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":109,"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":108,"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 Certificates 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":114,"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":115,"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":112,"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\/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":113,"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":111,"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":116,"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":110,"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":99,"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":103,"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":100,"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":101,"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":102,"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":104,"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":105,"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":150,"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":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":149,"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":"fileId","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"type":"string","in":"formData"},{"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":151,"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":155,"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":156,"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":153,"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":152,"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":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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":154,"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":160,"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":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":159,"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":{"teamId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"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":["teamId","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":161,"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":162,"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":163,"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":165,"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":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. If initiated from Client SDK, an email with a link to join the team will be sent to the new member's email address if the member doesn't exist in the project it will be created automatically. If initiated from server side SDKs, new member will automatically be added to the team.\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. While calling from side SDKs the redirect url can be empty string.\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":164,"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"},"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"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":166,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"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 unique ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"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":167,"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":169,"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":168,"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":171,"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":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":170,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"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":["userId","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":172,"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":184,"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}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":180,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":175,"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"},{"name":"limit","description":"Maximum number of logs 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"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":178,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":179,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/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":173,"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":181,"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":174,"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":183,"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":182,"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":176,"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":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateVerification","weight":177,"cookies":false,"type":"","demo":"users\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User Email Verification Status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}}},"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":{"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["sum","collections"]},"indexList":{"description":"Indexes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["sum","indexes"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["sum","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$read","$write","name","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["sum","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false},"size":{"type":"string","description":"Attribute size.","x-example":128},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default"}},"required":["key","type","status","required","array","size","default"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32"},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32"},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32"}},"required":["key","type","status","required","array","min","max","default"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double"},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double"},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double"}},"required":["key","type","status","required","array","min","max","default"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false}},"required":["key","type","status","required","array","default"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com"}},"required":["key","type","status","required","array","format","default"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element"}},"required":["key","type","status","required","array","elements","format","default"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0"}},"required":["key","type","status","required","array","format","default"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com"}},"required":["key","type","status","required","array","format","default"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":""},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"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","$read","$write","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"},"execute":{"type":"array","description":"Document execute permissions.","items":{"type":"string"},"x-example":"role:all"},"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"},"runtime":{"type":"string","description":"Function execution runtime.","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","execute","name","dateCreated","dateUpdated","status","runtime","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"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"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. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$read","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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file From 47cf96076ea3db286cdc04499227dc8e232175cd Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 15 Dec 2021 13:02:55 +0100 Subject: [PATCH 003/555] fix deno tests --- tests/SDKTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SDKTest.php b/tests/SDKTest.php index 13e6808b36..82f825ca8f 100644 --- a/tests/SDKTest.php +++ b/tests/SDKTest.php @@ -239,7 +239,7 @@ class SDKTest extends TestCase 'build' => [ ], 'envs' => [ - 'deno-1.1.3' => 'docker run --rm -v $(pwd):/app -w /app hayd/alpine-deno:1.1.3 run --allow-net --allow-read tests/languages/deno/tests.ts', // TODO: use official image when its out + 'deno-1.16.4' => 'docker run --rm -v $(pwd):/app -w /app denoland/deno:alpine-1.16.4 run --allow-net --allow-read tests/languages/deno/tests.ts', ], 'expectedOutput' => [ ...FOO_RESPONSES, From d3a982fedbab20b2d64ec6c29808579a3082612e Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Mon, 3 Jan 2022 11:39:02 +0100 Subject: [PATCH 004/555] chore: update console spec --- specs/swagger-appwrite.0.12.0.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/swagger-appwrite.0.12.0.json b/specs/swagger-appwrite.0.12.0.json index 2f413a7920..847acfd31a 100644 --- a/specs/swagger-appwrite.0.12.0.json +++ b/specs/swagger-appwrite.0.12.0.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"version":"0.12.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":47,"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":37,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete 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":56,"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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":54,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":46,"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:{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":50,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs 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"}]}},"\/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":52,"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":53,"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":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Old user password. Must be at least 8 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":48,"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":55,"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":{},"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":59,"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":60,"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":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"New password again. Must be at least 8 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":49,"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":38,"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 at least 8 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":58,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":45,"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\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":43,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":44,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique ID.","default":null,"x-example":null},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":39,"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":"","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":"","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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":51,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"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":57,"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":61,"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},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":62,"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":64,"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":63,"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":67,"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":65,"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":66,"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":69,"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":68,"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":71,"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":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":70,"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":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/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":72,"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":76,"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]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}}},"required":["name","permission"]}}]},"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":77,"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}\/attributes":{"get":{"summary":"List Attributes","operationId":"databaseListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":86,"cookies":false,"type":"","demo":"database\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databaseCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a boolean attribute.\n","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":85,"cookies":false,"type":"","demo":"database\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databaseCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an email attribute.\n","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":79,"cookies":false,"type":"","demo":"database\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databaseCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":80,"cookies":false,"type":"","demo":"database\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","elements","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databaseCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":84,"cookies":false,"type":"","demo":"database\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"string","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"string","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databaseCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":83,"cookies":false,"type":"","demo":"database\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databaseCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create IP address attribute.\n","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":81,"cookies":false,"type":"","demo":"database\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databaseCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new string attribute.\n","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":78,"cookies":false,"type":"","demo":"database\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","size","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databaseCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a URL attribute.\n","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":82,"cookies":false,"type":"","demo":"database\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/{attributeId}":{"get":{"summary":"Get Attribute","operationId":"databaseGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":87,"cookies":false,"type":"","demo":"database\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"attributeId","description":"Attribute ID.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databaseDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":88,"cookies":false,"type":"","demo":"database\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"attributeId","description":"Attribute ID.","required":true,"type":"string","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":94,"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 using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings.","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":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"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":93,"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":{"documentId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","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":95,"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 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":97,"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":{},"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":"[\"role:all\"]","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":"[\"role:all\"]","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":98,"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 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"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databaseListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the document activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":96,"cookies":false,"type":"","demo":"database\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","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":"limit","description":"Maximum number of logs 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"}]}},"\/database\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databaseListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":90,"cookies":false,"type":"","demo":"database\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databaseCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":89,"cookies":false,"type":"","demo":"database\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"indexId":{"type":"string","description":"Index ID.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["indexId","type","attributes"]}}]}},"\/database\/collections\/{collectionId}\/indexes\/{indexId}":{"get":{"summary":"Get Index","operationId":"databaseGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":91,"cookies":false,"type":"","demo":"database\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"indexId","description":"Index ID.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databaseDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":92,"cookies":false,"type":"","demo":"database\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"indexId","description":"Index ID.","required":true,"type":"string","in":"path"}]}},"\/database\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databaseListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":75,"cookies":false,"type":"","demo":"database\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs 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"}]}},"\/database\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databaseGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getUsage","weight":73,"cookies":false,"type":"","demo":"database\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/database\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databaseGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":74,"cookies":false,"type":"","demo":"database\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_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":187,"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":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":186,"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":{"functionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"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"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"dotnet-5.0"},"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":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List the currently active function runtimes.","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active in your project.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":188,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":189,"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":191,"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":193,"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":199,"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":"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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":198,"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":200,"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":192,"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":195,"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":"cursor","description":"ID of the tag used as the starting point for the query, excluding the tag itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":194,"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":196,"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":197,"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":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":190,"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":106,"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":117,"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":109,"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":108,"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 Certificates 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":114,"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":115,"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":112,"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\/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":113,"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":111,"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":116,"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":110,"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":99,"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":103,"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":100,"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":101,"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":102,"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":104,"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":105,"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":120,"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":"cursor","description":"ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":119,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"name":{"type":"string","description":"Project name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"teamId":{"type":"string","description":"Team unique ID.","default":null,"x-example":"[TEAM_ID]"},"description":{"type":"string","description":"Project description. Max length: 256 chars.","default":"","x-example":"[DESCRIPTION]"},"logo":{"type":"string","description":"Project logo.","default":"","x-example":"[LOGO]"},"url":{"type":"string","description":"Project URL.","default":"","x-example":"https:\/\/example.com"},"legalName":{"type":"string","description":"Project legal Name. Max length: 256 chars.","default":"","x-example":"[LEGAL_NAME]"},"legalCountry":{"type":"string","description":"Project legal Country. Max length: 256 chars.","default":"","x-example":"[LEGAL_COUNTRY]"},"legalState":{"type":"string","description":"Project legal State. Max length: 256 chars.","default":"","x-example":"[LEGAL_STATE]"},"legalCity":{"type":"string","description":"Project legal City. Max length: 256 chars.","default":"","x-example":"[LEGAL_CITY]"},"legalAddress":{"type":"string","description":"Project legal Address. Max length: 256 chars.","default":"","x-example":"[LEGAL_ADDRESS]"},"legalTaxId":{"type":"string","description":"Project legal Tax ID. Max length: 256 chars.","default":"","x-example":"[LEGAL_TAX_ID]"}},"required":["projectId","name","teamId"]}}]}},"\/projects\/{projectId}":{"get":{"summary":"Get Project","operationId":"projectsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"get","weight":121,"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":123,"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":128,"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 at least 8 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":126,"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":"integer","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":127,"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,magic-url,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":145,"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":144,"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":146,"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":148,"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":147,"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":135,"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":134,"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":136,"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":137,"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":138,"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":125,"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":140,"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":139,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":"[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":141,"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":142,"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":143,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":124,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":122,"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":130,"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":129,"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":131,"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":132,"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":133,"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":150,"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":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":149,"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":"fileId","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"type":"string","in":"formData"},{"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":151,"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":155,"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":156,"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":153,"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":152,"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":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","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":154,"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"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":157,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":158,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/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":160,"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":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":159,"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":{"teamId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"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":["teamId","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":161,"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":162,"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":163,"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":165,"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":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. If initiated from Client SDK, an email with a link to join the team will be sent to the new member's email address if the member doesn't exist in the project it will be created automatically. If initiated from server side SDKs, new member will automatically be added to the team.\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. While calling from side SDKs the redirect url can be empty string.\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":164,"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"},"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"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":166,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"membership unique ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"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":167,"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":169,"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 received by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":168,"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":171,"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":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":170,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":185,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":172,"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":184,"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}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":180,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":175,"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"},{"name":"limit","description":"Maximum number of logs 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"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":178,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":179,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/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":173,"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":181,"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":{},"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":174,"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":183,"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":182,"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":176,"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":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateVerification","weight":177,"cookies":false,"type":"","demo":"users\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User Email Verification Status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}}},"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":{"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["sum","collections"]},"indexList":{"description":"Indexes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["sum","indexes"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["sum","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["sum","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["sum","runtimes"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["sum","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["sum","metrics"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$read","$write","name","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["sum","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"size":{"type":"string","description":"Attribute size.","x-example":128},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":""},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"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","$read","$write","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"},"execute":{"type":"string","description":"Execution permissions.","x-example":"role:member"},"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"},"runtime":{"type":"string","description":"Function execution runtime.","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","execute","name","dateCreated","dateUpdated","status","runtime","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"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"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"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. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$read","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"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerVkAppid":{"type":"string","description":"VK OAuth app ID.","x-example":"123247283472834787438"},"providerVkSecret":{"type":"string","description":"VK OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabase":{"type":"boolean","description":"Database service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDiscordAppid","providerDiscordSecret","providerDropboxAppid","providerDropboxSecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerVkAppid","providerVkSecret","providerYahooAppid","providerYahooSecret","providerYandexAppid","providerYandexSecret","providerWordpressAppid","providerWordpressSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabase","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"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"]},"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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"metric":{"description":"Metric","type":"object","properties":{"value":{"type":"integer","description":"The value of this metric at the timestamp.","x-example":1,"format":"int32"},"timestamp":{"type":"integer","description":"The UNIX timestamp at which this metric was aggregated.","x-example":1592981250,"format":"int32"}},"required":["value","timestamp"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"files":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","storage","files"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"functionsExecutions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsFailures":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsCompute":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","functionsExecutions","functionsFailures","functionsCompute"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","functions","documents","collections","users","storage"]}},"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.12.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":"HOSTNAME","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":46,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete 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":55,"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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":53,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":45,"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:{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":49,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":51,"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":52,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 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":47,"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":54,"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":{},"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":58,"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":59,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":48,"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 at least 8 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":57,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":44,"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\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":42,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":43,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":null},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"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, yammer, 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":"","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":"","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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":50,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"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":56,"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 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":60,"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},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":61,"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 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":63,"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":62,"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":66,"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":64,"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":65,"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":68,"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":67,"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":70,"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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":69,"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":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/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":71,"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 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":75,"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 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]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name","permission"]}}]},"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":76,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databaseListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":85,"cookies":false,"type":"","demo":"database\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databaseCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a boolean attribute.\n","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":84,"cookies":false,"type":"","demo":"database\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databaseCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an email attribute.\n","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":78,"cookies":false,"type":"","demo":"database\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databaseCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":79,"cookies":false,"type":"","demo":"database\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databaseCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":83,"cookies":false,"type":"","demo":"database\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"string","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"string","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databaseCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":82,"cookies":false,"type":"","demo":"database\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databaseCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create IP address attribute.\n","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":80,"cookies":false,"type":"","demo":"database\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databaseCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new string attribute.\n","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":77,"cookies":false,"type":"","demo":"database\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databaseCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a URL attribute.\n","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":81,"cookies":false,"type":"","demo":"database\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databaseGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":86,"cookies":false,"type":"","demo":"database\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databaseDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":87,"cookies":false,"type":"","demo":"database\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","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":93,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"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":92,"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 ID. You can create a new collection with validation rules using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","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":94,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"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":96,"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 ID. You can create a new collection with validation rules using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":{},"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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":97,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databaseListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the document activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":95,"cookies":false,"type":"","demo":"database\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databaseListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":89,"cookies":false,"type":"","demo":"database\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databaseCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":88,"cookies":false,"type":"","demo":"database\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/database\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databaseGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":90,"cookies":false,"type":"","demo":"database\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databaseDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":91,"cookies":false,"type":"","demo":"database\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/database\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databaseListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":74,"cookies":false,"type":"","demo":"database\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databaseGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getUsage","weight":72,"cookies":false,"type":"","demo":"database\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/database\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databaseGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":73,"cookies":false,"type":"","demo":"database\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_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":186,"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":"Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":185,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","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":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List the currently active function runtimes.","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active in your project.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":187,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":188,"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 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":190,"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 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](https:\/\/appwrite.io\/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 that will be passed to the function as environment variables.","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":"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":192,"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 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":198,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":197,"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 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":199,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/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":191,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"tag":{"type":"string","description":"Tag 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":194,"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 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":"Maximum number of tags to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the tag used as the starting point for the query, excluding the tag itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":193,"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 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":195,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag 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":196,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag 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":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":189,"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 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":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":105,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":116,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":108,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":107,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":113,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":114,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":111,"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\/usage":{"get":{"summary":"Get Usage Queue","operationId":"healthGetQueueUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueUsage","weight":112,"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":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":110,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":115,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":109,"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":98,"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":102,"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":99,"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":100,"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":101,"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":103,"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":104,"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":119,"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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":118,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"name":{"type":"string","description":"Project name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"teamId":{"type":"string","description":"Team unique ID.","default":null,"x-example":"[TEAM_ID]"},"description":{"type":"string","description":"Project description. Max length: 256 chars.","default":"","x-example":"[DESCRIPTION]"},"logo":{"type":"string","description":"Project logo.","default":"","x-example":"[LOGO]"},"url":{"type":"string","description":"Project URL.","default":"","x-example":"https:\/\/example.com"},"legalName":{"type":"string","description":"Project legal Name. Max length: 256 chars.","default":"","x-example":"[LEGAL_NAME]"},"legalCountry":{"type":"string","description":"Project legal Country. Max length: 256 chars.","default":"","x-example":"[LEGAL_COUNTRY]"},"legalState":{"type":"string","description":"Project legal State. Max length: 256 chars.","default":"","x-example":"[LEGAL_STATE]"},"legalCity":{"type":"string","description":"Project legal City. Max length: 256 chars.","default":"","x-example":"[LEGAL_CITY]"},"legalAddress":{"type":"string","description":"Project legal Address. Max length: 256 chars.","default":"","x-example":"[LEGAL_ADDRESS]"},"legalTaxId":{"type":"string","description":"Project legal Tax ID. Max length: 256 chars.","default":"","x-example":"[LEGAL_TAX_ID]"}},"required":["projectId","name","teamId"]}}]}},"\/projects\/{projectId}":{"get":{"summary":"Get Project","operationId":"projectsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"get","weight":120,"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":122,"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":127,"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 at least 8 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":125,"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":"integer","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":126,"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,magic-url,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":144,"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":143,"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":145,"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":147,"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":146,"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":134,"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":133,"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":135,"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":136,"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":137,"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":124,"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":139,"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":138,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":"[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":140,"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":141,"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":142,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":123,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":121,"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":129,"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":128,"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":130,"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":131,"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":132,"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":149,"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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":148,"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":"fileId","description":"File ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"type":"string","in":"formData"},{"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](https:\/\/appwrite.io\/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](https:\/\/appwrite.io\/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":150,"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 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":154,"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 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](https:\/\/appwrite.io\/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](https:\/\/appwrite.io\/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":155,"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 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":152,"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 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":151,"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 ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","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":153,"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 ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":156,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":157,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":159,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":158,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"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":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":160,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":161,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":162,"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 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":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":164,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":163,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":165,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":166,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). 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":168,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":167,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":170,"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":"Maximum number of users to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":169,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":184,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":171,"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 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":183,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":179,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":174,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":177,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":178,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/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":172,"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 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":180,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":173,"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 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":182,"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 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":181,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":175,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateVerification","weight":176,"cookies":false,"type":"","demo":"users\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}}},"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":{"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["sum","collections"]},"indexList":{"description":"Indexes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["sum","indexes"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["sum","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["sum","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["sum","runtimes"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["sum","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["sum","metrics"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$read","$write","name","enabled","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["sum","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"string","description":"Attribute size.","x-example":128},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":""},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"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","$read","$write","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"},"execute":{"type":"string","description":"Execution permissions.","x-example":"role:member"},"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"},"runtime":{"type":"string","description":"Function execution runtime.","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","execute","name","dateCreated","dateUpdated","status","runtime","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"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"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"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. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$read","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"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerVkAppid":{"type":"string","description":"VK OAuth app ID.","x-example":"123247283472834787438"},"providerVkSecret":{"type":"string","description":"VK OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYammerAppid":{"type":"string","description":"Yammer OAuth app ID.","x-example":"123247283472834787438"},"providerYammerSecret":{"type":"string","description":"Yammer OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabase":{"type":"boolean","description":"Database service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDiscordAppid","providerDiscordSecret","providerDropboxAppid","providerDropboxSecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerVkAppid","providerVkSecret","providerYahooAppid","providerYahooSecret","providerYammerAppid","providerYammerSecret","providerYandexAppid","providerYandexSecret","providerWordpressAppid","providerWordpressSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabase","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"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"]},"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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]},"metric":{"description":"Metric","type":"object","properties":{"value":{"type":"integer","description":"The value of this metric at the timestamp.","x-example":1,"format":"int32"},"timestamp":{"type":"integer","description":"The UNIX timestamp at which this metric was aggregated.","x-example":1592981250,"format":"int32"}},"required":["value","timestamp"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"files":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","storage","files"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"functionsExecutions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsFailures":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsCompute":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","functionsExecutions","functionsFailures","functionsCompute"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","functions","documents","collections","users","storage"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file From ac71cd2e7f5d802858816e0b4c46895c0084e7d2 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 9 Mar 2022 12:17:55 +0100 Subject: [PATCH 005/555] fix: adapt to master --- specs/swagger2-latest-console.json | 2 +- templates/web/src/sdk.ts.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/swagger2-latest-console.json b/specs/swagger2-latest-console.json index 145eab2678..f01269e055 100644 --- a/specs/swagger2-latest-console.json +++ b/specs/swagger2-latest-console.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"version":"0.12.3","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":"HOSTNAME","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":47,"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":37,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete 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":56,"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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":54,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":46,"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:{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":50,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":52,"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":53,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 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":48,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":55,"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":{},"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":60,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":61,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":49,"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":38,"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 at least 8 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":59,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":45,"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\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":43,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":44,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":39,"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, notion, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, yahoo, yammer, yandex, wordpress, stripe.","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":"","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":"","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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":51,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":58,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":57,"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 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":62,"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},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":63,"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 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":65,"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":64,"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":68,"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":66,"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":67,"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":70,"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":69,"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":72,"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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":71,"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":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[COLLECTION_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/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":73,"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 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":77,"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 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]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name","permission"]}}]},"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":78,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databaseListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":87,"cookies":false,"type":"","demo":"database\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databaseCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a boolean attribute.\n","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":86,"cookies":false,"type":"","demo":"database\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databaseCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an email attribute.\n","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":80,"cookies":false,"type":"","demo":"database\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databaseCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":81,"cookies":false,"type":"","demo":"database\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databaseCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":85,"cookies":false,"type":"","demo":"database\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"number","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"number","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databaseCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":84,"cookies":false,"type":"","demo":"database\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databaseCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create IP address attribute.\n","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":82,"cookies":false,"type":"","demo":"database\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databaseCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a string attribute.\n","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":79,"cookies":false,"type":"","demo":"database\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databaseCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a URL attribute.\n","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":83,"cookies":false,"type":"","demo":"database\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databaseGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":88,"cookies":false,"type":"","demo":"database\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databaseDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":89,"cookies":false,"type":"","demo":"database\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","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":95,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"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":94,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","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":96,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"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":98,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":{},"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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":99,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databaseListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the document activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":97,"cookies":false,"type":"","demo":"database\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databaseListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":91,"cookies":false,"type":"","demo":"database\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databaseCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":90,"cookies":false,"type":"","demo":"database\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/database\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databaseGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":92,"cookies":false,"type":"","demo":"database\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databaseDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":93,"cookies":false,"type":"","demo":"database\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/database\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databaseListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":76,"cookies":false,"type":"","demo":"database\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databaseGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getUsage","weight":74,"cookies":false,"type":"","demo":"database\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/database\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databaseGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":75,"cookies":false,"type":"","demo":"database\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_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":193,"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":"Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":192,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[FUNCTION_ID]"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","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":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List the currently active function runtimes.","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active in your project.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":194,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":195,"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 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":197,"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 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](https:\/\/appwrite.io\/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 that will be passed to the function as environment variables.","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":"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":199,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments":{"get":{"summary":"List Deployments","operationId":"functionsListDeployments","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code deployments. You can use the query params to filter your results.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"listDeployments","weight":201,"cookies":false,"type":"","demo":"functions\/list-deployments.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-deployments.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 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":"Maximum number of deployments to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 Deployment","operationId":"functionsCreateDeployment","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"createDeployment","weight":200,"cookies":false,"type":"","demo":"functions\/create-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"entrypoint","description":"Entrypoint File.","required":true,"type":"string","x-example":"[ENTRYPOINT]","in":"formData"},{"name":"code","description":"Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.","required":true,"type":"file","in":"formData"},{"name":"activate","description":"Automatically activate the deployment when it is finished building.","required":true,"type":"boolean","x-example":false,"in":"formData"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}":{"get":{"summary":"Get Deployment","operationId":"functionsGetDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code deployment by its unique ID.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"getDeployment","weight":202,"cookies":false,"type":"","demo":"functions\/get-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"patch":{"summary":"Update Function Deployment","operationId":"functionsUpdateDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateDeployment","weight":198,"cookies":false,"type":"","demo":"functions\/update-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"delete":{"summary":"Delete Deployment","operationId":"functionsDeleteDeployment","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code deployment by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDeployment","weight":203,"cookies":false,"type":"","demo":"functions\/delete-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":207,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":205,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":204,"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 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]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":206,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":196,"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 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":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":107,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":118,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":110,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":109,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":115,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":116,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":113,"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\/usage":{"get":{"summary":"Get Usage Queue","operationId":"healthGetQueueUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueUsage","weight":114,"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":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":112,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":117,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":111,"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":100,"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":104,"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":101,"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":102,"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":103,"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":105,"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":106,"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":121,"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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":120,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[PROJECT_ID]"},"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":["projectId","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":122,"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":124,"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":129,"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 at least 8 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":127,"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":"integer","description":"Set the max number of users allowed in this project. Use 0 for unlimited.","default":null,"x-example":0}},"required":["limit"]}}]}},"\/projects\/{projectId}\/auth\/{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":128,"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,magic-url,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":146,"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":145,"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":147,"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":149,"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":148,"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":136,"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":135,"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":137,"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":138,"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":139,"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":126,"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":141,"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":140,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":"[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":142,"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":143,"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":144,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":125,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":123,"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":131,"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":130,"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":132,"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":133,"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":134,"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\/buckets":{"get":{"summary":"List buckets","operationId":"storageListBuckets","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the storage buckets. You can use the query params to filter your results.","responses":{"200":{"description":"Buckets List","schema":{"$ref":"#\/definitions\/bucketList"}}},"x-appwrite":{"method":"listBuckets","weight":151,"cookies":false,"type":"","demo":"storage\/list-buckets.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"cursor","description":"ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 bucket","operationId":"storageCreateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new storage bucket.","responses":{"201":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"createBucket","weight":150,"cookies":false,"type":"","demo":"storage\/create-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"bucketId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[BUCKET_ID]"},"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":30000000,"x-example":null},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["bucketId","name","permission"]}}]}},"\/storage\/buckets\/{bucketId}":{"get":{"summary":"Get Bucket","operationId":"storageGetBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"getBucket","weight":152,"cookies":false,"type":"","demo":"storage\/get-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]},"put":{"summary":"Update Bucket","operationId":"storageUpdateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a storage bucket by its unique ID.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"updateBucket","weight":153,"cookies":false,"type":"","demo":"storage\/update-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":null,"x-example":null},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Bucket","operationId":"storageDeleteBucket","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a storage bucket by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteBucket","weight":154,"cookies":false,"type":"","demo":"storage\/delete-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["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":156,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":155,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/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":157,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":161,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":162,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":159,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":158,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":160,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":163,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":164,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":166,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":165,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":167,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":168,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":169,"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 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":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":171,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":170,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":172,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":173,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). 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":175,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":174,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":177,"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":"Maximum number of users to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":176,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":191,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":178,"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 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":190,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":186,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":181,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":184,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":185,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/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":179,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"usersUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":187,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":180,"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 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":189,"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 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":188,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":182,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateVerification","weight":183,"cookies":false,"type":"","demo":"users\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}}},"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":{"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["sum","documents"]},"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["sum","collections"]},"indexList":{"description":"Indexes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["sum","indexes"]},"userList":{"description":"Users List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["sum","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["sum","files"]},"bucketList":{"description":"Buckets List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"buckets":{"type":"array","description":"List of buckets.","items":{"type":"object","$ref":"#\/definitions\/bucket"},"x-example":""}},"required":["sum","buckets"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["sum","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["sum","runtimes"]},"deploymentList":{"description":"Deployments List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"deployments":{"type":"array","description":"List of deployments.","items":{"type":"object","$ref":"#\/definitions\/deployment"},"x-example":""}},"required":["sum","deployments"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["sum","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["sum","metrics"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$read","$write","name","enabled","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["sum","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"integer","description":"Attribute size.","x-example":128,"format":"int32"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":"primary"},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"integer","description":"Date, the Unix timestamp of when the access token expires.","x-example":1592981250,"format":"int32"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"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"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$read","$write","name","dateCreated","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"bucket":{"description":"Bucket","type":"object","properties":{"$id":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":["role:all"]},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":["user:608f9da25e7e1"]},"permission":{"type":"string","description":"Bucket permission model. Possible values: `bucket` or `file`","x-example":"file"},"dateCreated":{"type":"integer","description":"Bucket creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Bucket update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Bucket name.","x-example":"Documents"},"enabled":{"type":"boolean","description":"Bucket enabled.","x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size supported.","x-example":100,"format":"int32"},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions.","items":{"type":"string"},"x-example":["jpg","png"]},"encryption":{"type":"boolean","description":"Bucket is encrypted.","x-example":false},"antivirus":{"type":"boolean","description":"Virus scanning is enabled.","x-example":false}},"required":["$id","$read","$write","permission","dateCreated","dateUpdated","name","enabled","maximumFileSize","allowedFileExtensions","encryption","antivirus"]},"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"},"execute":{"type":"array","description":"Execution permissions.","items":{"type":"string"},"x-example":"role:member"},"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"},"runtime":{"type":"string","description":"Function execution runtime.","x-example":"python-3.8"},"deployment":{"type":"string","description":"Function's active deployment ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"object","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","execute","name","dateCreated","dateUpdated","status","runtime","deployment","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"deployment":{"description":"Deployment","type":"object","properties":{"$id":{"type":"string","description":"Deployment ID.","x-example":"5e5ea5c16897e"},"resourceId":{"type":"string","description":"Resource ID.","x-example":"5e5ea6g16897e"},"resourceType":{"type":"string","description":"Resource type.","x-example":"functions"},"dateCreated":{"type":"integer","description":"The deployment creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"entrypoint":{"type":"string","description":"The entrypoint file to use to execute the deployment code.","x-example":"enabled"},"size":{"type":"integer","description":"The code size in bytes.","x-example":128,"format":"int32"},"buildId":{"type":"string","description":"The current build ID.","x-example":"5e5ea5c16897e"},"activate":{"type":"boolean","description":"Whether the deployment should be automatically activated.","x-example":true},"status":{"type":"string","description":"The deployment status.","x-example":"enabled"},"buildStdout":{"type":"string","description":"The build stdout.","x-example":"enabled"},"buildStderr":{"type":"string","description":"The build stderr.","x-example":"enabled"}},"required":["$id","resourceId","resourceType","dateCreated","entrypoint","size","buildId","activate","status","buildStdout","buildStderr"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"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"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$read","functionId","dateCreated","trigger","status","statusCode","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"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerNotionAppid":{"type":"string","description":"Notion OAuth app ID.","x-example":"123247283472834787438"},"providerNotionSecret":{"type":"string","description":"Notion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerVkAppid":{"type":"string","description":"VK OAuth app ID.","x-example":"123247283472834787438"},"providerVkSecret":{"type":"string","description":"VK OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYammerAppid":{"type":"string","description":"Yammer OAuth app ID.","x-example":"123247283472834787438"},"providerYammerSecret":{"type":"string","description":"Yammer OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerStripeAppid":{"type":"string","description":"Stripe OAuth app ID.","x-example":"123247283472834787438"},"providerStripeSecret":{"type":"string","description":"Stripe OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabase":{"type":"boolean","description":"Database service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDiscordAppid","providerDiscordSecret","providerDropboxAppid","providerDropboxSecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerNotionAppid","providerNotionSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerVkAppid","providerVkSecret","providerYahooAppid","providerYahooSecret","providerYammerAppid","providerYammerSecret","providerYandexAppid","providerYandexSecret","providerWordpressAppid","providerWordpressSecret","providerStripeAppid","providerStripeSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabase","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"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"]},"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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by files (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"tagsStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by tags (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCount":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCount":{"type":"array","description":"Aggregated stats for total number of buckets.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCreate":{"type":"array","description":"Aggregated stats for buckets created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsRead":{"type":"array","description":"Aggregated stats for buckets read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsUpdate":{"type":"array","description":"Aggregated stats for buckets updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsDelete":{"type":"array","description":"Aggregated stats for buckets deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesStorage","tagsStorage","filesCount","bucketsCount","bucketsCreate","bucketsRead","bucketsUpdate","bucketsDelete","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesStorage":{"type":"array","description":"Aggregated stats for total storage of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesStorage","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"functionsExecutions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsFailures":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsCompute":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","functionsExecutions","functionsFailures","functionsCompute"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","functions","documents","collections","users","storage"]}},"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.13.1","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":"HOSTNAME","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":47,"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":37,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete 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":56,"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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":54,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":46,"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:{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":50,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":52,"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":53,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 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":48,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":55,"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":{},"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":60,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":61,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":49,"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":38,"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 at least 8 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":59,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":45,"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\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":43,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":44,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":39,"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, notion, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, yahoo, yammer, yandex, wordpress, stripe.","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":"","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":"","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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":51,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":58,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":57,"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 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":62,"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},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":63,"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 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":65,"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":64,"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":68,"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":66,"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":67,"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":70,"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":69,"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":95,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"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":94,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","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":96,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"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":98,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":{},"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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":99,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":207,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":205,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":204,"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 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]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":206,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/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":100,"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":104,"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":101,"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":102,"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":103,"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":105,"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":106,"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\/buckets\/{bucketId}\/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":156,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":155,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/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":157,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":161,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":162,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":159,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":158,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":160,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":166,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":165,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":167,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":168,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":169,"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 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":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":171,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":170,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":172,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":173,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). 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":175,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":174,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}}},"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":{"documentList":{"description":"Documents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of documents documents that matched your query.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["total","documents"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of sessions documents that matched your query.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["total","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"total":{"type":"integer","description":"Total number of logs documents that matched your query.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["total","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"total":{"type":"integer","description":"Total number of files documents that matched your query.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["total","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"total":{"type":"integer","description":"Total number of teams documents that matched your query.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["total","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"total":{"type":"integer","description":"Total number of memberships documents that matched your query.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["total","memberships"]},"executionList":{"description":"Executions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of executions documents that matched your query.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["total","executions"]},"countryList":{"description":"Countries List","type":"object","properties":{"total":{"type":"integer","description":"Total number of countries documents that matched your query.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["total","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of continents documents that matched your query.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["total","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"total":{"type":"integer","description":"Total number of languages documents that matched your query.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["total","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"total":{"type":"integer","description":"Total number of currencies documents that matched your query.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["total","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"total":{"type":"integer","description":"Total number of phones documents that matched your query.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["total","phones"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"integer","description":"Date, the Unix timestamp of when the access token expires.","x-example":1592981250,"format":"int32"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"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"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$read","$write","name","dateCreated","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"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"},"total":{"type":"integer","description":"Total number of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","total"]},"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"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"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"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$read","functionId","dateCreated","trigger","status","statusCode","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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file diff --git a/templates/web/src/sdk.ts.twig b/templates/web/src/sdk.ts.twig index 4c3c87db21..ff3af475cb 100644 --- a/templates/web/src/sdk.ts.twig +++ b/templates/web/src/sdk.ts.twig @@ -463,7 +463,7 @@ class {{ spec.title | caseUcfirst }} { * @returns {% if method.type == 'webAuth' %}{void|string}{% elseif method.type == 'location' %}{URL}{% else %}{Promise}{% endif %} */ - {{ method.name | caseCamel }}: {% if method.type != 'location' and method.type != 'webAuth'%}async {% if spec.definitions[method.responseModel].additionalProperties %}<{{method.responseModel | caseUcfirst}} extends Models.{{method.responseModel | caseUcfirst}}>{% endif %}{% for property in spec.definitions[method.responseModel].properties %}{% if spec.definitions[property.sub_schema].additionalProperties %}<{{property.sub_schema | caseUcfirst}} extends Models.{{property.sub_schema | caseUcfirst}}>{% endif %}{% endfor %}{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): {% if method.type == 'webAuth' %}void | URL{% elseif method.type == 'location' %}URL{% else %}Promise<{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% for property in spec.definitions[method.responseModel].properties %}{% if spec.definitions[property.sub_schema].additionalProperties %}<{{property.sub_schema | caseUcfirst}}>{% endif %}{% endfor %}{% else %}{}{% endif %}>{% endif %} => { + {{ method.name | caseCamel }}: {% if method.type != 'location' and method.type != 'webAuth'%}async {{ method.responseModel | getGenerics(spec) | raw }}{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | getPropertyType(method) | raw }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): {{ method | getReturn(spec) | raw }} => { {% for parameter in method.parameters.all %} {% if parameter.required %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { From a01137e818a66106f64e77152e2615b62d68595c Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 9 Mar 2022 12:20:58 +0100 Subject: [PATCH 006/555] fix: whitespace --- templates/web/src/sdk.ts.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/web/src/sdk.ts.twig b/templates/web/src/sdk.ts.twig index ff3af475cb..de442f9642 100644 --- a/templates/web/src/sdk.ts.twig +++ b/templates/web/src/sdk.ts.twig @@ -6,7 +6,6 @@ namespace Models { /** * {{ definition.description }} */ - export type {{ definition.name | caseUcfirst }}{{ definition.name | getGenerics(spec, true) | raw }} = { {% for property in definition.properties %} /** From d03dbaf6d82bb973f6d99ac70f9585b7c5293461 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 16 Mar 2022 16:56:56 +0000 Subject: [PATCH 007/555] Handle converting unix commands to windows ones --- templates/cli/lib/commands/init.js.twig | 54 ++++++++++++++++++++----- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index c006f4a9e6..dced6fc551 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -71,20 +71,54 @@ const initFunction = async () => { parseOutput: false }) - let command = ` - mkdir -m 777 -p 'functions/${answers.name}' && \ - cd 'functions/${answers.name}' && \ + let initFirstCommand = ` + cd '${answers.name}' && \ git init && \ git remote add -f origin https://github.com/{{ sdk.gitUserName }}/functions-starter && \ - git config core.sparseCheckout true && \ - echo '${answers.runtime.id}' >> .git/info/sparse-checkout && \ - git pull origin main && \ - rm -rf .git && \ - mv ${answers.runtime.id}/* . && \ - rm -rf ${answers.runtime.id}`; + git config core.sparseCheckout true`; + + let initSecondCommand = ` + cd '${answers.name}' && \ + git pull origin dev && \ + git checkout dev`; + + // Convert commands from unix based ones to windows based ones + if (process.platform == 'win32') { + initFirstCommand = initFirstCommand.replace(/'/g, '"').replace(/\\/g, '').replace(/\n/g, '').replace(/ +/g, ' '); + initFirstCommand = 'cmd /c "' + initFirstCommand + '"'; + initSecondCommand = initSecondCommand.replace(/'/g, '"').replace(/\\/g, '').replace(/\n/g, '').replace(/ +/g, ' '); + initSecondCommand = 'cmd /c "' + initSecondCommand + '"'; + } + + fs.mkdirSync(answers.name, { recursive: true }); + fs.chmodSync(answers.name, 0o777); // Execute the child process but do not print any std output - childProcess.execSync(command, { stdio: 'pipe' }); + childProcess.execSync(initFirstCommand, { stdio: 'pipe' }); + + fs.writeFileSync(`${answers.name}/.git/info/sparse-checkout`, answers.runtime.id); + + childProcess.execSync(initSecondCommand, { stdio: 'pipe' }); + + fs.rmSync(`${answers.name}/.git`, { recursive: true, force: true }); + + // Copy files + function copyFolderSync(from, to) { + if (!fs.existsSync(to)) { + fs.mkdirSync(to, { recursive: true }); + } + + fs.readdirSync(from).forEach(element => { + if (fs.lstatSync(path.join(from, element)).isFile()) { + fs.copyFileSync(path.join(from, element), path.join(to, element)); + } else { + copyFolderSync(path.join(from, element), path.join(to, element)); + } + }); +} + + copyFolderSync(`./${answers.name}/${answers.runtime.id}`, `./${answers.name}/`); + fs.rmSync(`./${answers.name}/${answers.runtime.id}`, { recursive: true, force: true }); const readmePath = path.join(process.cwd(), 'functions', answers.name, 'README.md'); const readmeFile = fs.readFileSync(readmePath).toString(); From 89751a1d9f7a3c5cfa9e7542d5dae03ed5235db0 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 27 Apr 2022 16:47:44 +0200 Subject: [PATCH 008/555] fix: update to latest master --- example.php | 2 +- specs/swagger-latest-console.json | 13059 +++++++++++++++++++++++++++ specs/swagger2-latest-console.json | 1 - templates/web/package.json.twig | 16 +- tests/WebChromiumTest.php | 6 +- 5 files changed, 13071 insertions(+), 13 deletions(-) create mode 100644 specs/swagger-latest-console.json delete mode 100644 specs/swagger2-latest-console.json diff --git a/example.php b/example.php index 89d5a61b48..4a4dece3cb 100644 --- a/example.php +++ b/example.php @@ -39,7 +39,7 @@ function getSSLPage($url) { // $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1'); // Enable only with Appwrite local server running on port 80 // $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1&platform=console'); // Enable only with Appwrite local server running on port 80 // $spec = file_get_contents('https://appwrite.io/specs/swagger2?platform=client'); - $spec = file_get_contents('./specs/swagger2-latest-console.json'); + $spec = file_get_contents('./specs/swagger-latest-console.json'); if(empty($spec)) { throw new Exception('Failed to fetch spec from Appwrite server'); diff --git a/specs/swagger-latest-console.json b/specs/swagger-latest-console.json new file mode 100644 index 0000000000..5523aad283 --- /dev/null +++ b/specs/swagger-latest-console.json @@ -0,0 +1,13059 @@ +{ + "swagger": "2.0", + "info": { + "version": "0.13.4", + "title": "Appwrite", + "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)", + "termsOfService": "https://appwrite.io/policy/terms", + "contact": { + "name": "Appwrite Team", + "url": "https://appwrite.io/support", + "email": "team@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE" + } + }, + "host": "HOSTNAME", + "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": 47, + "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": 37, + "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": { + "userId": { + "type": "string", + "description": "Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "[USER_ID]" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "[NAME]" + } + }, + "required": ["userId", "email", "password"] + } + } + ] + }, + "delete": { + "summary": "Delete Account", + "operationId": "accountDelete", + "consumes": ["application/json"], + "produces": [], + "tags": ["account"], + "description": "Delete 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": 56, + "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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "schema": { "$ref": "#/definitions/user" } + } + }, + "x-appwrite": { + "method": "updateEmail", + "weight": 54, + "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 at least 8 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 in that time frame.", + "responses": { + "201": { + "description": "JWT", + "schema": { "$ref": "#/definitions/jwt" } + } + }, + "x-appwrite": { + "method": "createJWT", + "weight": 46, + "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:{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": 50, + "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": [] }], + "parameters": [ + { + "name": "limit", + "description": "Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + } + ] + } + }, + "/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": 52, + "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, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "schema": { "$ref": "#/definitions/user" } + } + }, + "x-appwrite": { + "method": "updatePassword", + "weight": 53, + "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 at least 8 chars.", + "default": null, + "x-example": "password" + }, + "oldPassword": { + "type": "string", + "description": "Current user password. Must be at least 8 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": 48, + "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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "schema": { "$ref": "#/definitions/user" } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "weight": 55, + "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": {}, + "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": 60, + "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}", "ip:{ip}"], + "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": "Create Password Recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["account"], + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](/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": 61, + "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 ID.", + "default": null, + "x-example": "[USER_ID]" + }, + "secret": { + "type": "string", + "description": "Valid reset token.", + "default": null, + "x-example": "[SECRET]" + }, + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + }, + "passwordAgain": { + "type": "string", + "description": "Repeat new user password. Must be at least 8 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": 49, + "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": 38, + "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 at least 8 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": 59, + "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, you need to update its [email and password](/docs/client/account#accountUpdateEmail) or create an [OAuth2 session](/docs/client/account#accountCreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "schema": { "$ref": "#/definitions/session" } + } + }, + "x-appwrite": { + "method": "createAnonymousSession", + "weight": 45, + "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/magic-url": { + "post": { + "summary": "Create Magic URL session", + "operationId": "accountCreateMagicURLSession", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["account"], + "description": "Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT /account/sessions/magic-url](/docs/client/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.", + "responses": { + "201": { + "description": "Token", + "schema": { "$ref": "#/definitions/token" } + } + }, + "x-appwrite": { + "method": "createMagicURLSession", + "weight": 43, + "cookies": false, + "type": "", + "demo": "account/create-magic-u-r-l-session.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/account/create-magic-url-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": { + "userId": { + "type": "string", + "description": "Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "[USER_ID]" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": "", + "x-example": "https://example.com" + } + }, + "required": ["userId", "email"] + } + } + ] + }, + "put": { + "summary": "Create Magic URL session (confirmation)", + "operationId": "accountUpdateMagicURLSession", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["account"], + "description": "Use this endpoint to complete creating the session with the Magic URL. 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/sessions/magic-url](/docs/client/account#accountCreateMagicURLSession) 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": "Session", + "schema": { "$ref": "#/definitions/session" } + } + }, + "x-appwrite": { + "method": "updateMagicURLSession", + "weight": 44, + "cookies": false, + "type": "", + "demo": "account/update-magic-u-r-l-session.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/account/update-magic-url-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": ["client"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [] }], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "[USER_ID]" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "[SECRET]" + } + }, + "required": ["userId", "secret"] + } + } + ] + } + }, + "/account/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n", + "responses": { "301": { "description": "No content" } }, + "x-appwrite": { + "method": "createOAuth2Session", + "weight": 39, + "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, notion, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, zoom, yahoo, yammer, yandex, wordpress, stripe.", + "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": "", + "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": "", + "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}": { + "get": { + "summary": "Get Session By ID", + "operationId": "accountGetSession", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["account"], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "schema": { "$ref": "#/definitions/session" } + } + }, + "x-appwrite": { + "method": "getSession", + "weight": 51, + "cookies": false, + "type": "", + "demo": "account/get-session.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/account/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": ["client", "server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "JWT": [] }], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "type": "string", + "x-example": "[SESSION_ID]", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update Session (Refresh Tokens)", + "operationId": "accountUpdateSession", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["account"], + "description": "Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to \"refresh\" the access token.", + "responses": { + "200": { + "description": "Session", + "schema": { "$ref": "#/definitions/session" } + } + }, + "x-appwrite": { + "method": "updateSession", + "weight": 58, + "cookies": false, + "type": "", + "demo": "account/update-session.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/account/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": ["client", "server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "JWT": [] }], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "type": "string", + "x-example": "[SESSION_ID]", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete 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 Session ID argument, only the unique session ID provided is deleted.\n", + "responses": { "204": { "description": "No content" } }, + "x-appwrite": { + "method": "deleteSession", + "weight": 57, + "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 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": 62, + "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},userId:{userId}", + "scope": "account", + "platforms": ["client", "server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "JWT": [] }], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", + "default": null, + "x-example": "https://example.com" + } + }, + "required": ["url"] + } + } + ] + }, + "put": { + "summary": "Create Email Verification (confirmation)", + "operationId": "accountUpdateVerification", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["account"], + "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "schema": { "$ref": "#/definitions/token" } + } + }, + "x-appwrite": { + "method": "updateVerification", + "weight": 63, + "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 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 [GET /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { "description": "Image", "schema": { "type": "file" } } + }, + "x-appwrite": { + "method": "getBrowser", + "weight": 65, + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { "description": "Image", "schema": { "type": "file" } } + }, + "x-appwrite": { + "method": "getCreditCard", + "weight": 64, + "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": 68, + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { "description": "Image", "schema": { "type": "file" } } + }, + "x-appwrite": { + "method": "getFlag", + "weight": 66, + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n", + "responses": { + "200": { "description": "Image", "schema": { "type": "file" } } + }, + "x-appwrite": { + "method": "getImage", + "weight": 67, + "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. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400, + "in": "query" + } + ] + } + }, + "/avatars/initials": { + "get": { + "summary": "Get User Initials", + "operationId": "avatarsGetInitials", + "consumes": ["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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { "description": "Image", "schema": { "type": "file" } } + }, + "x-appwrite": { + "method": "getInitials", + "weight": 70, + "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.\n", + "responses": { + "200": { "description": "Image", "schema": { "type": "file" } } + }, + "x-appwrite": { + "method": "getQR", + "weight": 69, + "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 1 to 1000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 400, + "in": "query" + }, + { + "name": "margin", + "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 1, + "in": "query" + }, + { + "name": "download", + "description": "Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.", + "required": false, + "type": "boolean", + "x-example": false, + "default": false, + "in": "query" + } + ] + } + }, + "/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": 72, + "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": "Maximum number of collection to return in response. 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. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "cursor", + "description": "ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.", + "required": false, + "type": "string", + "x-example": "[CURSOR]", + "default": "", + "in": "query" + }, + { + "name": "cursorDirection", + "description": "Direction of the cursor.", + "required": false, + "type": "string", + "x-example": "after", + "default": "after", + "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": 71, + "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": { + "collectionId": { + "type": "string", + "description": "Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "[COLLECTION_ID]" + }, + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "default": null, + "x-example": "[NAME]" + }, + "permission": { + "type": "string", + "description": "Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "document" + }, + "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "[\"role:all\"]", + "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "[\"role:all\"]", + "items": { "type": "string" } + } + }, + "required": [ + "collectionId", + "name", + "permission", + "read", + "write" + ] + } + } + ] + } + }, + "/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": 73, + "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 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": 77, + "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 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]" + }, + "permission": { + "type": "string", + "description": "Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "document" + }, + "read": { + "type": "array", + "description": "An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "[\"role:all\"]", + "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "[\"role:all\"]", + "items": { "type": "string" } + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled?", + "default": true, + "x-example": false + } + }, + "required": ["name", "permission"] + } + } + ] + }, + "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": 78, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + } + ] + } + }, + "/database/collections/{collectionId}/attributes": { + "get": { + "summary": "List Attributes", + "operationId": "databaseListAttributes", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "", + "responses": { + "200": { + "description": "Attributes List", + "schema": { "$ref": "#/definitions/attributeList" } + } + }, + "x-appwrite": { + "method": "listAttributes", + "weight": 87, + "cookies": false, + "type": "", + "demo": "database/list-attributes.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/list-attributes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + } + ] + } + }, + "/database/collections/{collectionId}/attributes/boolean": { + "post": { + "summary": "Create Boolean Attribute", + "operationId": "databaseCreateBooleanAttribute", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "Create a boolean attribute.\n", + "responses": { + "201": { + "description": "AttributeBoolean", + "schema": { "$ref": "#/definitions/attributeBoolean" } + } + }, + "x-appwrite": { + "method": "createBooleanAttribute", + "weight": 86, + "cookies": false, + "type": "", + "demo": "database/create-boolean-attribute.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": ["key", "required"] + } + } + ] + } + }, + "/database/collections/{collectionId}/attributes/email": { + "post": { + "summary": "Create Email Attribute", + "operationId": "databaseCreateEmailAttribute", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "Create an email attribute.\n", + "responses": { + "201": { + "description": "AttributeEmail", + "schema": { "$ref": "#/definitions/attributeEmail" } + } + }, + "x-appwrite": { + "method": "createEmailAttribute", + "weight": 80, + "cookies": false, + "type": "", + "demo": "database/create-email-attribute.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": ["key", "required"] + } + } + ] + } + }, + "/database/collections/{collectionId}/attributes/enum": { + "post": { + "summary": "Create Enum Attribute", + "operationId": "databaseCreateEnumAttribute", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "", + "responses": { + "201": { + "description": "AttributeEnum", + "schema": { "$ref": "#/definitions/attributeEnum" } + } + }, + "x-appwrite": { + "method": "createEnumAttribute", + "weight": 81, + "cookies": false, + "type": "", + "demo": "database/create-enum-attribute.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-attribute-enum.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type. Uses length of longest element to determine size.", + "default": null, + "x-example": null, + "items": { "type": "string" } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "[DEFAULT]" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": ["key", "elements", "required"] + } + } + ] + } + }, + "/database/collections/{collectionId}/attributes/float": { + "post": { + "summary": "Create Float Attribute", + "operationId": "databaseCreateFloatAttribute", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "201": { + "description": "AttributeFloat", + "schema": { "$ref": "#/definitions/attributeFloat" } + } + }, + "x-appwrite": { + "method": "createFloatAttribute", + "weight": 85, + "cookies": false, + "type": "", + "demo": "database/create-float-attribute.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value to enforce on new documents", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value to enforce on new documents", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": ["key", "required"] + } + } + ] + } + }, + "/database/collections/{collectionId}/attributes/integer": { + "post": { + "summary": "Create Integer Attribute", + "operationId": "databaseCreateIntegerAttribute", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "201": { + "description": "AttributeInteger", + "schema": { "$ref": "#/definitions/attributeInteger" } + } + }, + "x-appwrite": { + "method": "createIntegerAttribute", + "weight": 84, + "cookies": false, + "type": "", + "demo": "database/create-integer-attribute.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce on new documents", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce on new documents", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": ["key", "required"] + } + } + ] + } + }, + "/database/collections/{collectionId}/attributes/ip": { + "post": { + "summary": "Create IP Address Attribute", + "operationId": "databaseCreateIpAttribute", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "Create IP address attribute.\n", + "responses": { + "201": { + "description": "AttributeIP", + "schema": { "$ref": "#/definitions/attributeIp" } + } + }, + "x-appwrite": { + "method": "createIpAttribute", + "weight": 82, + "cookies": false, + "type": "", + "demo": "database/create-ip-attribute.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": ["key", "required"] + } + } + ] + } + }, + "/database/collections/{collectionId}/attributes/string": { + "post": { + "summary": "Create String Attribute", + "operationId": "databaseCreateStringAttribute", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "Create a string attribute.\n", + "responses": { + "201": { + "description": "AttributeString", + "schema": { "$ref": "#/definitions/attributeString" } + } + }, + "x-appwrite": { + "method": "createStringAttribute", + "weight": 79, + "cookies": false, + "type": "", + "demo": "database/create-string-attribute.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "size": { + "type": "integer", + "description": "Attribute size for text attributes, in number of characters.", + "default": null, + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "[DEFAULT]" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": ["key", "size", "required"] + } + } + ] + } + }, + "/database/collections/{collectionId}/attributes/url": { + "post": { + "summary": "Create URL Attribute", + "operationId": "databaseCreateUrlAttribute", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "Create a URL attribute.\n", + "responses": { + "201": { + "description": "AttributeURL", + "schema": { "$ref": "#/definitions/attributeUrl" } + } + }, + "x-appwrite": { + "method": "createUrlAttribute", + "weight": 83, + "cookies": false, + "type": "", + "demo": "database/create-url-attribute.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "https://example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": ["key", "required"] + } + } + ] + } + }, + "/database/collections/{collectionId}/attributes/{key}": { + "get": { + "summary": "Get Attribute", + "operationId": "databaseGetAttribute", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "", + "responses": { + "200": { + "description": "AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString", + "schema": { + "x-oneOf": [ + { "$ref": "#/definitions/attributeBoolean" }, + { "$ref": "#/definitions/attributeInteger" }, + { "$ref": "#/definitions/attributeFloat" }, + { "$ref": "#/definitions/attributeEmail" }, + { "$ref": "#/definitions/attributeEnum" }, + { "$ref": "#/definitions/attributeUrl" }, + { "$ref": "#/definitions/attributeIp" }, + { "$ref": "#/definitions/attributeString" } + ] + } + } + }, + "x-appwrite": { + "method": "getAttribute", + "weight": 88, + "cookies": false, + "type": "", + "demo": "database/get-attribute.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/get-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete Attribute", + "operationId": "databaseDeleteAttribute", + "consumes": ["application/json"], + "produces": [], + "tags": ["database"], + "description": "", + "responses": { "204": { "description": "No content" } }, + "x-appwrite": { + "method": "deleteAttribute", + "weight": 89, + "cookies": false, + "type": "", + "demo": "database/delete-attribute.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/delete-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "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": 95, + "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 ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/database#querying-documents).", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { "type": "string" }, + "default": [], + "in": "query" + }, + { + "name": "limit", + "description": "Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "cursor", + "description": "ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "string", + "x-example": "[CURSOR]", + "default": "", + "in": "query" + }, + { + "name": "cursorDirection", + "description": "Direction of the cursor.", + "required": false, + "type": "string", + "x-example": "after", + "default": "after", + "in": "query" + }, + { + "name": "orderAttributes", + "description": "Array of attributes used to sort results.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { "type": "string" }, + "default": [], + "in": "query" + }, + { + "name": "orderTypes", + "description": "Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { "type": "string" }, + "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": 94, + "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 ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection). Make sure to define attributes before creating documents.", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "[DOCUMENT_ID]" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "default": {}, + "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "[\"role:all\"]", + "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "[\"role:all\"]", + "items": { "type": "string" } + } + }, + "required": ["documentId", "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": 96, + "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 ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "[DOCUMENT_ID]", + "in": "path" + } + ] + }, + "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": 98, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "[DOCUMENT_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": {}, + "x-example": "{}" + }, + "read": { + "type": "array", + "description": "An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "[\"role:all\"]", + "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "[\"role:all\"]", + "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.", + "responses": { "204": { "description": "No content" } }, + "x-appwrite": { + "method": "deleteDocument", + "weight": 99, + "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 ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "[DOCUMENT_ID]", + "in": "path" + } + ] + } + }, + "/database/collections/{collectionId}/documents/{documentId}/logs": { + "get": { + "summary": "List Document Logs", + "operationId": "databaseListDocumentLogs", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "Get the document activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { "$ref": "#/definitions/logList" } + } + }, + "x-appwrite": { + "method": "listDocumentLogs", + "weight": 97, + "cookies": false, + "type": "", + "demo": "database/list-document-logs.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/get-document-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": ["console"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "[DOCUMENT_ID]", + "in": "path" + }, + { + "name": "limit", + "description": "Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + } + ] + } + }, + "/database/collections/{collectionId}/indexes": { + "get": { + "summary": "List Indexes", + "operationId": "databaseListIndexes", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "", + "responses": { + "200": { + "description": "Indexes List", + "schema": { "$ref": "#/definitions/indexList" } + } + }, + "x-appwrite": { + "method": "listIndexes", + "weight": 91, + "cookies": false, + "type": "", + "demo": "database/list-indexes.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + } + ] + }, + "post": { + "summary": "Create Index", + "operationId": "databaseCreateIndex", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "", + "responses": { + "201": { + "description": "Index", + "schema": { "$ref": "#/definitions/index" } + } + }, + "x-appwrite": { + "method": "createIndex", + "weight": 90, + "cookies": false, + "type": "", + "demo": "database/create-index.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "default": null, + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "default": null, + "x-example": "key" + }, + "attributes": { + "type": "array", + "description": "Array of attributes to index.", + "default": null, + "x-example": null, + "items": { "type": "string" } + }, + "orders": { + "type": "array", + "description": "Array of index orders.", + "default": [], + "x-example": null, + "items": { "type": "string" } + } + }, + "required": ["key", "type", "attributes"] + } + } + ] + } + }, + "/database/collections/{collectionId}/indexes/{key}": { + "get": { + "summary": "Get Index", + "operationId": "databaseGetIndex", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "", + "responses": { + "200": { + "description": "Index", + "schema": { "$ref": "#/definitions/index" } + } + }, + "x-appwrite": { + "method": "getIndex", + "weight": 92, + "cookies": false, + "type": "", + "demo": "database/get-index.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete Index", + "operationId": "databaseDeleteIndex", + "consumes": ["application/json"], + "produces": [], + "tags": ["database"], + "description": "", + "responses": { "204": { "description": "No content" } }, + "x-appwrite": { + "method": "deleteIndex", + "weight": 93, + "cookies": false, + "type": "", + "demo": "database/delete-index.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "/database/collections/{collectionId}/logs": { + "get": { + "summary": "List Collection Logs", + "operationId": "databaseListCollectionLogs", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "Get the collection activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { "$ref": "#/definitions/logList" } + } + }, + "x-appwrite": { + "method": "listCollectionLogs", + "weight": 76, + "cookies": false, + "type": "", + "demo": "database/list-collection-logs.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/get-collection-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": ["console"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [] }], + "parameters": [ + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "[COLLECTION_ID]", + "in": "path" + }, + { + "name": "limit", + "description": "Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + } + ] + } + }, + "/database/usage": { + "get": { + "summary": "Get usage stats for the database", + "operationId": "databaseGetUsage", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "", + "responses": { + "200": { + "description": "UsageDatabase", + "schema": { "$ref": "#/definitions/usageDatabase" } + } + }, + "x-appwrite": { + "method": "getUsage", + "weight": 74, + "cookies": false, + "type": "", + "demo": "database/get-usage.md", + "edit": "https://github.com/appwrite/appwrite/edit/master", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": ["console"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [] }], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "default": "30d", + "in": "query" + } + ] + } + }, + "/database/{collectionId}/usage": { + "get": { + "summary": "Get usage stats for a collection", + "operationId": "databaseGetCollectionUsage", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["database"], + "description": "", + "responses": { + "200": { + "description": "UsageCollection", + "schema": { "$ref": "#/definitions/usageCollection" } + } + }, + "x-appwrite": { + "method": "getCollectionUsage", + "weight": 75, + "cookies": false, + "type": "", + "demo": "database/get-collection-usage.md", + "edit": "https://github.com/appwrite/appwrite/edit/master", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": ["console"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [] }], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "default": "30d", + "in": "query" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "[COLLECTION_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": 193, + "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": "Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "cursor", + "description": "ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "string", + "x-example": "[CURSOR]", + "default": "", + "in": "query" + }, + { + "name": "cursorDirection", + "description": "Direction of the cursor.", + "required": false, + "type": "string", + "x-example": "after", + "default": "after", + "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": 192, + "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": { + "functionId": { + "type": "string", + "description": "Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "[FUNCTION_ID]" + }, + "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": null, + "items": { "type": "string" } + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "default": null, + "x-example": "node-14.5" + }, + "vars": { + "type": "object", + "description": "Key-value JSON object that will be passed to the function as environment variables.", + "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": ["functionId", "name", "execute", "runtime"] + } + } + ] + } + }, + "/functions/runtimes": { + "get": { + "summary": "List runtimes", + "operationId": "functionsListRuntimes", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["functions"], + "description": "Get a list of all runtimes that are currently active on your instance.", + "responses": { + "200": { + "description": "Runtimes List", + "schema": { "$ref": "#/definitions/runtimeList" } + } + }, + "x-appwrite": { + "method": "listRuntimes", + "weight": 194, + "cookies": false, + "type": "", + "demo": "functions/list-runtimes.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/list-runtimes.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": [] }] + } + }, + "/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": 195, + "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 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": 197, + "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 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](https://appwrite.io/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 that will be passed to the function as environment variables.", + "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": "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": 199, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[FUNCTION_ID]", + "in": "path" + } + ] + } + }, + "/functions/{functionId}/deployments": { + "get": { + "summary": "List Deployments", + "operationId": "functionsListDeployments", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["functions"], + "description": "Get a list of all the project's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "schema": { "$ref": "#/definitions/deploymentList" } + } + }, + "x-appwrite": { + "method": "listDeployments", + "weight": 201, + "cookies": false, + "type": "", + "demo": "functions/list-deployments.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/list-deployments.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 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": "Maximum number of deployments to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "cursor", + "description": "ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "string", + "x-example": "[CURSOR]", + "default": "", + "in": "query" + }, + { + "name": "cursorDirection", + "description": "Direction of the cursor.", + "required": false, + "type": "string", + "x-example": "after", + "default": "after", + "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 Deployment", + "operationId": "functionsCreateDeployment", + "consumes": ["multipart/form-data"], + "produces": ["application/json"], + "tags": ["functions"], + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](/docs/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.", + "responses": { + "201": { + "description": "Deployment", + "schema": { "$ref": "#/definitions/deployment" } + } + }, + "x-appwrite": { + "method": "createDeployment", + "weight": 200, + "cookies": false, + "type": "", + "demo": "functions/create-deployment.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/create-deployment.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 ID.", + "required": true, + "type": "string", + "x-example": "[FUNCTION_ID]", + "in": "path" + }, + { + "name": "entrypoint", + "description": "Entrypoint File.", + "required": true, + "type": "string", + "x-example": "[ENTRYPOINT]", + "in": "formData" + }, + { + "name": "code", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "activate", + "description": "Automatically activate the deployment when it is finished building.", + "required": true, + "type": "boolean", + "x-example": false, + "in": "formData" + } + ] + } + }, + "/functions/{functionId}/deployments/{deploymentId}": { + "get": { + "summary": "Get Deployment", + "operationId": "functionsGetDeployment", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["functions"], + "description": "Get a code deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployments List", + "schema": { "$ref": "#/definitions/deploymentList" } + } + }, + "x-appwrite": { + "method": "getDeployment", + "weight": 202, + "cookies": false, + "type": "", + "demo": "functions/get-deployment.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/get-deployment.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 ID.", + "required": true, + "type": "string", + "x-example": "[FUNCTION_ID]", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "[DEPLOYMENT_ID]", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update Function Deployment", + "operationId": "functionsUpdateDeployment", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["functions"], + "description": "Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.", + "responses": { + "200": { + "description": "Function", + "schema": { "$ref": "#/definitions/function" } + } + }, + "x-appwrite": { + "method": "updateDeployment", + "weight": 198, + "cookies": false, + "type": "", + "demo": "functions/update-deployment.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/update-function-deployment.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 ID.", + "required": true, + "type": "string", + "x-example": "[FUNCTION_ID]", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "[DEPLOYMENT_ID]", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete Deployment", + "operationId": "functionsDeleteDeployment", + "consumes": ["application/json"], + "produces": [], + "tags": ["functions"], + "description": "Delete a code deployment by its unique ID.", + "responses": { "204": { "description": "No content" } }, + "x-appwrite": { + "method": "deleteDeployment", + "weight": 203, + "cookies": false, + "type": "", + "demo": "functions/delete-deployment.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/delete-deployment.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 ID.", + "required": true, + "type": "string", + "x-example": "[FUNCTION_ID]", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "[DEPLOYMENT_ID]", + "in": "path" + } + ] + } + }, + "/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}": { + "post": { + "summary": "Retry Build", + "operationId": "functionsRetryBuild", + "consumes": ["application/json"], + "produces": [], + "tags": ["functions"], + "description": "", + "responses": { "204": { "description": "No content" } }, + "x-appwrite": { + "method": "retryBuild", + "weight": 207, + "cookies": false, + "type": "", + "demo": "functions/retry-build.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/retry-build.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": ["client", "server", "server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [], "JWT": [] }], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "[FUNCTION_ID]", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "[DEPLOYMENT_ID]", + "in": "path" + }, + { + "name": "buildId", + "description": "Build unique ID.", + "required": true, + "type": "string", + "x-example": "[BUILD_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": 205, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[FUNCTION_ID]", + "in": "path" + }, + { + "name": "limit", + "description": "Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "[SEARCH]", + "default": "", + "in": "query" + }, + { + "name": "cursor", + "description": "ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "string", + "x-example": "[CURSOR]", + "default": "", + "in": "query" + }, + { + "name": "cursorDirection", + "description": "Direction of the cursor.", + "required": false, + "type": "string", + "x-example": "after", + "default": "after", + "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": 204, + "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 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]" + }, + "async": { + "type": "boolean", + "description": "Execute code asynchronously. Default value is true.", + "default": true, + "x-example": false + } + } + } + } + ] + } + }, + "/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": 206, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[FUNCTION_ID]", + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "type": "string", + "x-example": "[EXECUTION_ID]", + "in": "path" + } + ] + } + }, + "/functions/{functionId}/usage": { + "get": { + "summary": "Get Function Usage", + "operationId": "functionsGetUsage", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["functions"], + "description": "", + "responses": { + "200": { + "description": "UsageFunctions", + "schema": { "$ref": "#/definitions/usageFunctions" } + } + }, + "x-appwrite": { + "method": "getUsage", + "weight": 196, + "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 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": ["application/json"], + "tags": ["health"], + "description": "Check the Appwrite HTTP server is up and responsive.", + "responses": { + "200": { + "description": "Health Status", + "schema": { "$ref": "#/definitions/healthStatus" } + } + }, + "x-appwrite": { + "method": "get", + "weight": 107, + "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 Antivirus", + "operationId": "healthGetAntivirus", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["health"], + "description": "Check the Appwrite Antivirus server is up and connection is successful.", + "responses": { + "200": { + "description": "Health Antivirus", + "schema": { "$ref": "#/definitions/healthAntivirus" } + } + }, + "x-appwrite": { + "method": "getAntivirus", + "weight": 117, + "cookies": false, + "type": "", + "demo": "health/get-antivirus.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/health/get-storage-anti-virus.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }] + } + }, + "/health/cache": { + "get": { + "summary": "Get Cache", + "operationId": "healthGetCache", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["health"], + "description": "Check the Appwrite in-memory cache server is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { "$ref": "#/definitions/healthStatus" } + } + }, + "x-appwrite": { + "method": "getCache", + "weight": 110, + "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": ["application/json"], + "tags": ["health"], + "description": "Check the Appwrite database server is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { "$ref": "#/definitions/healthStatus" } + } + }, + "x-appwrite": { + "method": "getDB", + "weight": 109, + "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 Certificates Queue", + "operationId": "healthGetQueueCertificates", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["health"], + "description": "Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { "$ref": "#/definitions/healthQueue" } + } + }, + "x-appwrite": { + "method": "getQueueCertificates", + "weight": 114, + "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": ["application/json"], + "tags": ["health"], + "description": "", + "responses": { + "200": { + "description": "Health Queue", + "schema": { "$ref": "#/definitions/healthQueue" } + } + }, + "x-appwrite": { + "method": "getQueueFunctions", + "weight": 115, + "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": ["application/json"], + "tags": ["health"], + "description": "Get the number of logs that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { "$ref": "#/definitions/healthQueue" } + } + }, + "x-appwrite": { + "method": "getQueueLogs", + "weight": 113, + "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/webhooks": { + "get": { + "summary": "Get Webhooks Queue", + "operationId": "healthGetQueueWebhooks", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["health"], + "description": "Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { "$ref": "#/definitions/healthQueue" } + } + }, + "x-appwrite": { + "method": "getQueueWebhooks", + "weight": 112, + "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": ["application/json"], + "tags": ["health"], + "description": "Check the Appwrite local storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { "$ref": "#/definitions/healthStatus" } + } + }, + "x-appwrite": { + "method": "getStorageLocal", + "weight": 116, + "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": ["application/json"], + "tags": ["health"], + "description": "Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.", + "responses": { + "200": { + "description": "Health Time", + "schema": { "$ref": "#/definitions/healthTime" } + } + }, + "x-appwrite": { + "method": "getTime", + "weight": 111, + "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": 100, + "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": 104, + "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": 101, + "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": 102, + "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": 103, + "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": 105, + "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": 106, + "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": 120, + "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. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "cursor", + "description": "ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "string", + "x-example": "[CURSOR]", + "default": "", + "in": "query" + }, + { + "name": "cursorDirection", + "description": "Direction of the cursor.", + "required": false, + "type": "string", + "x-example": "after", + "default": "after", + "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": 119, + "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": { + "projectId": { + "type": "string", + "description": "Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "[PROJECT_ID]" + }, + "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": ["projectId", "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": 121, + "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": 123, + "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": 128, + "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 at least 8 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": 126, + "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": "integer", + "description": "Set the max number of users allowed in this project. Use 0 for unlimited.", + "default": null, + "x-example": 0 + } + }, + "required": ["limit"] + } + } + ] + } + }, + "/projects/{projectId}/auth/{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": 127, + "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,magic-url,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": 145, + "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": 144, + "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": 146, + "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": 148, + "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": 147, + "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": 135, + "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": 134, + "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": 136, + "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": 137, + "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": 138, + "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": 125, + "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": 140, + "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": 139, + "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 or macOS. Max length: 256 chars.", + "default": "", + "x-example": "[KEY]" + }, + "store": { + "type": "string", + "description": "App store or Google Play store ID. Max length: 256 chars.", + "default": "", + "x-example": "[STORE]" + }, + "hostname": { + "type": "string", + "description": "Platform client hostname. Max length: 256 chars.", + "default": "", + "x-example": "[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": 141, + "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": 142, + "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": 143, + "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}/service": { + "patch": { + "summary": "Update service status", + "operationId": "projectsUpdateServiceStatus", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["projects"], + "description": "", + "responses": { + "200": { + "description": "Project", + "schema": { "$ref": "#/definitions/project" } + } + }, + "x-appwrite": { + "method": "updateServiceStatus", + "weight": 124, + "cookies": false, + "type": "", + "demo": "projects/update-service-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": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "service": { + "type": "string", + "description": "Service name.", + "default": null, + "x-example": "account" + }, + "status": { + "type": "boolean", + "description": "Service status.", + "default": null, + "x-example": false + } + }, + "required": ["service", "status"] + } + } + ] + } + }, + "/projects/{projectId}/usage": { + "get": { + "summary": "Get usage stats for a project", + "operationId": "projectsGetUsage", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["projects"], + "description": "", + "responses": { + "200": { + "description": "UsageProject", + "schema": { "$ref": "#/definitions/usageProject" } + } + }, + "x-appwrite": { + "method": "getUsage", + "weight": 122, + "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": 130, + "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": 129, + "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": 131, + "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": 132, + "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": 133, + "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/buckets": { + "get": { + "summary": "List buckets", + "operationId": "storageListBuckets", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["storage"], + "description": "Get a list of all the storage buckets. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Buckets List", + "schema": { "$ref": "#/definitions/bucketList" } + } + }, + "x-appwrite": { + "method": "listBuckets", + "weight": 150, + "cookies": false, + "type": "", + "demo": "storage/list-buckets.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/storage/list-buckets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "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": "cursor", + "description": "ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.", + "required": false, + "type": "string", + "x-example": "[CURSOR]", + "default": "", + "in": "query" + }, + { + "name": "cursorDirection", + "description": "Direction of the cursor.", + "required": false, + "type": "string", + "x-example": "after", + "default": "after", + "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 bucket", + "operationId": "storageCreateBucket", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["storage"], + "description": "Create a new storage bucket.", + "responses": { + "201": { + "description": "Bucket", + "schema": { "$ref": "#/definitions/bucket" } + } + }, + "x-appwrite": { + "method": "createBucket", + "weight": 149, + "cookies": false, + "type": "", + "demo": "storage/create-bucket.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/storage/create-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "[BUCKET_ID]" + }, + "name": { + "type": "string", + "description": "Bucket name", + "default": null, + "x-example": "[NAME]" + }, + "permission": { + "type": "string", + "description": "Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "file" + }, + "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": "[\"role:all\"]", + "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": "[\"role:all\"]", + "items": { "type": "string" } + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled?", + "default": true, + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs/environment-variables#storage)", + "default": 30000000, + "x-example": null + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions", + "default": [], + "x-example": null, + "items": { "type": "string" } + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "default": true, + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "default": true, + "x-example": false + } + }, + "required": ["bucketId", "name", "permission"] + } + } + ] + } + }, + "/storage/buckets/{bucketId}": { + "get": { + "summary": "Get Bucket", + "operationId": "storageGetBucket", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["storage"], + "description": "Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.", + "responses": { + "200": { + "description": "Bucket", + "schema": { "$ref": "#/definitions/bucket" } + } + }, + "x-appwrite": { + "method": "getBucket", + "weight": 151, + "cookies": false, + "type": "", + "demo": "storage/get-bucket.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/storage/get-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "[BUCKET_ID]", + "in": "path" + } + ] + }, + "put": { + "summary": "Update Bucket", + "operationId": "storageUpdateBucket", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["storage"], + "description": "Update a storage bucket by its unique ID.", + "responses": { + "200": { + "description": "Bucket", + "schema": { "$ref": "#/definitions/bucket" } + } + }, + "x-appwrite": { + "method": "updateBucket", + "weight": 152, + "cookies": false, + "type": "", + "demo": "storage/update-bucket.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/storage/update-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "[BUCKET_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Bucket name", + "default": null, + "x-example": "[NAME]" + }, + "permission": { + "type": "string", + "description": "Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "file" + }, + "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": "[\"role:all\"]", + "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": "[\"role:all\"]", + "items": { "type": "string" } + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled?", + "default": true, + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs/environment-variables#storage)", + "default": null, + "x-example": null + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions", + "default": [], + "x-example": null, + "items": { "type": "string" } + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "default": true, + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "default": true, + "x-example": false + } + }, + "required": ["name", "permission"] + } + } + ] + }, + "delete": { + "summary": "Delete Bucket", + "operationId": "storageDeleteBucket", + "consumes": ["application/json"], + "produces": [], + "tags": ["storage"], + "description": "Delete a storage bucket by its unique ID.", + "responses": { "204": { "description": "No content" } }, + "x-appwrite": { + "method": "deleteBucket", + "weight": 153, + "cookies": false, + "type": "", + "demo": "storage/delete-bucket.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/storage/delete-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "[BUCKET_ID]", + "in": "path" + } + ] + } + }, + "/storage/buckets/{bucketId}/files": { + "get": { + "summary": "List Files", + "operationId": "storageListFiles", + "consumes": ["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": 155, + "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": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "[BUCKET_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": "Maximum number of files to return in response. 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. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "cursor", + "description": "ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "string", + "x-example": "[CURSOR]", + "default": "", + "in": "query" + }, + { + "name": "cursorDirection", + "description": "Direction of the cursor.", + "required": false, + "type": "string", + "x-example": "after", + "default": "after", + "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. Before using this route, you should create a new bucket resource using either a [server integration](/docs/server/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "schema": { "$ref": "#/definitions/file" } + } + }, + "x-appwrite": { + "method": "createFile", + "weight": 154, + "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": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "[BUCKET_ID]", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "x-upload-id": true, + "type": "string", + "x-example": "[FILE_ID]", + "in": "formData" + }, + { + "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { "type": "string" }, + "x-example": "[\"role:all\"]", + "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { "type": "string" }, + "x-example": "[\"role:all\"]", + "in": "formData" + } + ] + } + }, + "/storage/buckets/{bucketId}/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": 156, + "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": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "[BUCKET_ID]", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "[FILE_ID]", + "in": "path" + } + ] + }, + "put": { + "summary": "Update File", + "operationId": "storageUpdateFile", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["storage"], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "schema": { "$ref": "#/definitions/file" } + } + }, + "x-appwrite": { + "method": "updateFile", + "weight": 160, + "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": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "[BUCKET_ID]", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "[FILE_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "[\"role:all\"]", + "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", + "default": null, + "x-example": "[\"role:all\"]", + "items": { "type": "string" } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete File", + "operationId": "storageDeleteFile", + "consumes": ["application/json"], + "produces": [], + "tags": ["storage"], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { "204": { "description": "No content" } }, + "x-appwrite": { + "method": "deleteFile", + "weight": 161, + "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": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "[BUCKET_ID]", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "[FILE_ID]", + "in": "path" + } + ] + } + }, + "/storage/buckets/{bucketId}/files/{fileId}/download": { + "get": { + "summary": "Get File for Download", + "operationId": "storageGetFileDownload", + "consumes": ["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": 158, + "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": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "[BUCKET_ID]", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "[FILE_ID]", + "in": "path" + } + ] + } + }, + "/storage/buckets/{bucketId}/files/{fileId}/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. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { "description": "Image", "schema": { "type": "file" } } + }, + "x-appwrite": { + "method": "getFilePreview", + "weight": 157, + "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": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "[BUCKET_ID]", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID", + "required": true, + "type": "string", + "x-example": "[FILE_ID]", + "in": "path" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "height", + "description": "Resize preview image height, Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "type": "string", + "x-example": "center", + "default": "center", + "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 -360 and 360.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -360, + "default": 0, + "in": "query" + }, + { + "name": "background", + "description": "Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.", + "required": false, + "type": "string", + "default": "", + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "type": "string", + "x-example": "jpg", + "default": "", + "in": "query" + } + ] + } + }, + "/storage/buckets/{bucketId}/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": 159, + "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": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "[BUCKET_ID]", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "[FILE_ID]", + "in": "path" + } + ] + } + }, + "/storage/usage": { + "get": { + "summary": "Get usage stats for storage", + "operationId": "storageGetUsage", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["storage"], + "description": "", + "responses": { + "200": { + "description": "StorageUsage", + "schema": { "$ref": "#/definitions/usageStorage" } + } + }, + "x-appwrite": { + "method": "getUsage", + "weight": 162, + "cookies": false, + "type": "", + "demo": "storage/get-usage.md", + "edit": "https://github.com/appwrite/appwrite/edit/master", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": ["console"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [] }], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "default": "30d", + "in": "query" + } + ] + } + }, + "/storage/{bucketId}/usage": { + "get": { + "summary": "Get usage stats for a storage bucket", + "operationId": "storageGetBucketUsage", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["storage"], + "description": "", + "responses": { + "200": { + "description": "UsageBuckets", + "schema": { "$ref": "#/definitions/usageBuckets" } + } + }, + "x-appwrite": { + "method": "getBucketUsage", + "weight": 163, + "cookies": false, + "type": "", + "demo": "storage/get-bucket-usage.md", + "edit": "https://github.com/appwrite/appwrite/edit/master", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": ["console"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [] }], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket ID.", + "required": true, + "type": "string", + "x-example": "[BUCKET_ID]", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "default": "30d", + "in": "query" + } + ] + } + }, + "/teams": { + "get": { + "summary": "List Teams", + "operationId": "teamsList", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["teams"], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](/docs/admin).", + "responses": { + "200": { + "description": "Teams List", + "schema": { "$ref": "#/definitions/teamList" } + } + }, + "x-appwrite": { + "method": "list", + "weight": 165, + "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": "Maximum number of teams to return in response. 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. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "cursor", + "description": "ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "string", + "x-example": "[CURSOR]", + "default": "", + "in": "query" + }, + { + "name": "cursorDirection", + "description": "Direction of the cursor.", + "required": false, + "type": "string", + "x-example": "after", + "default": "after", + "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. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "schema": { "$ref": "#/definitions/team" } + } + }, + "x-appwrite": { + "method": "create", + "weight": 164, + "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": { + "teamId": { + "type": "string", + "description": "Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "[TEAM_ID]" + }, + "name": { + "type": "string", + "description": "Team name. Max length: 128 chars.", + "default": null, + "x-example": "[NAME]" + }, + "roles": { + "type": "array", + "description": "Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.", + "default": ["owner"], + "x-example": null, + "items": { "type": "string" } + } + }, + "required": ["teamId", "name"] + } + } + ] + } + }, + "/teams/{teamId}": { + "get": { + "summary": "Get Team", + "operationId": "teamsGet", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["teams"], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "schema": { "$ref": "#/definitions/team" } + } + }, + "x-appwrite": { + "method": "get", + "weight": 166, + "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 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 using its ID. Only members with the owner role can update the team.", + "responses": { + "200": { + "description": "Team", + "schema": { "$ref": "#/definitions/team" } + } + }, + "x-appwrite": { + "method": "update", + "weight": 167, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[TEAM_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "New team name. Max length: 128 chars.", + "default": null, + "x-example": "[NAME]" + } + }, + "required": ["name"] + } + } + ] + }, + "delete": { + "summary": "Delete Team", + "operationId": "teamsDelete", + "consumes": ["application/json"], + "produces": [], + "tags": ["teams"], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { "204": { "description": "No content" } }, + "x-appwrite": { + "method": "delete", + "weight": 168, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[TEAM_ID]", + "in": "path" + } + ] + } + }, + "/teams/{teamId}/logs": { + "get": { + "summary": "List Team Logs", + "operationId": "teamsListLogs", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["teams"], + "description": "Get the team activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { "$ref": "#/definitions/logList" } + } + }, + "x-appwrite": { + "method": "listLogs", + "weight": 175, + "cookies": false, + "type": "", + "demo": "teams/list-logs.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/teams/get-team-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": ["console"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [] }], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "[TEAM_ID]", + "in": "path" + }, + { + "name": "limit", + "description": "Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + } + ] + } + }, + "/teams/{teamId}/memberships": { + "get": { + "summary": "Get Team Memberships", + "operationId": "teamsGetMemberships", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["teams"], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", + "responses": { + "200": { + "description": "Memberships List", + "schema": { "$ref": "#/definitions/membershipList" } + } + }, + "x-appwrite": { + "method": "getMemberships", + "weight": 170, + "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 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": "Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "cursor", + "description": "ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "string", + "x-example": "[CURSOR]", + "default": "", + "in": "query" + }, + { + "name": "cursorDirection", + "description": "Direction of the cursor.", + "required": false, + "type": "string", + "x-example": "after", + "default": "after", + "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": "Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.", + "responses": { + "201": { + "description": "Membership", + "schema": { "$ref": "#/definitions/membership" } + } + }, + "x-appwrite": { + "method": "createMembership", + "weight": 169, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[TEAM_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the new team member.", + "default": null, + "x-example": "email@example.com" + }, + "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" + }, + "name": { + "type": "string", + "description": "Name of the new team member. Max length: 128 chars.", + "default": "", + "x-example": "[NAME]" + } + }, + "required": ["email", "roles", "url"] + } + } + ] + } + }, + "/teams/{teamId}/memberships/{membershipId}": { + "get": { + "summary": "Get Team Membership", + "operationId": "teamsGetMembership", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["teams"], + "description": "Get a team member by the membership unique id. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Memberships List", + "schema": { "$ref": "#/definitions/membershipList" } + } + }, + "x-appwrite": { + "method": "getMembership", + "weight": 171, + "cookies": false, + "type": "", + "demo": "teams/get-membership.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/teams/get-team-member.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": ["client", "server", "server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [], "JWT": [] }], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "[TEAM_ID]", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "[MEMBERSHIP_ID]", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update Membership Roles", + "operationId": "teamsUpdateMembershipRoles", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["teams"], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](/docs/permissions).", + "responses": { + "200": { + "description": "Membership", + "schema": { "$ref": "#/definitions/membership" } + } + }, + "x-appwrite": { + "method": "updateMembershipRoles", + "weight": 172, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[TEAM_ID]", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "[MEMBERSHIP_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). 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": 174, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[TEAM_ID]", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "[MEMBERSHIP_ID]", + "in": "path" + } + ] + } + }, + "/teams/{teamId}/memberships/{membershipId}/status": { + "patch": { + "summary": "Update Team Membership Status", + "operationId": "teamsUpdateMembershipStatus", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["teams"], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "schema": { "$ref": "#/definitions/membership" } + } + }, + "x-appwrite": { + "method": "updateMembershipStatus", + "weight": 173, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[TEAM_ID]", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "[MEMBERSHIP_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "[USER_ID]" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "default": null, + "x-example": "[SECRET]" + } + }, + "required": ["userId", "secret"] + } + } + ] + } + }, + "/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": 177, + "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": "Maximum number of users to return in response. 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. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "cursor", + "description": "ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "string", + "x-example": "[CURSOR]", + "default": "", + "in": "query" + }, + { + "name": "cursorDirection", + "description": "Direction of the cursor.", + "required": false, + "type": "string", + "x-example": "after", + "default": "after", + "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": 176, + "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": { + "userId": { + "type": "string", + "description": "User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "[USER_ID]" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "[NAME]" + } + }, + "required": ["userId", "email", "password"] + } + } + ] + } + }, + "/users/usage": { + "get": { + "summary": "Get usage stats for the users API", + "operationId": "usersGetUsage", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["users"], + "description": "", + "responses": { + "200": { + "description": "UsageUsers", + "schema": { "$ref": "#/definitions/usageUsers" } + } + }, + "x-appwrite": { + "method": "getUsage", + "weight": 191, + "cookies": false, + "type": "", + "demo": "users/get-usage.md", + "edit": "https://github.com/appwrite/appwrite/edit/master", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": ["console"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [] }], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "default": "30d", + "in": "query" + }, + { + "name": "provider", + "description": "Provider Name.", + "required": false, + "type": "string", + "x-example": "email", + "default": "", + "in": "query" + } + ] + } + }, + "/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": 178, + "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 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": 190, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[USER_ID]", + "in": "path" + } + ] + } + }, + "/users/{userId}/email": { + "patch": { + "summary": "Update Email", + "operationId": "usersUpdateEmail", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["users"], + "description": "Update the user email by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { "$ref": "#/definitions/user" } + } + }, + "x-appwrite": { + "method": "updateEmail", + "weight": 186, + "cookies": false, + "type": "", + "demo": "users/update-email.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/users/update-user-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "[USER_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + } + }, + "required": ["email"] + } + } + ] + } + }, + "/users/{userId}/logs": { + "get": { + "summary": "Get User Logs", + "operationId": "usersGetLogs", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["users"], + "description": "Get the user activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { "$ref": "#/definitions/logList" } + } + }, + "x-appwrite": { + "method": "getLogs", + "weight": 181, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[USER_ID]", + "in": "path" + }, + { + "name": "limit", + "description": "Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + } + ] + } + }, + "/users/{userId}/name": { + "patch": { + "summary": "Update Name", + "operationId": "usersUpdateName", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["users"], + "description": "Update the user name by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { "$ref": "#/definitions/user" } + } + }, + "x-appwrite": { + "method": "updateName", + "weight": 184, + "cookies": false, + "type": "", + "demo": "users/update-name.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/users/update-user-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "[USER_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": null, + "x-example": "[NAME]" + } + }, + "required": ["name"] + } + } + ] + } + }, + "/users/{userId}/password": { + "patch": { + "summary": "Update Password", + "operationId": "usersUpdatePassword", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["users"], + "description": "Update the user password by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { "$ref": "#/definitions/user" } + } + }, + "x-appwrite": { + "method": "updatePassword", + "weight": 185, + "cookies": false, + "type": "", + "demo": "users/update-password.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/users/update-user-password.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "[USER_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": ["password"] + } + } + ] + } + }, + "/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": 179, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[USER_ID]", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update User Preferences", + "operationId": "usersUpdatePrefs", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["users"], + "description": "Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "schema": { "$ref": "#/definitions/preferences" } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "weight": 187, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[USER_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": ["prefs"] + } + } + ] + } + }, + "/users/{userId}/sessions": { + "get": { + "summary": "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": 180, + "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 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": 189, + "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 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": 188, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[USER_ID]", + "in": "path" + }, + { + "name": "sessionId", + "description": "Session ID.", + "required": true, + "type": "string", + "x-example": "[SESSION_ID]", + "in": "path" + } + ] + } + }, + "/users/{userId}/status": { + "patch": { + "summary": "Update User Status", + "operationId": "usersUpdateStatus", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["users"], + "description": "Update the user status by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { "$ref": "#/definitions/user" } + } + }, + "x-appwrite": { + "method": "updateStatus", + "weight": 182, + "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 ID.", + "required": true, + "type": "string", + "x-example": "[USER_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "User Status. To activate the user pass `true` and to block the user pass `false`.", + "default": null, + "x-example": false + } + }, + "required": ["status"] + } + } + ] + } + }, + "/users/{userId}/verification": { + "patch": { + "summary": "Update Email Verification", + "operationId": "usersUpdateVerification", + "consumes": ["application/json"], + "produces": ["application/json"], + "tags": ["users"], + "description": "Update the user email verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { "$ref": "#/definitions/user" } + } + }, + "x-appwrite": { + "method": "updateVerification", + "weight": 183, + "cookies": false, + "type": "", + "demo": "users/update-verification.md", + "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/users/update-user-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": ["server"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [], "Key": [] }], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "[USER_ID]", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "emailVerification": { + "type": "boolean", + "description": "User email verification status.", + "default": null, + "x-example": false + } + }, + "required": ["emailVerification"] + } + } + ] + } + } + }, + "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": { + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { "type": "object", "$ref": "#/definitions/document" }, + "x-example": "" + } + }, + "required": ["total", "documents"] + }, + "collectionList": { + "description": "Collections List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of collections documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "collections": { + "type": "array", + "description": "List of collections.", + "items": { "type": "object", "$ref": "#/definitions/collection" }, + "x-example": "" + } + }, + "required": ["total", "collections"] + }, + "indexList": { + "description": "Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { "type": "object", "$ref": "#/definitions/index" }, + "x-example": "" + } + }, + "required": ["total", "indexes"] + }, + "userList": { + "description": "Users List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of users documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "users": { + "type": "array", + "description": "List of users.", + "items": { "type": "object", "$ref": "#/definitions/user" }, + "x-example": "" + } + }, + "required": ["total", "users"] + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { "type": "object", "$ref": "#/definitions/session" }, + "x-example": "" + } + }, + "required": ["total", "sessions"] + }, + "logList": { + "description": "Logs List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of logs documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "logs": { + "type": "array", + "description": "List of logs.", + "items": { "type": "object", "$ref": "#/definitions/log" }, + "x-example": "" + } + }, + "required": ["total", "logs"] + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { "type": "object", "$ref": "#/definitions/file" }, + "x-example": "" + } + }, + "required": ["total", "files"] + }, + "bucketList": { + "description": "Buckets List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of buckets documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "buckets": { + "type": "array", + "description": "List of buckets.", + "items": { "type": "object", "$ref": "#/definitions/bucket" }, + "x-example": "" + } + }, + "required": ["total", "buckets"] + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { "type": "object", "$ref": "#/definitions/team" }, + "x-example": "" + } + }, + "required": ["total", "teams"] + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { "type": "object", "$ref": "#/definitions/membership" }, + "x-example": "" + } + }, + "required": ["total", "memberships"] + }, + "functionList": { + "description": "Functions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of functions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "functions": { + "type": "array", + "description": "List of functions.", + "items": { "type": "object", "$ref": "#/definitions/function" }, + "x-example": "" + } + }, + "required": ["total", "functions"] + }, + "runtimeList": { + "description": "Runtimes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "runtimes": { + "type": "array", + "description": "List of runtimes.", + "items": { "type": "object", "$ref": "#/definitions/runtime" }, + "x-example": "" + } + }, + "required": ["total", "runtimes"] + }, + "deploymentList": { + "description": "Deployments List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of deployments documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "List of deployments.", + "items": { "type": "object", "$ref": "#/definitions/deployment" }, + "x-example": "" + } + }, + "required": ["total", "deployments"] + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { "type": "object", "$ref": "#/definitions/execution" }, + "x-example": "" + } + }, + "required": ["total", "executions"] + }, + "projectList": { + "description": "Projects List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of projects documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "projects": { + "type": "array", + "description": "List of projects.", + "items": { "type": "object", "$ref": "#/definitions/project" }, + "x-example": "" + } + }, + "required": ["total", "projects"] + }, + "webhookList": { + "description": "Webhooks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of webhooks documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "webhooks": { + "type": "array", + "description": "List of webhooks.", + "items": { "type": "object", "$ref": "#/definitions/webhook" }, + "x-example": "" + } + }, + "required": ["total", "webhooks"] + }, + "keyList": { + "description": "API Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of keys documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "keys": { + "type": "array", + "description": "List of keys.", + "items": { "type": "object", "$ref": "#/definitions/key" }, + "x-example": "" + } + }, + "required": ["total", "keys"] + }, + "platformList": { + "description": "Platforms List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of platforms documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "platforms": { + "type": "array", + "description": "List of platforms.", + "items": { "type": "object", "$ref": "#/definitions/platform" }, + "x-example": "" + } + }, + "required": ["total", "platforms"] + }, + "domainList": { + "description": "Domains List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of domains documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "domains": { + "type": "array", + "description": "List of domains.", + "items": { "type": "object", "$ref": "#/definitions/domain" }, + "x-example": "" + } + }, + "required": ["total", "domains"] + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { "type": "object", "$ref": "#/definitions/country" }, + "x-example": "" + } + }, + "required": ["total", "countries"] + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { "type": "object", "$ref": "#/definitions/continent" }, + "x-example": "" + } + }, + "required": ["total", "continents"] + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { "type": "object", "$ref": "#/definitions/language" }, + "x-example": "" + } + }, + "required": ["total", "languages"] + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { "type": "object", "$ref": "#/definitions/currency" }, + "x-example": "" + } + }, + "required": ["total", "currencies"] + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { "type": "object", "$ref": "#/definitions/phone" }, + "x-example": "" + } + }, + "required": ["total", "phones"] + }, + "metricList": { + "description": "Metric List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of metrics documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "metrics": { + "type": "array", + "description": "List of metrics.", + "items": { "type": "object", "$ref": "#/definitions/metric" }, + "x-example": "" + } + }, + "required": ["total", "metrics"] + }, + "collection": { + "description": "Collection", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c16897e" + }, + "$read": { + "type": "array", + "description": "Collection read permissions.", + "items": { "type": "string" }, + "x-example": "role:all" + }, + "$write": { + "type": "array", + "description": "Collection write permissions.", + "items": { "type": "string" }, + "x-example": "user:608f9da25e7e1" + }, + "name": { + "type": "string", + "description": "Collection name.", + "x-example": "My Collection" + }, + "enabled": { + "type": "boolean", + "description": "Collection enabled.", + "x-example": false + }, + "permission": { + "type": "string", + "description": "Collection permission model. Possible values: `document` or `collection`", + "x-example": "document" + }, + "attributes": { + "type": "array", + "description": "Collection attributes.", + "items": { + "x-anyOf": [ + { "$ref": "#/definitions/attributeBoolean" }, + { "$ref": "#/definitions/attributeInteger" }, + { "$ref": "#/definitions/attributeFloat" }, + { "$ref": "#/definitions/attributeEmail" }, + { "$ref": "#/definitions/attributeEnum" }, + { "$ref": "#/definitions/attributeUrl" }, + { "$ref": "#/definitions/attributeIp" }, + { "$ref": "#/definitions/attributeString" } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Collection indexes.", + "items": { "type": "object", "$ref": "#/definitions/index" }, + "x-example": {} + } + }, + "required": [ + "$id", + "$read", + "$write", + "name", + "enabled", + "permission", + "attributes", + "indexes" + ] + }, + "attributeList": { + "description": "Attributes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of attributes in the given collection.", + "x-example": 5, + "format": "int32" + }, + "attributes": { + "type": "array", + "description": "List of attributes.", + "items": { + "x-anyOf": [ + { "$ref": "#/definitions/attributeBoolean" }, + { "$ref": "#/definitions/attributeInteger" }, + { "$ref": "#/definitions/attributeFloat" }, + { "$ref": "#/definitions/attributeEmail" }, + { "$ref": "#/definitions/attributeEnum" }, + { "$ref": "#/definitions/attributeUrl" }, + { "$ref": "#/definitions/attributeIp" }, + { "$ref": "#/definitions/attributeString" } + ] + }, + "x-example": "" + } + }, + "required": ["total", "attributes"] + }, + "attributeString": { + "description": "AttributeString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Attribute size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default", + "x-nullable": true + } + }, + "required": ["key", "type", "status", "required", "size"] + }, + "attributeInteger": { + "description": "AttributeInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "x-nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "x-nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 10, + "format": "int32", + "x-nullable": true + } + }, + "required": ["key", "type", "status", "required"] + }, + "attributeFloat": { + "description": "AttributeFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "x-nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "x-nullable": true + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 2.5, + "format": "double", + "x-nullable": true + } + }, + "required": ["key", "type", "status", "required"] + }, + "attributeBoolean": { + "description": "AttributeBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false, + "x-nullable": true + } + }, + "required": ["key", "type", "status", "required"] + }, + "attributeEmail": { + "description": "AttributeEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default@example.com", + "x-nullable": true + } + }, + "required": ["key", "type", "status", "required", "format"] + }, + "attributeEnum": { + "description": "AttributeEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { "type": "string" }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "element", + "x-nullable": true + } + }, + "required": ["key", "type", "status", "required", "elements", "format"] + }, + "attributeIp": { + "description": "AttributeIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "192.0.2.0", + "x-nullable": true + } + }, + "required": ["key", "type", "status", "required", "format"] + }, + "attributeUrl": { + "description": "AttributeURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "http://example.com", + "x-nullable": true + } + }, + "required": ["key", "type", "status", "required", "format"] + }, + "index": { + "description": "Index", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "attributes": { + "type": "array", + "description": "Index attributes.", + "items": { "type": "string" }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { "type": "string" }, + "x-example": [] + } + }, + "required": ["key", "type", "status", "attributes", "orders"] + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "x-example": "5e5ea5c16897e" + }, + "$collection": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c15117e" + }, + "$read": { + "type": "array", + "description": "Document read permissions.", + "items": { "type": "string" }, + "x-example": "role:all" + }, + "$write": { + "type": "array", + "description": "Document write permissions.", + "items": { "type": "string" }, + "x-example": "user:608f9da25e7e1" + } + }, + "additionalProperties": true, + "required": ["$id", "$collection", "$read", "$write"] + }, + "log": { + "description": "Log", + "type": "object", + "properties": { + "event": { + "type": "string", + "description": "Event name.", + "x-example": "account.sessions.create" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "610fc2f985ee0" + }, + "userEmail": { + "type": "string", + "description": "User Email.", + "x-example": "john@appwrite.io" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "John Doe" + }, + "mode": { + "type": "string", + "description": "API mode when event triggered.", + "x-example": "admin" + }, + "ip": { + "type": "string", + "description": "IP session in use when the session was created.", + "x-example": "127.0.0.1" + }, + "time": { + "type": "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", + "userId", + "userEmail", + "userName", + "mode", + "ip", + "time", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName" + ] + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "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": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "x-example": true + }, + "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" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "integer", + "description": "Date, the Unix timestamp of when the access token expires.", + "x-example": 1592981250, + "format": "int32" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "x-example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "x-example": true + } + }, + "required": [ + "$id", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "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" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$read": { + "type": "array", + "description": "File read permissions.", + "items": { "type": "string" }, + "x-example": "role:all" + }, + "$write": { + "type": "array", + "description": "File write permissions.", + "items": { "type": "string" }, + "x-example": "user:608f9da25e7e1" + }, + "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" + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "x-example": 17890, + "format": "int32" + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "x-example": 17890, + "format": "int32" + } + }, + "required": [ + "$id", + "bucketId", + "$read", + "$write", + "name", + "dateCreated", + "signature", + "mimeType", + "sizeOriginal", + "chunksTotal", + "chunksUploaded" + ] + }, + "bucket": { + "description": "Bucket", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$read": { + "type": "array", + "description": "File read permissions.", + "items": { "type": "string" }, + "x-example": ["role:all"] + }, + "$write": { + "type": "array", + "description": "File write permissions.", + "items": { "type": "string" }, + "x-example": ["user:608f9da25e7e1"] + }, + "permission": { + "type": "string", + "description": "Bucket permission model. Possible values: `bucket` or `file`", + "x-example": "file" + }, + "dateCreated": { + "type": "integer", + "description": "Bucket creation date in Unix timestamp.", + "x-example": 1592981250, + "format": "int32" + }, + "dateUpdated": { + "type": "integer", + "description": "Bucket update date in Unix timestamp.", + "x-example": 1592981250, + "format": "int32" + }, + "name": { + "type": "string", + "description": "Bucket name.", + "x-example": "Documents" + }, + "enabled": { + "type": "boolean", + "description": "Bucket enabled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size supported.", + "x-example": 100, + "format": "int32" + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions.", + "items": { "type": "string" }, + "x-example": ["jpg", "png"] + }, + "encryption": { + "type": "boolean", + "description": "Bucket is encrypted.", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Virus scanning is enabled.", + "x-example": false + } + }, + "required": [ + "$id", + "$read", + "$write", + "permission", + "dateCreated", + "dateUpdated", + "name", + "enabled", + "maximumFileSize", + "allowedFileExtensions", + "encryption", + "antivirus" + ] + }, + "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" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "x-example": 7, + "format": "int32" + } + }, + "required": ["$id", "name", "dateCreated", "total"] + }, + "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" + }, + "execute": { + "type": "array", + "description": "Execution permissions.", + "items": { "type": "string" }, + "x-example": "role:member" + }, + "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" + }, + "runtime": { + "type": "string", + "description": "Function execution runtime.", + "x-example": "python-3.8" + }, + "deployment": { + "type": "string", + "description": "Function's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "vars": { + "type": "object", + "additionalProperties": true, + "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", + "execute", + "name", + "dateCreated", + "dateUpdated", + "status", + "runtime", + "deployment", + "vars", + "events", + "schedule", + "scheduleNext", + "schedulePrevious", + "timeout" + ] + }, + "runtime": { + "description": "Runtime", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Runtime ID.", + "x-example": "python-3.8" + }, + "name": { + "type": "string", + "description": "Runtime Name.", + "x-example": "Python" + }, + "version": { + "type": "string", + "description": "Runtime version.", + "x-example": "3.8" + }, + "base": { + "type": "string", + "description": "Base Docker image used to build the runtime.", + "x-example": "python:3.8-alpine" + }, + "image": { + "type": "string", + "description": "Image name of Docker Hub.", + "x-example": "appwrite\\/runtime-for-python:3.8" + }, + "logo": { + "type": "string", + "description": "Name of the logo image.", + "x-example": "python.png" + }, + "supports": { + "type": "array", + "description": "List of supported architectures.", + "items": { "type": "string" }, + "x-example": "amd64" + } + }, + "required": [ + "$id", + "name", + "version", + "base", + "image", + "logo", + "supports" + ] + }, + "deployment": { + "description": "Deployment", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea6g16897e" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "functions" + }, + "dateCreated": { + "type": "integer", + "description": "The deployment creation date in Unix timestamp.", + "x-example": 1592981250, + "format": "int32" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file to use to execute the deployment code.", + "x-example": "enabled" + }, + "size": { + "type": "integer", + "description": "The code size in bytes.", + "x-example": 128, + "format": "int32" + }, + "buildId": { + "type": "string", + "description": "The current build ID.", + "x-example": "5e5ea5c16897e" + }, + "activate": { + "type": "boolean", + "description": "Whether the deployment should be automatically activated.", + "x-example": true + }, + "status": { + "type": "string", + "description": "The deployment status.", + "x-example": "enabled" + }, + "buildStdout": { + "type": "string", + "description": "The build stdout.", + "x-example": "enabled" + }, + "buildStderr": { + "type": "string", + "description": "The build stderr.", + "x-example": "enabled" + } + }, + "required": [ + "$id", + "resourceId", + "resourceType", + "dateCreated", + "entrypoint", + "size", + "buildId", + "activate", + "status", + "buildStdout", + "buildStderr" + ] + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "x-example": "5e5ea5c16897e" + }, + "$read": { + "type": "array", + "description": "Execution read permissions.", + "items": { "type": "string" }, + "x-example": "role:all" + }, + "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" + }, + "statusCode": { + "type": "integer", + "description": "The script status code.", + "x-example": 0, + "format": "int32" + }, + "stdout": { + "type": "string", + "description": "The script stdout output string. Logs the last 4,000 characters of the execution stdout output.", + "x-example": "" + }, + "stderr": { + "type": "string", + "description": "The script stderr output string. Logs the last 4,000 characters of the execution stderr output", + "x-example": "" + }, + "time": { + "type": "number", + "description": "The script execution time in seconds.", + "x-example": 0.4, + "format": "double" + } + }, + "required": [ + "$id", + "$read", + "functionId", + "dateCreated", + "trigger", + "status", + "statusCode", + "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" + }, + "authLimit": { + "type": "integer", + "description": "Max users allowed. 0 is unlimited.", + "x-example": 100, + "format": "int32" + }, + "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": {} + }, + "providerAmazonAppid": { + "type": "string", + "description": "Amazon OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerAmazonSecret": { + "type": "string", + "description": "Amazon OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerAppleAppid": { + "type": "string", + "description": "Apple OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerAppleSecret": { + "type": "string", + "description": "Apple OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerBitbucketAppid": { + "type": "string", + "description": "BitBucket OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerBitbucketSecret": { + "type": "string", + "description": "BitBucket OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerBitlyAppid": { + "type": "string", + "description": "Bitly OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerBitlySecret": { + "type": "string", + "description": "Bitly OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerBoxAppid": { + "type": "string", + "description": "Box OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerBoxSecret": { + "type": "string", + "description": "Box OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerDiscordAppid": { + "type": "string", + "description": "Discord OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerDiscordSecret": { + "type": "string", + "description": "Discord OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerDropboxAppid": { + "type": "string", + "description": "Dropbox OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerDropboxSecret": { + "type": "string", + "description": "Dropbox OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerFacebookAppid": { + "type": "string", + "description": "Facebook OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerFacebookSecret": { + "type": "string", + "description": "Facebook OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerGithubAppid": { + "type": "string", + "description": "GitHub OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerGithubSecret": { + "type": "string", + "description": "GitHub OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerGitlabAppid": { + "type": "string", + "description": "GitLab OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerGitlabSecret": { + "type": "string", + "description": "GitLab OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerGoogleAppid": { + "type": "string", + "description": "Google OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerGoogleSecret": { + "type": "string", + "description": "Google OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerLinkedinAppid": { + "type": "string", + "description": "LinkedIn OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerLinkedinSecret": { + "type": "string", + "description": "LinkedIn OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerMicrosoftAppid": { + "type": "string", + "description": "Microsoft OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerMicrosoftSecret": { + "type": "string", + "description": "Microsoft OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerNotionAppid": { + "type": "string", + "description": "Notion OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerNotionSecret": { + "type": "string", + "description": "Notion OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerPaypalAppid": { + "type": "string", + "description": "PayPal OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerPaypalSecret": { + "type": "string", + "description": "PayPal OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerPaypalSandboxAppid": { + "type": "string", + "description": "PayPal OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerPaypalSandboxSecret": { + "type": "string", + "description": "PayPal OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerSalesforceAppid": { + "type": "string", + "description": "Salesforce OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerSalesforceSecret": { + "type": "string", + "description": "Salesforce OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerSlackAppid": { + "type": "string", + "description": "Slack OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerSlackSecret": { + "type": "string", + "description": "Slack OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerSpotifyAppid": { + "type": "string", + "description": "Spotify OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerSpotifySecret": { + "type": "string", + "description": "Spotify OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerTradeshiftAppid": { + "type": "string", + "description": "Tradeshift OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerTradeshiftSecret": { + "type": "string", + "description": "Tradeshift OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerTradeshiftBoxAppid": { + "type": "string", + "description": "Tradeshift OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerTradeshiftBoxSecret": { + "type": "string", + "description": "Tradeshift OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerTwitchAppid": { + "type": "string", + "description": "Twitch OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerTwitchSecret": { + "type": "string", + "description": "Twitch OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerVkAppid": { + "type": "string", + "description": "VK OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerVkSecret": { + "type": "string", + "description": "VK OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerZoomAppid": { + "type": "string", + "description": "Zoom OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerZoomSecret": { + "type": "string", + "description": "Zoom OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerYahooAppid": { + "type": "string", + "description": "Yahoo OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerYahooSecret": { + "type": "string", + "description": "Yahoo OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerYammerAppid": { + "type": "string", + "description": "Yammer OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerYammerSecret": { + "type": "string", + "description": "Yammer OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerYandexAppid": { + "type": "string", + "description": "Yandex OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerYandexSecret": { + "type": "string", + "description": "Yandex OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerWordpressAppid": { + "type": "string", + "description": "WordPress OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerWordpressSecret": { + "type": "string", + "description": "WordPress OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerStripeAppid": { + "type": "string", + "description": "Stripe OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerStripeSecret": { + "type": "string", + "description": "Stripe OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "providerMockAppid": { + "type": "string", + "description": "Mock OAuth app ID.", + "x-example": "123247283472834787438" + }, + "providerMockSecret": { + "type": "string", + "description": "Mock OAuth secret ID.", + "x-example": "djsgudsdsewe43434343dd34..." + }, + "authEmailPassword": { + "type": "boolean", + "description": "Email/Password auth method status", + "x-example": true + }, + "authUsersAuthMagicURL": { + "type": "boolean", + "description": "Magic URL auth method status", + "x-example": true + }, + "authAnonymous": { + "type": "boolean", + "description": "Anonymous auth method status", + "x-example": true + }, + "authInvites": { + "type": "boolean", + "description": "Invites auth method status", + "x-example": true + }, + "authJWT": { + "type": "boolean", + "description": "JWT auth method status", + "x-example": true + }, + "authPhone": { + "type": "boolean", + "description": "Phone auth method status", + "x-example": true + }, + "serviceStatusForAccount": { + "type": "boolean", + "description": "Account service status", + "x-example": true + }, + "serviceStatusForAvatars": { + "type": "boolean", + "description": "Avatars service status", + "x-example": true + }, + "serviceStatusForDatabase": { + "type": "boolean", + "description": "Database service status", + "x-example": true + }, + "serviceStatusForLocale": { + "type": "boolean", + "description": "Locale service status", + "x-example": true + }, + "serviceStatusForHealth": { + "type": "boolean", + "description": "Health service status", + "x-example": true + }, + "serviceStatusForStorage": { + "type": "boolean", + "description": "Storage service status", + "x-example": true + }, + "serviceStatusForTeams": { + "type": "boolean", + "description": "Teams service status", + "x-example": true + }, + "serviceStatusForUsers": { + "type": "boolean", + "description": "Users service status", + "x-example": true + }, + "serviceStatusForFunctions": { + "type": "boolean", + "description": "Functions service status", + "x-example": true + } + }, + "required": [ + "$id", + "name", + "description", + "teamId", + "logo", + "url", + "legalName", + "legalCountry", + "legalState", + "legalCity", + "legalAddress", + "legalTaxId", + "authLimit", + "platforms", + "webhooks", + "keys", + "domains", + "providerAmazonAppid", + "providerAmazonSecret", + "providerAppleAppid", + "providerAppleSecret", + "providerBitbucketAppid", + "providerBitbucketSecret", + "providerBitlyAppid", + "providerBitlySecret", + "providerBoxAppid", + "providerBoxSecret", + "providerDiscordAppid", + "providerDiscordSecret", + "providerDropboxAppid", + "providerDropboxSecret", + "providerFacebookAppid", + "providerFacebookSecret", + "providerGithubAppid", + "providerGithubSecret", + "providerGitlabAppid", + "providerGitlabSecret", + "providerGoogleAppid", + "providerGoogleSecret", + "providerLinkedinAppid", + "providerLinkedinSecret", + "providerMicrosoftAppid", + "providerMicrosoftSecret", + "providerNotionAppid", + "providerNotionSecret", + "providerPaypalAppid", + "providerPaypalSecret", + "providerPaypalSandboxAppid", + "providerPaypalSandboxSecret", + "providerSalesforceAppid", + "providerSalesforceSecret", + "providerSlackAppid", + "providerSlackSecret", + "providerSpotifyAppid", + "providerSpotifySecret", + "providerTradeshiftAppid", + "providerTradeshiftSecret", + "providerTradeshiftBoxAppid", + "providerTradeshiftBoxSecret", + "providerTwitchAppid", + "providerTwitchSecret", + "providerVkAppid", + "providerVkSecret", + "providerZoomAppid", + "providerZoomSecret", + "providerYahooAppid", + "providerYahooSecret", + "providerYammerAppid", + "providerYammerSecret", + "providerYandexAppid", + "providerYandexSecret", + "providerWordpressAppid", + "providerWordpressSecret", + "providerStripeAppid", + "providerStripeSecret", + "providerMockAppid", + "providerMockSecret", + "authEmailPassword", + "authUsersAuthMagicURL", + "authAnonymous", + "authInvites", + "authJWT", + "authPhone", + "serviceStatusForAccount", + "serviceStatusForAvatars", + "serviceStatusForDatabase", + "serviceStatusForLocale", + "serviceStatusForHealth", + "serviceStatusForStorage", + "serviceStatusForTeams", + "serviceStatusForUsers", + "serviceStatusForFunctions" + ] + }, + "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"] + }, + "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": "double" + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format.", + "x-example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "x-example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ] + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "x-example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": ["code", "countryCode", "countryName"] + }, + "healthAntivirus": { + "description": "Health Antivirus", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Antivirus version.", + "x-example": "1.0.0" + }, + "status": { + "type": "string", + "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", + "x-example": "online" + } + }, + "required": ["version", "status"] + }, + "healthQueue": { + "description": "Health Queue", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Amount of actions in the queue.", + "x-example": 8, + "format": "int32" + } + }, + "required": ["size"] + }, + "healthStatus": { + "description": "Health Status", + "type": "object", + "properties": { + "ping": { + "type": "integer", + "description": "Duration in milliseconds how long the health check took.", + "x-example": 128, + "format": "int32" + }, + "status": { + "type": "string", + "description": "Service status. Possible values can are: `pass`, `fail`", + "x-example": "pass" + } + }, + "required": ["ping", "status"] + }, + "healthTime": { + "description": "Health Time", + "type": "object", + "properties": { + "remoteTime": { + "type": "integer", + "description": "Current unix timestamp on trustful remote server.", + "x-example": 1639490751, + "format": "int32" + }, + "localTime": { + "type": "integer", + "description": "Current unix timestamp of local server where Appwrite runs.", + "x-example": 1639490844, + "format": "int32" + }, + "diff": { + "type": "integer", + "description": "Difference of unix remote and local timestamps in milliseconds.", + "x-example": 93, + "format": "int32" + } + }, + "required": ["remoteTime", "localTime", "diff"] + }, + "metric": { + "description": "Metric", + "type": "object", + "properties": { + "value": { + "type": "integer", + "description": "The value of this metric at the timestamp.", + "x-example": 1, + "format": "int32" + }, + "timestamp": { + "type": "integer", + "description": "The UNIX timestamp at which this metric was aggregated.", + "x-example": 1592981250, + "format": "int32" + } + }, + "required": ["value", "timestamp"] + }, + "usageDatabase": { + "description": "UsageDatabase", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "documentsCount": { + "type": "array", + "description": "Aggregated stats for total number of documents.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "collectionsCount": { + "type": "array", + "description": "Aggregated stats for total number of collections.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "documentsCreate": { + "type": "array", + "description": "Aggregated stats for documents created.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "documentsRead": { + "type": "array", + "description": "Aggregated stats for documents read.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "documentsUpdate": { + "type": "array", + "description": "Aggregated stats for documents updated.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "documentsDelete": { + "type": "array", + "description": "Aggregated stats for documents deleted.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "collectionsCreate": { + "type": "array", + "description": "Aggregated stats for collections created.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "collectionsRead": { + "type": "array", + "description": "Aggregated stats for collections read.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "collectionsUpdate": { + "type": "array", + "description": "Aggregated stats for collections updated.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "collectionsDelete": { + "type": "array", + "description": "Aggregated stats for collections delete.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + } + }, + "required": [ + "range", + "documentsCount", + "collectionsCount", + "documentsCreate", + "documentsRead", + "documentsUpdate", + "documentsDelete", + "collectionsCreate", + "collectionsRead", + "collectionsUpdate", + "collectionsDelete" + ] + }, + "usageCollection": { + "description": "UsageCollection", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "documentsCount": { + "type": "array", + "description": "Aggregated stats for total number of documents.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "documentsCreate": { + "type": "array", + "description": "Aggregated stats for documents created.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "documentsRead": { + "type": "array", + "description": "Aggregated stats for documents read.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "documentsUpdate": { + "type": "array", + "description": "Aggregated stats for documents updated.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "documentsDelete": { + "type": "array", + "description": "Aggregated stats for documents deleted.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + } + }, + "required": [ + "range", + "documentsCount", + "documentsCreate", + "documentsRead", + "documentsUpdate", + "documentsDelete" + ] + }, + "usageUsers": { + "description": "UsageUsers", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "usersCount": { + "type": "array", + "description": "Aggregated stats for total number of users.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "usersCreate": { + "type": "array", + "description": "Aggregated stats for users created.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "usersRead": { + "type": "array", + "description": "Aggregated stats for users read.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "usersUpdate": { + "type": "array", + "description": "Aggregated stats for users updated.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "usersDelete": { + "type": "array", + "description": "Aggregated stats for users deleted.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "sessionsCreate": { + "type": "array", + "description": "Aggregated stats for sessions created.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "sessionsProviderCreate": { + "type": "array", + "description": "Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "sessionsDelete": { + "type": "array", + "description": "Aggregated stats for sessions deleted.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + } + }, + "required": [ + "range", + "usersCount", + "usersCreate", + "usersRead", + "usersUpdate", + "usersDelete", + "sessionsCreate", + "sessionsProviderCreate", + "sessionsDelete" + ] + }, + "usageStorage": { + "description": "StorageUsage", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "filesStorage": { + "type": "array", + "description": "Aggregated stats for the occupied storage size by files (in bytes).", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "tagsStorage": { + "type": "array", + "description": "Aggregated stats for the occupied storage size by tags (in bytes).", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "filesCount": { + "type": "array", + "description": "Aggregated stats for total number of files.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "bucketsCount": { + "type": "array", + "description": "Aggregated stats for total number of buckets.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "bucketsCreate": { + "type": "array", + "description": "Aggregated stats for buckets created.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "bucketsRead": { + "type": "array", + "description": "Aggregated stats for buckets read.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "bucketsUpdate": { + "type": "array", + "description": "Aggregated stats for buckets updated.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "bucketsDelete": { + "type": "array", + "description": "Aggregated stats for buckets deleted.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "filesCreate": { + "type": "array", + "description": "Aggregated stats for files created.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "filesRead": { + "type": "array", + "description": "Aggregated stats for files read.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "filesUpdate": { + "type": "array", + "description": "Aggregated stats for files updated.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "filesDelete": { + "type": "array", + "description": "Aggregated stats for files deleted.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + } + }, + "required": [ + "range", + "filesStorage", + "tagsStorage", + "filesCount", + "bucketsCount", + "bucketsCreate", + "bucketsRead", + "bucketsUpdate", + "bucketsDelete", + "filesCreate", + "filesRead", + "filesUpdate", + "filesDelete" + ] + }, + "usageBuckets": { + "description": "UsageBuckets", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "filesCount": { + "type": "array", + "description": "Aggregated stats for total number of files in this bucket.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "filesStorage": { + "type": "array", + "description": "Aggregated stats for total storage of files in this bucket.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "filesCreate": { + "type": "array", + "description": "Aggregated stats for files created.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "filesRead": { + "type": "array", + "description": "Aggregated stats for files read.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "filesUpdate": { + "type": "array", + "description": "Aggregated stats for files updated.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "filesDelete": { + "type": "array", + "description": "Aggregated stats for files deleted.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + } + }, + "required": [ + "range", + "filesCount", + "filesStorage", + "filesCreate", + "filesRead", + "filesUpdate", + "filesDelete" + ] + }, + "usageFunctions": { + "description": "UsageFunctions", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "functionsExecutions": { + "type": "array", + "description": "Aggregated stats for function executions.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "functionsFailures": { + "type": "array", + "description": "Aggregated stats for function execution failures.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "functionsCompute": { + "type": "array", + "description": "Aggregated stats for function execution duration.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + } + }, + "required": [ + "range", + "functionsExecutions", + "functionsFailures", + "functionsCompute" + ] + }, + "usageProject": { + "description": "UsageProject", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "requests": { + "type": "array", + "description": "Aggregated stats for number of requests.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "network": { + "type": "array", + "description": "Aggregated stats for consumed bandwidth.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "functions": { + "type": "array", + "description": "Aggregated stats for function executions.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "documents": { + "type": "array", + "description": "Aggregated stats for number of documents.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "collections": { + "type": "array", + "description": "Aggregated stats for number of collections.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "users": { + "type": "array", + "description": "Aggregated stats for number of users.", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + }, + "storage": { + "type": "array", + "description": "Aggregated stats for the occupied storage size (in bytes).", + "items": { "type": "object", "$ref": "#/definitions/metricList" }, + "x-example": {} + } + }, + "required": [ + "range", + "requests", + "network", + "functions", + "documents", + "collections", + "users", + "storage" + ] + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https://appwrite.io/docs" + } +} diff --git a/specs/swagger2-latest-console.json b/specs/swagger2-latest-console.json deleted file mode 100644 index f01269e055..0000000000 --- a/specs/swagger2-latest-console.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"version":"0.13.1","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":"HOSTNAME","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":47,"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":37,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete 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":56,"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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":54,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":46,"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:{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":50,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":52,"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":53,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 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":48,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":55,"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":{},"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":60,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":61,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":49,"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":38,"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 at least 8 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":59,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":45,"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\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":43,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":44,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":39,"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, notion, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, yahoo, yammer, yandex, wordpress, stripe.","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":"","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":"","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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":51,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":58,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":57,"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 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":62,"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},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":63,"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 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":65,"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":64,"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":68,"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":66,"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":67,"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":70,"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":69,"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":95,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"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":94,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","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":96,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"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":98,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":{},"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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":99,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":207,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":205,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":204,"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 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]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":206,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/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":100,"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":104,"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":101,"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":102,"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":103,"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":105,"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":106,"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\/buckets\/{bucketId}\/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":156,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":155,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/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":157,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":161,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":162,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":159,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":158,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":160,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":166,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":165,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":167,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":168,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":169,"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 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":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":171,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":170,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":172,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":173,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). 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":175,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":174,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}}},"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":{"documentList":{"description":"Documents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of documents documents that matched your query.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["total","documents"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of sessions documents that matched your query.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["total","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"total":{"type":"integer","description":"Total number of logs documents that matched your query.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["total","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"total":{"type":"integer","description":"Total number of files documents that matched your query.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["total","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"total":{"type":"integer","description":"Total number of teams documents that matched your query.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["total","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"total":{"type":"integer","description":"Total number of memberships documents that matched your query.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["total","memberships"]},"executionList":{"description":"Executions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of executions documents that matched your query.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["total","executions"]},"countryList":{"description":"Countries List","type":"object","properties":{"total":{"type":"integer","description":"Total number of countries documents that matched your query.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["total","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of continents documents that matched your query.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["total","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"total":{"type":"integer","description":"Total number of languages documents that matched your query.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["total","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"total":{"type":"integer","description":"Total number of currencies documents that matched your query.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["total","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"total":{"type":"integer","description":"Total number of phones documents that matched your query.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["total","phones"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"integer","description":"Date, the Unix timestamp of when the access token expires.","x-example":1592981250,"format":"int32"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"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"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$read","$write","name","dateCreated","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"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"},"total":{"type":"integer","description":"Total number of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","total"]},"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"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"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"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$read","functionId","dateCreated","trigger","status","statusCode","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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file diff --git a/templates/web/package.json.twig b/templates/web/package.json.twig index 5b91c8c865..45b7cd2543 100644 --- a/templates/web/package.json.twig +++ b/templates/web/package.json.twig @@ -24,16 +24,16 @@ "build:libs": "rollup -c" }, "devDependencies": { - "@rollup/plugin-typescript": "8.2.5", - "playwright": "1.15.0", - "rollup": "2.56.3", - "serve-handler": "6.1.3", - "tslib": "2.3.1", - "typescript": "4.2.3" + "@rollup/plugin-typescript": "^8.3.0", + "playwright": "^1.21.0", + "rollup": "^2.70.0", + "serve-handler": "^6.1.0", + "tslib": "^2.4.0", + "typescript": "^4.6.0" }, "dependencies": { - "cross-fetch": "3.1.5", - "isomorphic-form-data": "2.0.0" + "cross-fetch": "^3.1.0", + "isomorphic-form-data": "^2.0.0" }, "jsdelivr": "dist/iife/sdk.js", "unpkg": "dist/iife/sdk.js" diff --git a/tests/WebChromiumTest.php b/tests/WebChromiumTest.php index de6b4b4d62..c74d6557ea 100644 --- a/tests/WebChromiumTest.php +++ b/tests/WebChromiumTest.php @@ -10,11 +10,11 @@ class WebChromiumTest extends Base 'cp tests/languages/web/tests.js tests/sdks/web/tests.js', 'cp tests/languages/web/node.js tests/sdks/web/node.js', 'cp tests/languages/web/index.html tests/sdks/web/index.html', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal npm install', // npm list --depth 0 && - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal npm run build', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.21.0-focal npm install', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.21.0-focal npm run build', ]; protected string $command = - 'docker run --rm -v $(pwd):/app -e BROWSER=chromium -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal node tests.js'; + 'docker run --rm -v $(pwd):/app -e BROWSER=chromium -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.21.0-focal node tests.js'; protected array $expectedOutput = [ ...Base::FOO_RESPONSES, From 161a491a41037b92c7ee34f7bdcf85846a3025e1 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 27 Apr 2022 16:48:31 +0200 Subject: [PATCH 009/555] revert changes --- example.php | 2 +- specs/swagger-latest-console.json | 13059 --------------------------- specs/swagger2-latest-console.json | 1 + 3 files changed, 2 insertions(+), 13060 deletions(-) delete mode 100644 specs/swagger-latest-console.json create mode 100644 specs/swagger2-latest-console.json diff --git a/example.php b/example.php index 4a4dece3cb..89d5a61b48 100644 --- a/example.php +++ b/example.php @@ -39,7 +39,7 @@ function getSSLPage($url) { // $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1'); // Enable only with Appwrite local server running on port 80 // $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1&platform=console'); // Enable only with Appwrite local server running on port 80 // $spec = file_get_contents('https://appwrite.io/specs/swagger2?platform=client'); - $spec = file_get_contents('./specs/swagger-latest-console.json'); + $spec = file_get_contents('./specs/swagger2-latest-console.json'); if(empty($spec)) { throw new Exception('Failed to fetch spec from Appwrite server'); diff --git a/specs/swagger-latest-console.json b/specs/swagger-latest-console.json deleted file mode 100644 index 5523aad283..0000000000 --- a/specs/swagger-latest-console.json +++ /dev/null @@ -1,13059 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "0.13.4", - "title": "Appwrite", - "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)", - "termsOfService": "https://appwrite.io/policy/terms", - "contact": { - "name": "Appwrite Team", - "url": "https://appwrite.io/support", - "email": "team@appwrite.io" - }, - "license": { - "name": "BSD-3-Clause", - "url": "https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE" - } - }, - "host": "HOSTNAME", - "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": 47, - "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": 37, - "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": { - "userId": { - "type": "string", - "description": "Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": null, - "x-example": "[USER_ID]" - }, - "email": { - "type": "string", - "description": "User email.", - "default": null, - "x-example": "email@example.com" - }, - "password": { - "type": "string", - "description": "User password. Must be at least 8 chars.", - "default": null, - "x-example": "password" - }, - "name": { - "type": "string", - "description": "User name. Max length: 128 chars.", - "default": "", - "x-example": "[NAME]" - } - }, - "required": ["userId", "email", "password"] - } - } - ] - }, - "delete": { - "summary": "Delete Account", - "operationId": "accountDelete", - "consumes": ["application/json"], - "produces": [], - "tags": ["account"], - "description": "Delete 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": 56, - "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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", - "responses": { - "200": { - "description": "User", - "schema": { "$ref": "#/definitions/user" } - } - }, - "x-appwrite": { - "method": "updateEmail", - "weight": 54, - "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 at least 8 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 in that time frame.", - "responses": { - "201": { - "description": "JWT", - "schema": { "$ref": "#/definitions/jwt" } - } - }, - "x-appwrite": { - "method": "createJWT", - "weight": 46, - "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:{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": 50, - "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": [] }], - "parameters": [ - { - "name": "limit", - "description": "Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - } - ] - } - }, - "/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": 52, - "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, Team Invites and Magic URL, oldPassword is optional.", - "responses": { - "200": { - "description": "User", - "schema": { "$ref": "#/definitions/user" } - } - }, - "x-appwrite": { - "method": "updatePassword", - "weight": 53, - "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 at least 8 chars.", - "default": null, - "x-example": "password" - }, - "oldPassword": { - "type": "string", - "description": "Current user password. Must be at least 8 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": 48, - "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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", - "responses": { - "200": { - "description": "User", - "schema": { "$ref": "#/definitions/user" } - } - }, - "x-appwrite": { - "method": "updatePrefs", - "weight": 55, - "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": {}, - "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": 60, - "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}", "ip:{ip}"], - "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": "Create Password Recovery (confirmation)", - "operationId": "accountUpdateRecovery", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["account"], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](/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": 61, - "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 ID.", - "default": null, - "x-example": "[USER_ID]" - }, - "secret": { - "type": "string", - "description": "Valid reset token.", - "default": null, - "x-example": "[SECRET]" - }, - "password": { - "type": "string", - "description": "New user password. Must be at least 8 chars.", - "default": null, - "x-example": "password" - }, - "passwordAgain": { - "type": "string", - "description": "Repeat new user password. Must be at least 8 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": 49, - "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": 38, - "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 at least 8 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": 59, - "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, you need to update its [email and password](/docs/client/account#accountUpdateEmail) or create an [OAuth2 session](/docs/client/account#accountCreateOAuth2Session).", - "responses": { - "201": { - "description": "Session", - "schema": { "$ref": "#/definitions/session" } - } - }, - "x-appwrite": { - "method": "createAnonymousSession", - "weight": 45, - "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/magic-url": { - "post": { - "summary": "Create Magic URL session", - "operationId": "accountCreateMagicURLSession", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["account"], - "description": "Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT /account/sessions/magic-url](/docs/client/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.", - "responses": { - "201": { - "description": "Token", - "schema": { "$ref": "#/definitions/token" } - } - }, - "x-appwrite": { - "method": "createMagicURLSession", - "weight": 43, - "cookies": false, - "type": "", - "demo": "account/create-magic-u-r-l-session.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/account/create-magic-url-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": { - "userId": { - "type": "string", - "description": "Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": null, - "x-example": "[USER_ID]" - }, - "email": { - "type": "string", - "description": "User email.", - "default": null, - "x-example": "email@example.com" - }, - "url": { - "type": "string", - "description": "URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", - "default": "", - "x-example": "https://example.com" - } - }, - "required": ["userId", "email"] - } - } - ] - }, - "put": { - "summary": "Create Magic URL session (confirmation)", - "operationId": "accountUpdateMagicURLSession", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["account"], - "description": "Use this endpoint to complete creating the session with the Magic URL. 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/sessions/magic-url](/docs/client/account#accountCreateMagicURLSession) 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": "Session", - "schema": { "$ref": "#/definitions/session" } - } - }, - "x-appwrite": { - "method": "updateMagicURLSession", - "weight": 44, - "cookies": false, - "type": "", - "demo": "account/update-magic-u-r-l-session.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/account/update-magic-url-session.md", - "rate-limit": 10, - "rate-time": 3600, - "rate-key": "url:{url},userId:{param-userId}", - "scope": "public", - "platforms": ["client"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [] }], - "parameters": [ - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "userId": { - "type": "string", - "description": "User ID.", - "default": null, - "x-example": "[USER_ID]" - }, - "secret": { - "type": "string", - "description": "Valid verification token.", - "default": null, - "x-example": "[SECRET]" - } - }, - "required": ["userId", "secret"] - } - } - ] - } - }, - "/account/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n", - "responses": { "301": { "description": "No content" } }, - "x-appwrite": { - "method": "createOAuth2Session", - "weight": 39, - "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, notion, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, zoom, yahoo, yammer, yandex, wordpress, stripe.", - "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": "", - "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": "", - "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}": { - "get": { - "summary": "Get Session By ID", - "operationId": "accountGetSession", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["account"], - "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", - "responses": { - "200": { - "description": "Session", - "schema": { "$ref": "#/definitions/session" } - } - }, - "x-appwrite": { - "method": "getSession", - "weight": 51, - "cookies": false, - "type": "", - "demo": "account/get-session.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/account/get-session.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "account", - "platforms": ["client", "server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "JWT": [] }], - "parameters": [ - { - "name": "sessionId", - "description": "Session ID. Use the string 'current' to get the current device session.", - "required": true, - "type": "string", - "x-example": "[SESSION_ID]", - "in": "path" - } - ] - }, - "patch": { - "summary": "Update Session (Refresh Tokens)", - "operationId": "accountUpdateSession", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["account"], - "description": "Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to \"refresh\" the access token.", - "responses": { - "200": { - "description": "Session", - "schema": { "$ref": "#/definitions/session" } - } - }, - "x-appwrite": { - "method": "updateSession", - "weight": 58, - "cookies": false, - "type": "", - "demo": "account/update-session.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/account/update-session.md", - "rate-limit": 10, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "account", - "platforms": ["client", "server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "JWT": [] }], - "parameters": [ - { - "name": "sessionId", - "description": "Session ID. Use the string 'current' to update the current device session.", - "required": true, - "type": "string", - "x-example": "[SESSION_ID]", - "in": "path" - } - ] - }, - "delete": { - "summary": "Delete 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 Session ID argument, only the unique session ID provided is deleted.\n", - "responses": { "204": { "description": "No content" } }, - "x-appwrite": { - "method": "deleteSession", - "weight": 57, - "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 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": 62, - "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},userId:{userId}", - "scope": "account", - "platforms": ["client", "server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "JWT": [] }], - "parameters": [ - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.", - "default": null, - "x-example": "https://example.com" - } - }, - "required": ["url"] - } - } - ] - }, - "put": { - "summary": "Create Email Verification (confirmation)", - "operationId": "accountUpdateVerification", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["account"], - "description": "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.", - "responses": { - "200": { - "description": "Token", - "schema": { "$ref": "#/definitions/token" } - } - }, - "x-appwrite": { - "method": "updateVerification", - "weight": 63, - "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 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 [GET /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", - "responses": { - "200": { "description": "Image", "schema": { "type": "file" } } - }, - "x-appwrite": { - "method": "getBrowser", - "weight": 65, - "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", - "responses": { - "200": { "description": "Image", "schema": { "type": "file" } } - }, - "x-appwrite": { - "method": "getCreditCard", - "weight": 64, - "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": 68, - "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", - "responses": { - "200": { "description": "Image", "schema": { "type": "file" } } - }, - "x-appwrite": { - "method": "getFlag", - "weight": 66, - "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n", - "responses": { - "200": { "description": "Image", "schema": { "type": "file" } } - }, - "x-appwrite": { - "method": "getImage", - "weight": 67, - "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. Defaults to 400.", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 400, - "in": "query" - }, - { - "name": "height", - "description": "Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 400, - "in": "query" - } - ] - } - }, - "/avatars/initials": { - "get": { - "summary": "Get User Initials", - "operationId": "avatarsGetInitials", - "consumes": ["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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", - "responses": { - "200": { "description": "Image", "schema": { "type": "file" } } - }, - "x-appwrite": { - "method": "getInitials", - "weight": 70, - "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.\n", - "responses": { - "200": { "description": "Image", "schema": { "type": "file" } } - }, - "x-appwrite": { - "method": "getQR", - "weight": 69, - "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 1 to 1000. Defaults to 400.", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 1, - "default": 400, - "in": "query" - }, - { - "name": "margin", - "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 1, - "in": "query" - }, - { - "name": "download", - "description": "Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.", - "required": false, - "type": "boolean", - "x-example": false, - "default": false, - "in": "query" - } - ] - } - }, - "/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": 72, - "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": "Maximum number of collection to return in response. 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. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - }, - { - "name": "cursor", - "description": "ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.", - "required": false, - "type": "string", - "x-example": "[CURSOR]", - "default": "", - "in": "query" - }, - { - "name": "cursorDirection", - "description": "Direction of the cursor.", - "required": false, - "type": "string", - "x-example": "after", - "default": "after", - "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": 71, - "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": { - "collectionId": { - "type": "string", - "description": "Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": null, - "x-example": "[COLLECTION_ID]" - }, - "name": { - "type": "string", - "description": "Collection name. Max length: 128 chars.", - "default": null, - "x-example": "[NAME]" - }, - "permission": { - "type": "string", - "description": "Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "document" - }, - "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "[\"role:all\"]", - "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "[\"role:all\"]", - "items": { "type": "string" } - } - }, - "required": [ - "collectionId", - "name", - "permission", - "read", - "write" - ] - } - } - ] - } - }, - "/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": 73, - "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 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": 77, - "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 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]" - }, - "permission": { - "type": "string", - "description": "Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "document" - }, - "read": { - "type": "array", - "description": "An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "[\"role:all\"]", - "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "[\"role:all\"]", - "items": { "type": "string" } - }, - "enabled": { - "type": "boolean", - "description": "Is collection enabled?", - "default": true, - "x-example": false - } - }, - "required": ["name", "permission"] - } - } - ] - }, - "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": 78, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - } - ] - } - }, - "/database/collections/{collectionId}/attributes": { - "get": { - "summary": "List Attributes", - "operationId": "databaseListAttributes", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "", - "responses": { - "200": { - "description": "Attributes List", - "schema": { "$ref": "#/definitions/attributeList" } - } - }, - "x-appwrite": { - "method": "listAttributes", - "weight": 87, - "cookies": false, - "type": "", - "demo": "database/list-attributes.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/list-attributes.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.read", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - } - ] - } - }, - "/database/collections/{collectionId}/attributes/boolean": { - "post": { - "summary": "Create Boolean Attribute", - "operationId": "databaseCreateBooleanAttribute", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "Create a boolean attribute.\n", - "responses": { - "201": { - "description": "AttributeBoolean", - "schema": { "$ref": "#/definitions/attributeBoolean" } - } - }, - "x-appwrite": { - "method": "createBooleanAttribute", - "weight": 86, - "cookies": false, - "type": "", - "demo": "database/create-boolean-attribute.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-boolean-attribute.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "default": null, - "x-example": null - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "default": null, - "x-example": false - }, - "default": { - "type": "boolean", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "default": null, - "x-example": false - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "default": false, - "x-example": false - } - }, - "required": ["key", "required"] - } - } - ] - } - }, - "/database/collections/{collectionId}/attributes/email": { - "post": { - "summary": "Create Email Attribute", - "operationId": "databaseCreateEmailAttribute", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "Create an email attribute.\n", - "responses": { - "201": { - "description": "AttributeEmail", - "schema": { "$ref": "#/definitions/attributeEmail" } - } - }, - "x-appwrite": { - "method": "createEmailAttribute", - "weight": 80, - "cookies": false, - "type": "", - "demo": "database/create-email-attribute.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-email-attribute.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "default": null, - "x-example": null - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "default": null, - "x-example": false - }, - "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "default": null, - "x-example": "email@example.com" - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "default": false, - "x-example": false - } - }, - "required": ["key", "required"] - } - } - ] - } - }, - "/database/collections/{collectionId}/attributes/enum": { - "post": { - "summary": "Create Enum Attribute", - "operationId": "databaseCreateEnumAttribute", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "", - "responses": { - "201": { - "description": "AttributeEnum", - "schema": { "$ref": "#/definitions/attributeEnum" } - } - }, - "x-appwrite": { - "method": "createEnumAttribute", - "weight": 81, - "cookies": false, - "type": "", - "demo": "database/create-enum-attribute.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-attribute-enum.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "default": null, - "x-example": null - }, - "elements": { - "type": "array", - "description": "Array of elements in enumerated type. Uses length of longest element to determine size.", - "default": null, - "x-example": null, - "items": { "type": "string" } - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "default": null, - "x-example": false - }, - "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "default": null, - "x-example": "[DEFAULT]" - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "default": false, - "x-example": false - } - }, - "required": ["key", "elements", "required"] - } - } - ] - } - }, - "/database/collections/{collectionId}/attributes/float": { - "post": { - "summary": "Create Float Attribute", - "operationId": "databaseCreateFloatAttribute", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", - "responses": { - "201": { - "description": "AttributeFloat", - "schema": { "$ref": "#/definitions/attributeFloat" } - } - }, - "x-appwrite": { - "method": "createFloatAttribute", - "weight": 85, - "cookies": false, - "type": "", - "demo": "database/create-float-attribute.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-float-attribute.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "default": null, - "x-example": null - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "default": null, - "x-example": false - }, - "min": { - "type": "number", - "description": "Minimum value to enforce on new documents", - "default": null, - "x-example": null - }, - "max": { - "type": "number", - "description": "Maximum value to enforce on new documents", - "default": null, - "x-example": null - }, - "default": { - "type": "number", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "default": null, - "x-example": null - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "default": false, - "x-example": false - } - }, - "required": ["key", "required"] - } - } - ] - } - }, - "/database/collections/{collectionId}/attributes/integer": { - "post": { - "summary": "Create Integer Attribute", - "operationId": "databaseCreateIntegerAttribute", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", - "responses": { - "201": { - "description": "AttributeInteger", - "schema": { "$ref": "#/definitions/attributeInteger" } - } - }, - "x-appwrite": { - "method": "createIntegerAttribute", - "weight": 84, - "cookies": false, - "type": "", - "demo": "database/create-integer-attribute.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-integer-attribute.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "default": null, - "x-example": null - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "default": null, - "x-example": false - }, - "min": { - "type": "integer", - "description": "Minimum value to enforce on new documents", - "default": null, - "x-example": null - }, - "max": { - "type": "integer", - "description": "Maximum value to enforce on new documents", - "default": null, - "x-example": null - }, - "default": { - "type": "integer", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "default": null, - "x-example": null - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "default": false, - "x-example": false - } - }, - "required": ["key", "required"] - } - } - ] - } - }, - "/database/collections/{collectionId}/attributes/ip": { - "post": { - "summary": "Create IP Address Attribute", - "operationId": "databaseCreateIpAttribute", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "Create IP address attribute.\n", - "responses": { - "201": { - "description": "AttributeIP", - "schema": { "$ref": "#/definitions/attributeIp" } - } - }, - "x-appwrite": { - "method": "createIpAttribute", - "weight": 82, - "cookies": false, - "type": "", - "demo": "database/create-ip-attribute.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-ip-attribute.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "default": null, - "x-example": null - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "default": null, - "x-example": false - }, - "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "default": null, - "x-example": null - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "default": false, - "x-example": false - } - }, - "required": ["key", "required"] - } - } - ] - } - }, - "/database/collections/{collectionId}/attributes/string": { - "post": { - "summary": "Create String Attribute", - "operationId": "databaseCreateStringAttribute", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "Create a string attribute.\n", - "responses": { - "201": { - "description": "AttributeString", - "schema": { "$ref": "#/definitions/attributeString" } - } - }, - "x-appwrite": { - "method": "createStringAttribute", - "weight": 79, - "cookies": false, - "type": "", - "demo": "database/create-string-attribute.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-string-attribute.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "default": null, - "x-example": null - }, - "size": { - "type": "integer", - "description": "Attribute size for text attributes, in number of characters.", - "default": null, - "x-example": 1 - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "default": null, - "x-example": false - }, - "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "default": null, - "x-example": "[DEFAULT]" - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "default": false, - "x-example": false - } - }, - "required": ["key", "size", "required"] - } - } - ] - } - }, - "/database/collections/{collectionId}/attributes/url": { - "post": { - "summary": "Create URL Attribute", - "operationId": "databaseCreateUrlAttribute", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "Create a URL attribute.\n", - "responses": { - "201": { - "description": "AttributeURL", - "schema": { "$ref": "#/definitions/attributeUrl" } - } - }, - "x-appwrite": { - "method": "createUrlAttribute", - "weight": 83, - "cookies": false, - "type": "", - "demo": "database/create-url-attribute.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-url-attribute.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "default": null, - "x-example": null - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "default": null, - "x-example": false - }, - "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "default": null, - "x-example": "https://example.com" - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "default": false, - "x-example": false - } - }, - "required": ["key", "required"] - } - } - ] - } - }, - "/database/collections/{collectionId}/attributes/{key}": { - "get": { - "summary": "Get Attribute", - "operationId": "databaseGetAttribute", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "", - "responses": { - "200": { - "description": "AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString", - "schema": { - "x-oneOf": [ - { "$ref": "#/definitions/attributeBoolean" }, - { "$ref": "#/definitions/attributeInteger" }, - { "$ref": "#/definitions/attributeFloat" }, - { "$ref": "#/definitions/attributeEmail" }, - { "$ref": "#/definitions/attributeEnum" }, - { "$ref": "#/definitions/attributeUrl" }, - { "$ref": "#/definitions/attributeIp" }, - { "$ref": "#/definitions/attributeString" } - ] - } - } - }, - "x-appwrite": { - "method": "getAttribute", - "weight": 88, - "cookies": false, - "type": "", - "demo": "database/get-attribute.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/get-attribute.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.read", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "key", - "description": "Attribute Key.", - "required": true, - "type": "string", - "in": "path" - } - ] - }, - "delete": { - "summary": "Delete Attribute", - "operationId": "databaseDeleteAttribute", - "consumes": ["application/json"], - "produces": [], - "tags": ["database"], - "description": "", - "responses": { "204": { "description": "No content" } }, - "x-appwrite": { - "method": "deleteAttribute", - "weight": 89, - "cookies": false, - "type": "", - "demo": "database/delete-attribute.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/delete-attribute.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "key", - "description": "Attribute Key.", - "required": true, - "type": "string", - "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": 95, - "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 ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/database#querying-documents).", - "required": false, - "type": "array", - "collectionFormat": "multi", - "items": { "type": "string" }, - "default": [], - "in": "query" - }, - { - "name": "limit", - "description": "Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - }, - { - "name": "cursor", - "description": "ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "string", - "x-example": "[CURSOR]", - "default": "", - "in": "query" - }, - { - "name": "cursorDirection", - "description": "Direction of the cursor.", - "required": false, - "type": "string", - "x-example": "after", - "default": "after", - "in": "query" - }, - { - "name": "orderAttributes", - "description": "Array of attributes used to sort results.", - "required": false, - "type": "array", - "collectionFormat": "multi", - "items": { "type": "string" }, - "default": [], - "in": "query" - }, - { - "name": "orderTypes", - "description": "Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.", - "required": false, - "type": "array", - "collectionFormat": "multi", - "items": { "type": "string" }, - "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": 94, - "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 ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection). Make sure to define attributes before creating documents.", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "documentId": { - "type": "string", - "description": "Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": null, - "x-example": "[DOCUMENT_ID]" - }, - "data": { - "type": "object", - "description": "Document data as JSON object.", - "default": {}, - "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "[\"role:all\"]", - "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "[\"role:all\"]", - "items": { "type": "string" } - } - }, - "required": ["documentId", "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": 96, - "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 ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "documentId", - "description": "Document ID.", - "required": true, - "type": "string", - "x-example": "[DOCUMENT_ID]", - "in": "path" - } - ] - }, - "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": 98, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "documentId", - "description": "Document ID.", - "required": true, - "type": "string", - "x-example": "[DOCUMENT_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", - "default": {}, - "x-example": "{}" - }, - "read": { - "type": "array", - "description": "An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "[\"role:all\"]", - "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "[\"role:all\"]", - "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.", - "responses": { "204": { "description": "No content" } }, - "x-appwrite": { - "method": "deleteDocument", - "weight": 99, - "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 ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "documentId", - "description": "Document ID.", - "required": true, - "type": "string", - "x-example": "[DOCUMENT_ID]", - "in": "path" - } - ] - } - }, - "/database/collections/{collectionId}/documents/{documentId}/logs": { - "get": { - "summary": "List Document Logs", - "operationId": "databaseListDocumentLogs", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "Get the document activity logs list by its unique ID.", - "responses": { - "200": { - "description": "Logs List", - "schema": { "$ref": "#/definitions/logList" } - } - }, - "x-appwrite": { - "method": "listDocumentLogs", - "weight": 97, - "cookies": false, - "type": "", - "demo": "database/list-document-logs.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/get-document-logs.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "documents.read", - "platforms": ["console"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID.", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "documentId", - "description": "Document ID.", - "required": true, - "type": "string", - "x-example": "[DOCUMENT_ID]", - "in": "path" - }, - { - "name": "limit", - "description": "Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - } - ] - } - }, - "/database/collections/{collectionId}/indexes": { - "get": { - "summary": "List Indexes", - "operationId": "databaseListIndexes", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "", - "responses": { - "200": { - "description": "Indexes List", - "schema": { "$ref": "#/definitions/indexList" } - } - }, - "x-appwrite": { - "method": "listIndexes", - "weight": 91, - "cookies": false, - "type": "", - "demo": "database/list-indexes.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/list-indexes.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.read", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - } - ] - }, - "post": { - "summary": "Create Index", - "operationId": "databaseCreateIndex", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "", - "responses": { - "201": { - "description": "Index", - "schema": { "$ref": "#/definitions/index" } - } - }, - "x-appwrite": { - "method": "createIndex", - "weight": 90, - "cookies": false, - "type": "", - "demo": "database/create-index.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/create-index.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Index Key.", - "default": null, - "x-example": null - }, - "type": { - "type": "string", - "description": "Index type.", - "default": null, - "x-example": "key" - }, - "attributes": { - "type": "array", - "description": "Array of attributes to index.", - "default": null, - "x-example": null, - "items": { "type": "string" } - }, - "orders": { - "type": "array", - "description": "Array of index orders.", - "default": [], - "x-example": null, - "items": { "type": "string" } - } - }, - "required": ["key", "type", "attributes"] - } - } - ] - } - }, - "/database/collections/{collectionId}/indexes/{key}": { - "get": { - "summary": "Get Index", - "operationId": "databaseGetIndex", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "", - "responses": { - "200": { - "description": "Index", - "schema": { "$ref": "#/definitions/index" } - } - }, - "x-appwrite": { - "method": "getIndex", - "weight": 92, - "cookies": false, - "type": "", - "demo": "database/get-index.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/get-index.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.read", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "key", - "description": "Index Key.", - "required": true, - "type": "string", - "in": "path" - } - ] - }, - "delete": { - "summary": "Delete Index", - "operationId": "databaseDeleteIndex", - "consumes": ["application/json"], - "produces": [], - "tags": ["database"], - "description": "", - "responses": { "204": { "description": "No content" } }, - "x-appwrite": { - "method": "deleteIndex", - "weight": 93, - "cookies": false, - "type": "", - "demo": "database/delete-index.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/delete-index.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "key", - "description": "Index Key.", - "required": true, - "type": "string", - "in": "path" - } - ] - } - }, - "/database/collections/{collectionId}/logs": { - "get": { - "summary": "List Collection Logs", - "operationId": "databaseListCollectionLogs", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "Get the collection activity logs list by its unique ID.", - "responses": { - "200": { - "description": "Logs List", - "schema": { "$ref": "#/definitions/logList" } - } - }, - "x-appwrite": { - "method": "listCollectionLogs", - "weight": 76, - "cookies": false, - "type": "", - "demo": "database/list-collection-logs.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/database/get-collection-logs.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.read", - "platforms": ["console"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [] }], - "parameters": [ - { - "name": "collectionId", - "description": "Collection ID.", - "required": true, - "type": "string", - "x-example": "[COLLECTION_ID]", - "in": "path" - }, - { - "name": "limit", - "description": "Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - } - ] - } - }, - "/database/usage": { - "get": { - "summary": "Get usage stats for the database", - "operationId": "databaseGetUsage", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "", - "responses": { - "200": { - "description": "UsageDatabase", - "schema": { "$ref": "#/definitions/usageDatabase" } - } - }, - "x-appwrite": { - "method": "getUsage", - "weight": 74, - "cookies": false, - "type": "", - "demo": "database/get-usage.md", - "edit": "https://github.com/appwrite/appwrite/edit/master", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.read", - "platforms": ["console"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [] }], - "parameters": [ - { - "name": "range", - "description": "Date range.", - "required": false, - "type": "string", - "x-example": "24h", - "default": "30d", - "in": "query" - } - ] - } - }, - "/database/{collectionId}/usage": { - "get": { - "summary": "Get usage stats for a collection", - "operationId": "databaseGetCollectionUsage", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["database"], - "description": "", - "responses": { - "200": { - "description": "UsageCollection", - "schema": { "$ref": "#/definitions/usageCollection" } - } - }, - "x-appwrite": { - "method": "getCollectionUsage", - "weight": 75, - "cookies": false, - "type": "", - "demo": "database/get-collection-usage.md", - "edit": "https://github.com/appwrite/appwrite/edit/master", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "collections.read", - "platforms": ["console"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [] }], - "parameters": [ - { - "name": "range", - "description": "Date range.", - "required": false, - "type": "string", - "x-example": "24h", - "default": "30d", - "in": "query" - }, - { - "name": "collectionId", - "description": "Collection ID.", - "required": true, - "type": "string", - "x-example": "[COLLECTION_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": 193, - "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": "Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - }, - { - "name": "cursor", - "description": "ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "string", - "x-example": "[CURSOR]", - "default": "", - "in": "query" - }, - { - "name": "cursorDirection", - "description": "Direction of the cursor.", - "required": false, - "type": "string", - "x-example": "after", - "default": "after", - "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": 192, - "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": { - "functionId": { - "type": "string", - "description": "Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": null, - "x-example": "[FUNCTION_ID]" - }, - "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": null, - "items": { "type": "string" } - }, - "runtime": { - "type": "string", - "description": "Execution runtime.", - "default": null, - "x-example": "node-14.5" - }, - "vars": { - "type": "object", - "description": "Key-value JSON object that will be passed to the function as environment variables.", - "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": ["functionId", "name", "execute", "runtime"] - } - } - ] - } - }, - "/functions/runtimes": { - "get": { - "summary": "List runtimes", - "operationId": "functionsListRuntimes", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["functions"], - "description": "Get a list of all runtimes that are currently active on your instance.", - "responses": { - "200": { - "description": "Runtimes List", - "schema": { "$ref": "#/definitions/runtimeList" } - } - }, - "x-appwrite": { - "method": "listRuntimes", - "weight": 194, - "cookies": false, - "type": "", - "demo": "functions/list-runtimes.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/list-runtimes.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": [] }] - } - }, - "/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": 195, - "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 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": 197, - "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 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](https://appwrite.io/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 that will be passed to the function as environment variables.", - "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": "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": 199, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[FUNCTION_ID]", - "in": "path" - } - ] - } - }, - "/functions/{functionId}/deployments": { - "get": { - "summary": "List Deployments", - "operationId": "functionsListDeployments", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["functions"], - "description": "Get a list of all the project's code deployments. You can use the query params to filter your results.", - "responses": { - "200": { - "description": "Deployments List", - "schema": { "$ref": "#/definitions/deploymentList" } - } - }, - "x-appwrite": { - "method": "listDeployments", - "weight": 201, - "cookies": false, - "type": "", - "demo": "functions/list-deployments.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/list-deployments.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 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": "Maximum number of deployments to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - }, - { - "name": "cursor", - "description": "ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "string", - "x-example": "[CURSOR]", - "default": "", - "in": "query" - }, - { - "name": "cursorDirection", - "description": "Direction of the cursor.", - "required": false, - "type": "string", - "x-example": "after", - "default": "after", - "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 Deployment", - "operationId": "functionsCreateDeployment", - "consumes": ["multipart/form-data"], - "produces": ["application/json"], - "tags": ["functions"], - "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](/docs/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.", - "responses": { - "201": { - "description": "Deployment", - "schema": { "$ref": "#/definitions/deployment" } - } - }, - "x-appwrite": { - "method": "createDeployment", - "weight": 200, - "cookies": false, - "type": "", - "demo": "functions/create-deployment.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/create-deployment.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 ID.", - "required": true, - "type": "string", - "x-example": "[FUNCTION_ID]", - "in": "path" - }, - { - "name": "entrypoint", - "description": "Entrypoint File.", - "required": true, - "type": "string", - "x-example": "[ENTRYPOINT]", - "in": "formData" - }, - { - "name": "code", - "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", - "required": true, - "type": "file", - "in": "formData" - }, - { - "name": "activate", - "description": "Automatically activate the deployment when it is finished building.", - "required": true, - "type": "boolean", - "x-example": false, - "in": "formData" - } - ] - } - }, - "/functions/{functionId}/deployments/{deploymentId}": { - "get": { - "summary": "Get Deployment", - "operationId": "functionsGetDeployment", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["functions"], - "description": "Get a code deployment by its unique ID.", - "responses": { - "200": { - "description": "Deployments List", - "schema": { "$ref": "#/definitions/deploymentList" } - } - }, - "x-appwrite": { - "method": "getDeployment", - "weight": 202, - "cookies": false, - "type": "", - "demo": "functions/get-deployment.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/get-deployment.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 ID.", - "required": true, - "type": "string", - "x-example": "[FUNCTION_ID]", - "in": "path" - }, - { - "name": "deploymentId", - "description": "Deployment ID.", - "required": true, - "type": "string", - "x-example": "[DEPLOYMENT_ID]", - "in": "path" - } - ] - }, - "patch": { - "summary": "Update Function Deployment", - "operationId": "functionsUpdateDeployment", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["functions"], - "description": "Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.", - "responses": { - "200": { - "description": "Function", - "schema": { "$ref": "#/definitions/function" } - } - }, - "x-appwrite": { - "method": "updateDeployment", - "weight": 198, - "cookies": false, - "type": "", - "demo": "functions/update-deployment.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/update-function-deployment.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 ID.", - "required": true, - "type": "string", - "x-example": "[FUNCTION_ID]", - "in": "path" - }, - { - "name": "deploymentId", - "description": "Deployment ID.", - "required": true, - "type": "string", - "x-example": "[DEPLOYMENT_ID]", - "in": "path" - } - ] - }, - "delete": { - "summary": "Delete Deployment", - "operationId": "functionsDeleteDeployment", - "consumes": ["application/json"], - "produces": [], - "tags": ["functions"], - "description": "Delete a code deployment by its unique ID.", - "responses": { "204": { "description": "No content" } }, - "x-appwrite": { - "method": "deleteDeployment", - "weight": 203, - "cookies": false, - "type": "", - "demo": "functions/delete-deployment.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/delete-deployment.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 ID.", - "required": true, - "type": "string", - "x-example": "[FUNCTION_ID]", - "in": "path" - }, - { - "name": "deploymentId", - "description": "Deployment ID.", - "required": true, - "type": "string", - "x-example": "[DEPLOYMENT_ID]", - "in": "path" - } - ] - } - }, - "/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}": { - "post": { - "summary": "Retry Build", - "operationId": "functionsRetryBuild", - "consumes": ["application/json"], - "produces": [], - "tags": ["functions"], - "description": "", - "responses": { "204": { "description": "No content" } }, - "x-appwrite": { - "method": "retryBuild", - "weight": 207, - "cookies": false, - "type": "", - "demo": "functions/retry-build.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/functions/retry-build.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "functions.write", - "platforms": ["client", "server", "server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [], "JWT": [] }], - "parameters": [ - { - "name": "functionId", - "description": "Function ID.", - "required": true, - "type": "string", - "x-example": "[FUNCTION_ID]", - "in": "path" - }, - { - "name": "deploymentId", - "description": "Deployment ID.", - "required": true, - "type": "string", - "x-example": "[DEPLOYMENT_ID]", - "in": "path" - }, - { - "name": "buildId", - "description": "Build unique ID.", - "required": true, - "type": "string", - "x-example": "[BUILD_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": 205, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[FUNCTION_ID]", - "in": "path" - }, - { - "name": "limit", - "description": "Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - }, - { - "name": "search", - "description": "Search term to filter your list results. Max length: 256 chars.", - "required": false, - "type": "string", - "x-example": "[SEARCH]", - "default": "", - "in": "query" - }, - { - "name": "cursor", - "description": "ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "string", - "x-example": "[CURSOR]", - "default": "", - "in": "query" - }, - { - "name": "cursorDirection", - "description": "Direction of the cursor.", - "required": false, - "type": "string", - "x-example": "after", - "default": "after", - "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": 204, - "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 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]" - }, - "async": { - "type": "boolean", - "description": "Execute code asynchronously. Default value is true.", - "default": true, - "x-example": false - } - } - } - } - ] - } - }, - "/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": 206, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[FUNCTION_ID]", - "in": "path" - }, - { - "name": "executionId", - "description": "Execution ID.", - "required": true, - "type": "string", - "x-example": "[EXECUTION_ID]", - "in": "path" - } - ] - } - }, - "/functions/{functionId}/usage": { - "get": { - "summary": "Get Function Usage", - "operationId": "functionsGetUsage", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["functions"], - "description": "", - "responses": { - "200": { - "description": "UsageFunctions", - "schema": { "$ref": "#/definitions/usageFunctions" } - } - }, - "x-appwrite": { - "method": "getUsage", - "weight": 196, - "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 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": ["application/json"], - "tags": ["health"], - "description": "Check the Appwrite HTTP server is up and responsive.", - "responses": { - "200": { - "description": "Health Status", - "schema": { "$ref": "#/definitions/healthStatus" } - } - }, - "x-appwrite": { - "method": "get", - "weight": 107, - "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 Antivirus", - "operationId": "healthGetAntivirus", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["health"], - "description": "Check the Appwrite Antivirus server is up and connection is successful.", - "responses": { - "200": { - "description": "Health Antivirus", - "schema": { "$ref": "#/definitions/healthAntivirus" } - } - }, - "x-appwrite": { - "method": "getAntivirus", - "weight": 117, - "cookies": false, - "type": "", - "demo": "health/get-antivirus.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/health/get-storage-anti-virus.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "health.read", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }] - } - }, - "/health/cache": { - "get": { - "summary": "Get Cache", - "operationId": "healthGetCache", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["health"], - "description": "Check the Appwrite in-memory cache server is up and connection is successful.", - "responses": { - "200": { - "description": "Health Status", - "schema": { "$ref": "#/definitions/healthStatus" } - } - }, - "x-appwrite": { - "method": "getCache", - "weight": 110, - "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": ["application/json"], - "tags": ["health"], - "description": "Check the Appwrite database server is up and connection is successful.", - "responses": { - "200": { - "description": "Health Status", - "schema": { "$ref": "#/definitions/healthStatus" } - } - }, - "x-appwrite": { - "method": "getDB", - "weight": 109, - "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 Certificates Queue", - "operationId": "healthGetQueueCertificates", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["health"], - "description": "Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.", - "responses": { - "200": { - "description": "Health Queue", - "schema": { "$ref": "#/definitions/healthQueue" } - } - }, - "x-appwrite": { - "method": "getQueueCertificates", - "weight": 114, - "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": ["application/json"], - "tags": ["health"], - "description": "", - "responses": { - "200": { - "description": "Health Queue", - "schema": { "$ref": "#/definitions/healthQueue" } - } - }, - "x-appwrite": { - "method": "getQueueFunctions", - "weight": 115, - "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": ["application/json"], - "tags": ["health"], - "description": "Get the number of logs that are waiting to be processed in the Appwrite internal queue server.", - "responses": { - "200": { - "description": "Health Queue", - "schema": { "$ref": "#/definitions/healthQueue" } - } - }, - "x-appwrite": { - "method": "getQueueLogs", - "weight": 113, - "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/webhooks": { - "get": { - "summary": "Get Webhooks Queue", - "operationId": "healthGetQueueWebhooks", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["health"], - "description": "Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.", - "responses": { - "200": { - "description": "Health Queue", - "schema": { "$ref": "#/definitions/healthQueue" } - } - }, - "x-appwrite": { - "method": "getQueueWebhooks", - "weight": 112, - "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": ["application/json"], - "tags": ["health"], - "description": "Check the Appwrite local storage device is up and connection is successful.", - "responses": { - "200": { - "description": "Health Status", - "schema": { "$ref": "#/definitions/healthStatus" } - } - }, - "x-appwrite": { - "method": "getStorageLocal", - "weight": 116, - "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": ["application/json"], - "tags": ["health"], - "description": "Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.", - "responses": { - "200": { - "description": "Health Time", - "schema": { "$ref": "#/definitions/healthTime" } - } - }, - "x-appwrite": { - "method": "getTime", - "weight": 111, - "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": 100, - "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": 104, - "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": 101, - "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": 102, - "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": 103, - "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": 105, - "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": 106, - "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": 120, - "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. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - }, - { - "name": "cursor", - "description": "ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "string", - "x-example": "[CURSOR]", - "default": "", - "in": "query" - }, - { - "name": "cursorDirection", - "description": "Direction of the cursor.", - "required": false, - "type": "string", - "x-example": "after", - "default": "after", - "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": 119, - "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": { - "projectId": { - "type": "string", - "description": "Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": null, - "x-example": "[PROJECT_ID]" - }, - "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": ["projectId", "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": 121, - "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": 123, - "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": 128, - "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 at least 8 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": 126, - "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": "integer", - "description": "Set the max number of users allowed in this project. Use 0 for unlimited.", - "default": null, - "x-example": 0 - } - }, - "required": ["limit"] - } - } - ] - } - }, - "/projects/{projectId}/auth/{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": 127, - "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,magic-url,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": 145, - "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": 144, - "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": 146, - "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": 148, - "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": 147, - "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": 135, - "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": 134, - "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": 136, - "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": 137, - "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": 138, - "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": 125, - "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": 140, - "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": 139, - "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 or macOS. Max length: 256 chars.", - "default": "", - "x-example": "[KEY]" - }, - "store": { - "type": "string", - "description": "App store or Google Play store ID. Max length: 256 chars.", - "default": "", - "x-example": "[STORE]" - }, - "hostname": { - "type": "string", - "description": "Platform client hostname. Max length: 256 chars.", - "default": "", - "x-example": "[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": 141, - "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": 142, - "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": 143, - "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}/service": { - "patch": { - "summary": "Update service status", - "operationId": "projectsUpdateServiceStatus", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["projects"], - "description": "", - "responses": { - "200": { - "description": "Project", - "schema": { "$ref": "#/definitions/project" } - } - }, - "x-appwrite": { - "method": "updateServiceStatus", - "weight": 124, - "cookies": false, - "type": "", - "demo": "projects/update-service-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": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "service": { - "type": "string", - "description": "Service name.", - "default": null, - "x-example": "account" - }, - "status": { - "type": "boolean", - "description": "Service status.", - "default": null, - "x-example": false - } - }, - "required": ["service", "status"] - } - } - ] - } - }, - "/projects/{projectId}/usage": { - "get": { - "summary": "Get usage stats for a project", - "operationId": "projectsGetUsage", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["projects"], - "description": "", - "responses": { - "200": { - "description": "UsageProject", - "schema": { "$ref": "#/definitions/usageProject" } - } - }, - "x-appwrite": { - "method": "getUsage", - "weight": 122, - "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": 130, - "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": 129, - "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": 131, - "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": 132, - "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": 133, - "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/buckets": { - "get": { - "summary": "List buckets", - "operationId": "storageListBuckets", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["storage"], - "description": "Get a list of all the storage buckets. You can use the query params to filter your results.", - "responses": { - "200": { - "description": "Buckets List", - "schema": { "$ref": "#/definitions/bucketList" } - } - }, - "x-appwrite": { - "method": "listBuckets", - "weight": 150, - "cookies": false, - "type": "", - "demo": "storage/list-buckets.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/storage/list-buckets.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "buckets.read", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "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": "cursor", - "description": "ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.", - "required": false, - "type": "string", - "x-example": "[CURSOR]", - "default": "", - "in": "query" - }, - { - "name": "cursorDirection", - "description": "Direction of the cursor.", - "required": false, - "type": "string", - "x-example": "after", - "default": "after", - "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 bucket", - "operationId": "storageCreateBucket", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["storage"], - "description": "Create a new storage bucket.", - "responses": { - "201": { - "description": "Bucket", - "schema": { "$ref": "#/definitions/bucket" } - } - }, - "x-appwrite": { - "method": "createBucket", - "weight": 149, - "cookies": false, - "type": "", - "demo": "storage/create-bucket.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/storage/create-bucket.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "buckets.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "bucketId": { - "type": "string", - "description": "Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": null, - "x-example": "[BUCKET_ID]" - }, - "name": { - "type": "string", - "description": "Bucket name", - "default": null, - "x-example": "[NAME]" - }, - "permission": { - "type": "string", - "description": "Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "file" - }, - "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": "[\"role:all\"]", - "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": "[\"role:all\"]", - "items": { "type": "string" } - }, - "enabled": { - "type": "boolean", - "description": "Is bucket enabled?", - "default": true, - "x-example": false - }, - "maximumFileSize": { - "type": "integer", - "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs/environment-variables#storage)", - "default": 30000000, - "x-example": null - }, - "allowedFileExtensions": { - "type": "array", - "description": "Allowed file extensions", - "default": [], - "x-example": null, - "items": { "type": "string" } - }, - "encryption": { - "type": "boolean", - "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", - "default": true, - "x-example": false - }, - "antivirus": { - "type": "boolean", - "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", - "default": true, - "x-example": false - } - }, - "required": ["bucketId", "name", "permission"] - } - } - ] - } - }, - "/storage/buckets/{bucketId}": { - "get": { - "summary": "Get Bucket", - "operationId": "storageGetBucket", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["storage"], - "description": "Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.", - "responses": { - "200": { - "description": "Bucket", - "schema": { "$ref": "#/definitions/bucket" } - } - }, - "x-appwrite": { - "method": "getBucket", - "weight": 151, - "cookies": false, - "type": "", - "demo": "storage/get-bucket.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/storage/get-bucket.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "buckets.read", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "bucketId", - "description": "Bucket unique ID.", - "required": true, - "type": "string", - "x-example": "[BUCKET_ID]", - "in": "path" - } - ] - }, - "put": { - "summary": "Update Bucket", - "operationId": "storageUpdateBucket", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["storage"], - "description": "Update a storage bucket by its unique ID.", - "responses": { - "200": { - "description": "Bucket", - "schema": { "$ref": "#/definitions/bucket" } - } - }, - "x-appwrite": { - "method": "updateBucket", - "weight": 152, - "cookies": false, - "type": "", - "demo": "storage/update-bucket.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/storage/update-bucket.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "buckets.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "bucketId", - "description": "Bucket unique ID.", - "required": true, - "type": "string", - "x-example": "[BUCKET_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Bucket name", - "default": null, - "x-example": "[NAME]" - }, - "permission": { - "type": "string", - "description": "Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "file" - }, - "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": "[\"role:all\"]", - "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": "[\"role:all\"]", - "items": { "type": "string" } - }, - "enabled": { - "type": "boolean", - "description": "Is bucket enabled?", - "default": true, - "x-example": false - }, - "maximumFileSize": { - "type": "integer", - "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs/environment-variables#storage)", - "default": null, - "x-example": null - }, - "allowedFileExtensions": { - "type": "array", - "description": "Allowed file extensions", - "default": [], - "x-example": null, - "items": { "type": "string" } - }, - "encryption": { - "type": "boolean", - "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", - "default": true, - "x-example": false - }, - "antivirus": { - "type": "boolean", - "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", - "default": true, - "x-example": false - } - }, - "required": ["name", "permission"] - } - } - ] - }, - "delete": { - "summary": "Delete Bucket", - "operationId": "storageDeleteBucket", - "consumes": ["application/json"], - "produces": [], - "tags": ["storage"], - "description": "Delete a storage bucket by its unique ID.", - "responses": { "204": { "description": "No content" } }, - "x-appwrite": { - "method": "deleteBucket", - "weight": 153, - "cookies": false, - "type": "", - "demo": "storage/delete-bucket.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/storage/delete-bucket.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "buckets.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "bucketId", - "description": "Bucket unique ID.", - "required": true, - "type": "string", - "x-example": "[BUCKET_ID]", - "in": "path" - } - ] - } - }, - "/storage/buckets/{bucketId}/files": { - "get": { - "summary": "List Files", - "operationId": "storageListFiles", - "consumes": ["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": 155, - "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": "bucketId", - "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", - "required": true, - "type": "string", - "x-example": "[BUCKET_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": "Maximum number of files to return in response. 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. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - }, - { - "name": "cursor", - "description": "ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "string", - "x-example": "[CURSOR]", - "default": "", - "in": "query" - }, - { - "name": "cursorDirection", - "description": "Direction of the cursor.", - "required": false, - "type": "string", - "x-example": "after", - "default": "after", - "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. Before using this route, you should create a new bucket resource using either a [server integration](/docs/server/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", - "responses": { - "201": { - "description": "File", - "schema": { "$ref": "#/definitions/file" } - } - }, - "x-appwrite": { - "method": "createFile", - "weight": 154, - "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": "bucketId", - "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", - "required": true, - "type": "string", - "x-example": "[BUCKET_ID]", - "in": "path" - }, - { - "name": "fileId", - "description": "File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "required": true, - "x-upload-id": true, - "type": "string", - "x-example": "[FILE_ID]", - "in": "formData" - }, - { - "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "required": false, - "type": "array", - "collectionFormat": "multi", - "items": { "type": "string" }, - "x-example": "[\"role:all\"]", - "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "required": false, - "type": "array", - "collectionFormat": "multi", - "items": { "type": "string" }, - "x-example": "[\"role:all\"]", - "in": "formData" - } - ] - } - }, - "/storage/buckets/{bucketId}/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": 156, - "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": "bucketId", - "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", - "required": true, - "type": "string", - "x-example": "[BUCKET_ID]", - "in": "path" - }, - { - "name": "fileId", - "description": "File ID.", - "required": true, - "type": "string", - "x-example": "[FILE_ID]", - "in": "path" - } - ] - }, - "put": { - "summary": "Update File", - "operationId": "storageUpdateFile", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["storage"], - "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", - "responses": { - "200": { - "description": "File", - "schema": { "$ref": "#/definitions/file" } - } - }, - "x-appwrite": { - "method": "updateFile", - "weight": 160, - "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": "bucketId", - "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", - "required": true, - "type": "string", - "x-example": "[BUCKET_ID]", - "in": "path" - }, - { - "name": "fileId", - "description": "File unique ID.", - "required": true, - "type": "string", - "x-example": "[FILE_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "[\"role:all\"]", - "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](https://appwrite.io/docs/permissions) and get a full list of available permissions.", - "default": null, - "x-example": "[\"role:all\"]", - "items": { "type": "string" } - } - } - } - } - ] - }, - "delete": { - "summary": "Delete File", - "operationId": "storageDeleteFile", - "consumes": ["application/json"], - "produces": [], - "tags": ["storage"], - "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", - "responses": { "204": { "description": "No content" } }, - "x-appwrite": { - "method": "deleteFile", - "weight": 161, - "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": "bucketId", - "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", - "required": true, - "type": "string", - "x-example": "[BUCKET_ID]", - "in": "path" - }, - { - "name": "fileId", - "description": "File ID.", - "required": true, - "type": "string", - "x-example": "[FILE_ID]", - "in": "path" - } - ] - } - }, - "/storage/buckets/{bucketId}/files/{fileId}/download": { - "get": { - "summary": "Get File for Download", - "operationId": "storageGetFileDownload", - "consumes": ["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": 158, - "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": "bucketId", - "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", - "required": true, - "type": "string", - "x-example": "[BUCKET_ID]", - "in": "path" - }, - { - "name": "fileId", - "description": "File ID.", - "required": true, - "type": "string", - "x-example": "[FILE_ID]", - "in": "path" - } - ] - } - }, - "/storage/buckets/{bucketId}/files/{fileId}/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. Preview is supported only for image files smaller than 10MB.", - "responses": { - "200": { "description": "Image", "schema": { "type": "file" } } - }, - "x-appwrite": { - "method": "getFilePreview", - "weight": 157, - "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": "bucketId", - "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", - "required": true, - "type": "string", - "x-example": "[BUCKET_ID]", - "in": "path" - }, - { - "name": "fileId", - "description": "File ID", - "required": true, - "type": "string", - "x-example": "[FILE_ID]", - "in": "path" - }, - { - "name": "width", - "description": "Resize preview image width, Pass an integer between 0 to 4000.", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - }, - { - "name": "height", - "description": "Resize preview image height, Pass an integer between 0 to 4000.", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - }, - { - "name": "gravity", - "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", - "required": false, - "type": "string", - "x-example": "center", - "default": "center", - "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 -360 and 360.", - "required": false, - "type": "integer", - "format": "int32", - "x-example": -360, - "default": 0, - "in": "query" - }, - { - "name": "background", - "description": "Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.", - "required": false, - "type": "string", - "default": "", - "in": "query" - }, - { - "name": "output", - "description": "Output format type (jpeg, jpg, png, gif and webp).", - "required": false, - "type": "string", - "x-example": "jpg", - "default": "", - "in": "query" - } - ] - } - }, - "/storage/buckets/{bucketId}/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": 159, - "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": "bucketId", - "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).", - "required": true, - "type": "string", - "x-example": "[BUCKET_ID]", - "in": "path" - }, - { - "name": "fileId", - "description": "File ID.", - "required": true, - "type": "string", - "x-example": "[FILE_ID]", - "in": "path" - } - ] - } - }, - "/storage/usage": { - "get": { - "summary": "Get usage stats for storage", - "operationId": "storageGetUsage", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["storage"], - "description": "", - "responses": { - "200": { - "description": "StorageUsage", - "schema": { "$ref": "#/definitions/usageStorage" } - } - }, - "x-appwrite": { - "method": "getUsage", - "weight": 162, - "cookies": false, - "type": "", - "demo": "storage/get-usage.md", - "edit": "https://github.com/appwrite/appwrite/edit/master", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "files.read", - "platforms": ["console"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [] }], - "parameters": [ - { - "name": "range", - "description": "Date range.", - "required": false, - "type": "string", - "x-example": "24h", - "default": "30d", - "in": "query" - } - ] - } - }, - "/storage/{bucketId}/usage": { - "get": { - "summary": "Get usage stats for a storage bucket", - "operationId": "storageGetBucketUsage", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["storage"], - "description": "", - "responses": { - "200": { - "description": "UsageBuckets", - "schema": { "$ref": "#/definitions/usageBuckets" } - } - }, - "x-appwrite": { - "method": "getBucketUsage", - "weight": 163, - "cookies": false, - "type": "", - "demo": "storage/get-bucket-usage.md", - "edit": "https://github.com/appwrite/appwrite/edit/master", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "files.read", - "platforms": ["console"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [] }], - "parameters": [ - { - "name": "bucketId", - "description": "Bucket ID.", - "required": true, - "type": "string", - "x-example": "[BUCKET_ID]", - "in": "path" - }, - { - "name": "range", - "description": "Date range.", - "required": false, - "type": "string", - "x-example": "24h", - "default": "30d", - "in": "query" - } - ] - } - }, - "/teams": { - "get": { - "summary": "List Teams", - "operationId": "teamsList", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["teams"], - "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](/docs/admin).", - "responses": { - "200": { - "description": "Teams List", - "schema": { "$ref": "#/definitions/teamList" } - } - }, - "x-appwrite": { - "method": "list", - "weight": 165, - "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": "Maximum number of teams to return in response. 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. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - }, - { - "name": "cursor", - "description": "ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "string", - "x-example": "[CURSOR]", - "default": "", - "in": "query" - }, - { - "name": "cursorDirection", - "description": "Direction of the cursor.", - "required": false, - "type": "string", - "x-example": "after", - "default": "after", - "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. Only the users with the owner role can invite new members, add new owners and delete or update the team.", - "responses": { - "201": { - "description": "Team", - "schema": { "$ref": "#/definitions/team" } - } - }, - "x-appwrite": { - "method": "create", - "weight": 164, - "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": { - "teamId": { - "type": "string", - "description": "Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": null, - "x-example": "[TEAM_ID]" - }, - "name": { - "type": "string", - "description": "Team name. Max length: 128 chars.", - "default": null, - "x-example": "[NAME]" - }, - "roles": { - "type": "array", - "description": "Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.", - "default": ["owner"], - "x-example": null, - "items": { "type": "string" } - } - }, - "required": ["teamId", "name"] - } - } - ] - } - }, - "/teams/{teamId}": { - "get": { - "summary": "Get Team", - "operationId": "teamsGet", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["teams"], - "description": "Get a team by its ID. All team members have read access for this resource.", - "responses": { - "200": { - "description": "Team", - "schema": { "$ref": "#/definitions/team" } - } - }, - "x-appwrite": { - "method": "get", - "weight": 166, - "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 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 using its ID. Only members with the owner role can update the team.", - "responses": { - "200": { - "description": "Team", - "schema": { "$ref": "#/definitions/team" } - } - }, - "x-appwrite": { - "method": "update", - "weight": 167, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[TEAM_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "New team name. Max length: 128 chars.", - "default": null, - "x-example": "[NAME]" - } - }, - "required": ["name"] - } - } - ] - }, - "delete": { - "summary": "Delete Team", - "operationId": "teamsDelete", - "consumes": ["application/json"], - "produces": [], - "tags": ["teams"], - "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", - "responses": { "204": { "description": "No content" } }, - "x-appwrite": { - "method": "delete", - "weight": 168, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[TEAM_ID]", - "in": "path" - } - ] - } - }, - "/teams/{teamId}/logs": { - "get": { - "summary": "List Team Logs", - "operationId": "teamsListLogs", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["teams"], - "description": "Get the team activity logs list by its unique ID.", - "responses": { - "200": { - "description": "Logs List", - "schema": { "$ref": "#/definitions/logList" } - } - }, - "x-appwrite": { - "method": "listLogs", - "weight": 175, - "cookies": false, - "type": "", - "demo": "teams/list-logs.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/teams/get-team-logs.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "teams.read", - "platforms": ["console"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [] }], - "parameters": [ - { - "name": "teamId", - "description": "Team ID.", - "required": true, - "type": "string", - "x-example": "[TEAM_ID]", - "in": "path" - }, - { - "name": "limit", - "description": "Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - } - ] - } - }, - "/teams/{teamId}/memberships": { - "get": { - "summary": "Get Team Memberships", - "operationId": "teamsGetMemberships", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["teams"], - "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", - "responses": { - "200": { - "description": "Memberships List", - "schema": { "$ref": "#/definitions/membershipList" } - } - }, - "x-appwrite": { - "method": "getMemberships", - "weight": 170, - "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 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": "Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - }, - { - "name": "cursor", - "description": "ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "string", - "x-example": "[CURSOR]", - "default": "", - "in": "query" - }, - { - "name": "cursorDirection", - "description": "Direction of the cursor.", - "required": false, - "type": "string", - "x-example": "after", - "default": "after", - "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": "Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.", - "responses": { - "201": { - "description": "Membership", - "schema": { "$ref": "#/definitions/membership" } - } - }, - "x-appwrite": { - "method": "createMembership", - "weight": 169, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[TEAM_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "email": { - "type": "string", - "description": "Email of the new team member.", - "default": null, - "x-example": "email@example.com" - }, - "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" - }, - "name": { - "type": "string", - "description": "Name of the new team member. Max length: 128 chars.", - "default": "", - "x-example": "[NAME]" - } - }, - "required": ["email", "roles", "url"] - } - } - ] - } - }, - "/teams/{teamId}/memberships/{membershipId}": { - "get": { - "summary": "Get Team Membership", - "operationId": "teamsGetMembership", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["teams"], - "description": "Get a team member by the membership unique id. All team members have read access for this resource.", - "responses": { - "200": { - "description": "Memberships List", - "schema": { "$ref": "#/definitions/membershipList" } - } - }, - "x-appwrite": { - "method": "getMembership", - "weight": 171, - "cookies": false, - "type": "", - "demo": "teams/get-membership.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/teams/get-team-member.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "teams.read", - "platforms": ["client", "server", "server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [], "JWT": [] }], - "parameters": [ - { - "name": "teamId", - "description": "Team ID.", - "required": true, - "type": "string", - "x-example": "[TEAM_ID]", - "in": "path" - }, - { - "name": "membershipId", - "description": "Membership ID.", - "required": true, - "type": "string", - "x-example": "[MEMBERSHIP_ID]", - "in": "path" - } - ] - }, - "patch": { - "summary": "Update Membership Roles", - "operationId": "teamsUpdateMembershipRoles", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["teams"], - "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](/docs/permissions).", - "responses": { - "200": { - "description": "Membership", - "schema": { "$ref": "#/definitions/membership" } - } - }, - "x-appwrite": { - "method": "updateMembershipRoles", - "weight": 172, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[TEAM_ID]", - "in": "path" - }, - { - "name": "membershipId", - "description": "Membership ID.", - "required": true, - "type": "string", - "x-example": "[MEMBERSHIP_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "roles": { - "type": "array", - "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). 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": 174, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[TEAM_ID]", - "in": "path" - }, - { - "name": "membershipId", - "description": "Membership ID.", - "required": true, - "type": "string", - "x-example": "[MEMBERSHIP_ID]", - "in": "path" - } - ] - } - }, - "/teams/{teamId}/memberships/{membershipId}/status": { - "patch": { - "summary": "Update Team Membership Status", - "operationId": "teamsUpdateMembershipStatus", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["teams"], - "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", - "responses": { - "200": { - "description": "Membership", - "schema": { "$ref": "#/definitions/membership" } - } - }, - "x-appwrite": { - "method": "updateMembershipStatus", - "weight": 173, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[TEAM_ID]", - "in": "path" - }, - { - "name": "membershipId", - "description": "Membership ID.", - "required": true, - "type": "string", - "x-example": "[MEMBERSHIP_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "userId": { - "type": "string", - "description": "User ID.", - "default": null, - "x-example": "[USER_ID]" - }, - "secret": { - "type": "string", - "description": "Secret key.", - "default": null, - "x-example": "[SECRET]" - } - }, - "required": ["userId", "secret"] - } - } - ] - } - }, - "/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": 177, - "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": "Maximum number of users to return in response. 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. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - }, - { - "name": "cursor", - "description": "ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "string", - "x-example": "[CURSOR]", - "default": "", - "in": "query" - }, - { - "name": "cursorDirection", - "description": "Direction of the cursor.", - "required": false, - "type": "string", - "x-example": "after", - "default": "after", - "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": 176, - "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": { - "userId": { - "type": "string", - "description": "User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": null, - "x-example": "[USER_ID]" - }, - "email": { - "type": "string", - "description": "User email.", - "default": null, - "x-example": "email@example.com" - }, - "password": { - "type": "string", - "description": "User password. Must be at least 8 chars.", - "default": null, - "x-example": "password" - }, - "name": { - "type": "string", - "description": "User name. Max length: 128 chars.", - "default": "", - "x-example": "[NAME]" - } - }, - "required": ["userId", "email", "password"] - } - } - ] - } - }, - "/users/usage": { - "get": { - "summary": "Get usage stats for the users API", - "operationId": "usersGetUsage", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["users"], - "description": "", - "responses": { - "200": { - "description": "UsageUsers", - "schema": { "$ref": "#/definitions/usageUsers" } - } - }, - "x-appwrite": { - "method": "getUsage", - "weight": 191, - "cookies": false, - "type": "", - "demo": "users/get-usage.md", - "edit": "https://github.com/appwrite/appwrite/edit/master", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "users.read", - "platforms": ["console"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [] }], - "parameters": [ - { - "name": "range", - "description": "Date range.", - "required": false, - "type": "string", - "x-example": "24h", - "default": "30d", - "in": "query" - }, - { - "name": "provider", - "description": "Provider Name.", - "required": false, - "type": "string", - "x-example": "email", - "default": "", - "in": "query" - } - ] - } - }, - "/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": 178, - "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 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": 190, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[USER_ID]", - "in": "path" - } - ] - } - }, - "/users/{userId}/email": { - "patch": { - "summary": "Update Email", - "operationId": "usersUpdateEmail", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["users"], - "description": "Update the user email by its unique ID.", - "responses": { - "200": { - "description": "User", - "schema": { "$ref": "#/definitions/user" } - } - }, - "x-appwrite": { - "method": "updateEmail", - "weight": 186, - "cookies": false, - "type": "", - "demo": "users/update-email.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/users/update-user-email.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "users.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "userId", - "description": "User ID.", - "required": true, - "type": "string", - "x-example": "[USER_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "email": { - "type": "string", - "description": "User email.", - "default": null, - "x-example": "email@example.com" - } - }, - "required": ["email"] - } - } - ] - } - }, - "/users/{userId}/logs": { - "get": { - "summary": "Get User Logs", - "operationId": "usersGetLogs", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["users"], - "description": "Get the user activity logs list by its unique ID.", - "responses": { - "200": { - "description": "Logs List", - "schema": { "$ref": "#/definitions/logList" } - } - }, - "x-appwrite": { - "method": "getLogs", - "weight": 181, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[USER_ID]", - "in": "path" - }, - { - "name": "limit", - "description": "Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)", - "required": false, - "type": "integer", - "format": "int32", - "x-example": 0, - "default": 0, - "in": "query" - } - ] - } - }, - "/users/{userId}/name": { - "patch": { - "summary": "Update Name", - "operationId": "usersUpdateName", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["users"], - "description": "Update the user name by its unique ID.", - "responses": { - "200": { - "description": "User", - "schema": { "$ref": "#/definitions/user" } - } - }, - "x-appwrite": { - "method": "updateName", - "weight": 184, - "cookies": false, - "type": "", - "demo": "users/update-name.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/users/update-user-name.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "users.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "userId", - "description": "User ID.", - "required": true, - "type": "string", - "x-example": "[USER_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "User name. Max length: 128 chars.", - "default": null, - "x-example": "[NAME]" - } - }, - "required": ["name"] - } - } - ] - } - }, - "/users/{userId}/password": { - "patch": { - "summary": "Update Password", - "operationId": "usersUpdatePassword", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["users"], - "description": "Update the user password by its unique ID.", - "responses": { - "200": { - "description": "User", - "schema": { "$ref": "#/definitions/user" } - } - }, - "x-appwrite": { - "method": "updatePassword", - "weight": 185, - "cookies": false, - "type": "", - "demo": "users/update-password.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/users/update-user-password.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "users.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "userId", - "description": "User ID.", - "required": true, - "type": "string", - "x-example": "[USER_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "password": { - "type": "string", - "description": "New user password. Must be at least 8 chars.", - "default": null, - "x-example": "password" - } - }, - "required": ["password"] - } - } - ] - } - }, - "/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": 179, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[USER_ID]", - "in": "path" - } - ] - }, - "patch": { - "summary": "Update User Preferences", - "operationId": "usersUpdatePrefs", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["users"], - "description": "Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", - "responses": { - "200": { - "description": "Preferences", - "schema": { "$ref": "#/definitions/preferences" } - } - }, - "x-appwrite": { - "method": "updatePrefs", - "weight": 187, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[USER_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "prefs": { - "type": "object", - "description": "Prefs key-value JSON object.", - "default": {}, - "x-example": "{}" - } - }, - "required": ["prefs"] - } - } - ] - } - }, - "/users/{userId}/sessions": { - "get": { - "summary": "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": 180, - "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 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": 189, - "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 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": 188, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[USER_ID]", - "in": "path" - }, - { - "name": "sessionId", - "description": "Session ID.", - "required": true, - "type": "string", - "x-example": "[SESSION_ID]", - "in": "path" - } - ] - } - }, - "/users/{userId}/status": { - "patch": { - "summary": "Update User Status", - "operationId": "usersUpdateStatus", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["users"], - "description": "Update the user status by its unique ID.", - "responses": { - "200": { - "description": "User", - "schema": { "$ref": "#/definitions/user" } - } - }, - "x-appwrite": { - "method": "updateStatus", - "weight": 182, - "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 ID.", - "required": true, - "type": "string", - "x-example": "[USER_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "status": { - "type": "boolean", - "description": "User Status. To activate the user pass `true` and to block the user pass `false`.", - "default": null, - "x-example": false - } - }, - "required": ["status"] - } - } - ] - } - }, - "/users/{userId}/verification": { - "patch": { - "summary": "Update Email Verification", - "operationId": "usersUpdateVerification", - "consumes": ["application/json"], - "produces": ["application/json"], - "tags": ["users"], - "description": "Update the user email verification status by its unique ID.", - "responses": { - "200": { - "description": "User", - "schema": { "$ref": "#/definitions/user" } - } - }, - "x-appwrite": { - "method": "updateVerification", - "weight": 183, - "cookies": false, - "type": "", - "demo": "users/update-verification.md", - "edit": "https://github.com/appwrite/appwrite/edit/master/docs/references/users/update-user-verification.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "users.write", - "platforms": ["server"], - "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "Key": [] }], - "parameters": [ - { - "name": "userId", - "description": "User ID.", - "required": true, - "type": "string", - "x-example": "[USER_ID]", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "emailVerification": { - "type": "boolean", - "description": "User email verification status.", - "default": null, - "x-example": false - } - }, - "required": ["emailVerification"] - } - } - ] - } - } - }, - "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": { - "documentList": { - "description": "Documents List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of documents documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "documents": { - "type": "array", - "description": "List of documents.", - "items": { "type": "object", "$ref": "#/definitions/document" }, - "x-example": "" - } - }, - "required": ["total", "documents"] - }, - "collectionList": { - "description": "Collections List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of collections documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "collections": { - "type": "array", - "description": "List of collections.", - "items": { "type": "object", "$ref": "#/definitions/collection" }, - "x-example": "" - } - }, - "required": ["total", "collections"] - }, - "indexList": { - "description": "Indexes List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of indexes documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "indexes": { - "type": "array", - "description": "List of indexes.", - "items": { "type": "object", "$ref": "#/definitions/index" }, - "x-example": "" - } - }, - "required": ["total", "indexes"] - }, - "userList": { - "description": "Users List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of users documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "users": { - "type": "array", - "description": "List of users.", - "items": { "type": "object", "$ref": "#/definitions/user" }, - "x-example": "" - } - }, - "required": ["total", "users"] - }, - "sessionList": { - "description": "Sessions List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of sessions documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "sessions": { - "type": "array", - "description": "List of sessions.", - "items": { "type": "object", "$ref": "#/definitions/session" }, - "x-example": "" - } - }, - "required": ["total", "sessions"] - }, - "logList": { - "description": "Logs List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of logs documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "logs": { - "type": "array", - "description": "List of logs.", - "items": { "type": "object", "$ref": "#/definitions/log" }, - "x-example": "" - } - }, - "required": ["total", "logs"] - }, - "fileList": { - "description": "Files List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of files documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "files": { - "type": "array", - "description": "List of files.", - "items": { "type": "object", "$ref": "#/definitions/file" }, - "x-example": "" - } - }, - "required": ["total", "files"] - }, - "bucketList": { - "description": "Buckets List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of buckets documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "buckets": { - "type": "array", - "description": "List of buckets.", - "items": { "type": "object", "$ref": "#/definitions/bucket" }, - "x-example": "" - } - }, - "required": ["total", "buckets"] - }, - "teamList": { - "description": "Teams List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of teams documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "teams": { - "type": "array", - "description": "List of teams.", - "items": { "type": "object", "$ref": "#/definitions/team" }, - "x-example": "" - } - }, - "required": ["total", "teams"] - }, - "membershipList": { - "description": "Memberships List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of memberships documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "memberships": { - "type": "array", - "description": "List of memberships.", - "items": { "type": "object", "$ref": "#/definitions/membership" }, - "x-example": "" - } - }, - "required": ["total", "memberships"] - }, - "functionList": { - "description": "Functions List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of functions documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "functions": { - "type": "array", - "description": "List of functions.", - "items": { "type": "object", "$ref": "#/definitions/function" }, - "x-example": "" - } - }, - "required": ["total", "functions"] - }, - "runtimeList": { - "description": "Runtimes List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of runtimes documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "runtimes": { - "type": "array", - "description": "List of runtimes.", - "items": { "type": "object", "$ref": "#/definitions/runtime" }, - "x-example": "" - } - }, - "required": ["total", "runtimes"] - }, - "deploymentList": { - "description": "Deployments List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of deployments documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "deployments": { - "type": "array", - "description": "List of deployments.", - "items": { "type": "object", "$ref": "#/definitions/deployment" }, - "x-example": "" - } - }, - "required": ["total", "deployments"] - }, - "executionList": { - "description": "Executions List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of executions documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "executions": { - "type": "array", - "description": "List of executions.", - "items": { "type": "object", "$ref": "#/definitions/execution" }, - "x-example": "" - } - }, - "required": ["total", "executions"] - }, - "projectList": { - "description": "Projects List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of projects documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "projects": { - "type": "array", - "description": "List of projects.", - "items": { "type": "object", "$ref": "#/definitions/project" }, - "x-example": "" - } - }, - "required": ["total", "projects"] - }, - "webhookList": { - "description": "Webhooks List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of webhooks documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "webhooks": { - "type": "array", - "description": "List of webhooks.", - "items": { "type": "object", "$ref": "#/definitions/webhook" }, - "x-example": "" - } - }, - "required": ["total", "webhooks"] - }, - "keyList": { - "description": "API Keys List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of keys documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "keys": { - "type": "array", - "description": "List of keys.", - "items": { "type": "object", "$ref": "#/definitions/key" }, - "x-example": "" - } - }, - "required": ["total", "keys"] - }, - "platformList": { - "description": "Platforms List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of platforms documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "platforms": { - "type": "array", - "description": "List of platforms.", - "items": { "type": "object", "$ref": "#/definitions/platform" }, - "x-example": "" - } - }, - "required": ["total", "platforms"] - }, - "domainList": { - "description": "Domains List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of domains documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "domains": { - "type": "array", - "description": "List of domains.", - "items": { "type": "object", "$ref": "#/definitions/domain" }, - "x-example": "" - } - }, - "required": ["total", "domains"] - }, - "countryList": { - "description": "Countries List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of countries documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "countries": { - "type": "array", - "description": "List of countries.", - "items": { "type": "object", "$ref": "#/definitions/country" }, - "x-example": "" - } - }, - "required": ["total", "countries"] - }, - "continentList": { - "description": "Continents List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of continents documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "continents": { - "type": "array", - "description": "List of continents.", - "items": { "type": "object", "$ref": "#/definitions/continent" }, - "x-example": "" - } - }, - "required": ["total", "continents"] - }, - "languageList": { - "description": "Languages List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of languages documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "languages": { - "type": "array", - "description": "List of languages.", - "items": { "type": "object", "$ref": "#/definitions/language" }, - "x-example": "" - } - }, - "required": ["total", "languages"] - }, - "currencyList": { - "description": "Currencies List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of currencies documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "currencies": { - "type": "array", - "description": "List of currencies.", - "items": { "type": "object", "$ref": "#/definitions/currency" }, - "x-example": "" - } - }, - "required": ["total", "currencies"] - }, - "phoneList": { - "description": "Phones List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of phones documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "phones": { - "type": "array", - "description": "List of phones.", - "items": { "type": "object", "$ref": "#/definitions/phone" }, - "x-example": "" - } - }, - "required": ["total", "phones"] - }, - "metricList": { - "description": "Metric List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of metrics documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "metrics": { - "type": "array", - "description": "List of metrics.", - "items": { "type": "object", "$ref": "#/definitions/metric" }, - "x-example": "" - } - }, - "required": ["total", "metrics"] - }, - "collection": { - "description": "Collection", - "type": "object", - "properties": { - "$id": { - "type": "string", - "description": "Collection ID.", - "x-example": "5e5ea5c16897e" - }, - "$read": { - "type": "array", - "description": "Collection read permissions.", - "items": { "type": "string" }, - "x-example": "role:all" - }, - "$write": { - "type": "array", - "description": "Collection write permissions.", - "items": { "type": "string" }, - "x-example": "user:608f9da25e7e1" - }, - "name": { - "type": "string", - "description": "Collection name.", - "x-example": "My Collection" - }, - "enabled": { - "type": "boolean", - "description": "Collection enabled.", - "x-example": false - }, - "permission": { - "type": "string", - "description": "Collection permission model. Possible values: `document` or `collection`", - "x-example": "document" - }, - "attributes": { - "type": "array", - "description": "Collection attributes.", - "items": { - "x-anyOf": [ - { "$ref": "#/definitions/attributeBoolean" }, - { "$ref": "#/definitions/attributeInteger" }, - { "$ref": "#/definitions/attributeFloat" }, - { "$ref": "#/definitions/attributeEmail" }, - { "$ref": "#/definitions/attributeEnum" }, - { "$ref": "#/definitions/attributeUrl" }, - { "$ref": "#/definitions/attributeIp" }, - { "$ref": "#/definitions/attributeString" } - ] - }, - "x-example": {} - }, - "indexes": { - "type": "array", - "description": "Collection indexes.", - "items": { "type": "object", "$ref": "#/definitions/index" }, - "x-example": {} - } - }, - "required": [ - "$id", - "$read", - "$write", - "name", - "enabled", - "permission", - "attributes", - "indexes" - ] - }, - "attributeList": { - "description": "Attributes List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of attributes in the given collection.", - "x-example": 5, - "format": "int32" - }, - "attributes": { - "type": "array", - "description": "List of attributes.", - "items": { - "x-anyOf": [ - { "$ref": "#/definitions/attributeBoolean" }, - { "$ref": "#/definitions/attributeInteger" }, - { "$ref": "#/definitions/attributeFloat" }, - { "$ref": "#/definitions/attributeEmail" }, - { "$ref": "#/definitions/attributeEnum" }, - { "$ref": "#/definitions/attributeUrl" }, - { "$ref": "#/definitions/attributeIp" }, - { "$ref": "#/definitions/attributeString" } - ] - }, - "x-example": "" - } - }, - "required": ["total", "attributes"] - }, - "attributeString": { - "description": "AttributeString", - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "x-example": "fullName" - }, - "type": { - "type": "string", - "description": "Attribute type.", - "x-example": "string" - }, - "status": { - "type": "string", - "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "x-example": true - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "x-example": false, - "x-nullable": true - }, - "size": { - "type": "integer", - "description": "Attribute size.", - "x-example": 128, - "format": "int32" - }, - "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "x-example": "default", - "x-nullable": true - } - }, - "required": ["key", "type", "status", "required", "size"] - }, - "attributeInteger": { - "description": "AttributeInteger", - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "x-example": "count" - }, - "type": { - "type": "string", - "description": "Attribute type.", - "x-example": "integer" - }, - "status": { - "type": "string", - "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "x-example": true - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "x-example": false, - "x-nullable": true - }, - "min": { - "type": "integer", - "description": "Minimum value to enforce for new documents.", - "x-example": 1, - "format": "int32", - "x-nullable": true - }, - "max": { - "type": "integer", - "description": "Maximum value to enforce for new documents.", - "x-example": 10, - "format": "int32", - "x-nullable": true - }, - "default": { - "type": "integer", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "x-example": 10, - "format": "int32", - "x-nullable": true - } - }, - "required": ["key", "type", "status", "required"] - }, - "attributeFloat": { - "description": "AttributeFloat", - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "x-example": "percentageCompleted" - }, - "type": { - "type": "string", - "description": "Attribute type.", - "x-example": "double" - }, - "status": { - "type": "string", - "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "x-example": true - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "x-example": false, - "x-nullable": true - }, - "min": { - "type": "number", - "description": "Minimum value to enforce for new documents.", - "x-example": 1.5, - "format": "double", - "x-nullable": true - }, - "max": { - "type": "number", - "description": "Maximum value to enforce for new documents.", - "x-example": 10.5, - "format": "double", - "x-nullable": true - }, - "default": { - "type": "number", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "x-example": 2.5, - "format": "double", - "x-nullable": true - } - }, - "required": ["key", "type", "status", "required"] - }, - "attributeBoolean": { - "description": "AttributeBoolean", - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "x-example": "isEnabled" - }, - "type": { - "type": "string", - "description": "Attribute type.", - "x-example": "boolean" - }, - "status": { - "type": "string", - "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "x-example": true - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "x-example": false, - "x-nullable": true - }, - "default": { - "type": "boolean", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "x-example": false, - "x-nullable": true - } - }, - "required": ["key", "type", "status", "required"] - }, - "attributeEmail": { - "description": "AttributeEmail", - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "x-example": "userEmail" - }, - "type": { - "type": "string", - "description": "Attribute type.", - "x-example": "string" - }, - "status": { - "type": "string", - "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "x-example": true - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "x-example": false, - "x-nullable": true - }, - "format": { - "type": "string", - "description": "String format.", - "x-example": "email" - }, - "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "x-example": "default@example.com", - "x-nullable": true - } - }, - "required": ["key", "type", "status", "required", "format"] - }, - "attributeEnum": { - "description": "AttributeEnum", - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "x-example": "status" - }, - "type": { - "type": "string", - "description": "Attribute type.", - "x-example": "string" - }, - "status": { - "type": "string", - "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "x-example": true - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "x-example": false, - "x-nullable": true - }, - "elements": { - "type": "array", - "description": "Array of elements in enumerated type.", - "items": { "type": "string" }, - "x-example": "element" - }, - "format": { - "type": "string", - "description": "String format.", - "x-example": "enum" - }, - "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "x-example": "element", - "x-nullable": true - } - }, - "required": ["key", "type", "status", "required", "elements", "format"] - }, - "attributeIp": { - "description": "AttributeIP", - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "x-example": "ipAddress" - }, - "type": { - "type": "string", - "description": "Attribute type.", - "x-example": "string" - }, - "status": { - "type": "string", - "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "x-example": true - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "x-example": false, - "x-nullable": true - }, - "format": { - "type": "string", - "description": "String format.", - "x-example": "ip" - }, - "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "x-example": "192.0.2.0", - "x-nullable": true - } - }, - "required": ["key", "type", "status", "required", "format"] - }, - "attributeUrl": { - "description": "AttributeURL", - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Attribute Key.", - "x-example": "githubUrl" - }, - "type": { - "type": "string", - "description": "Attribute type.", - "x-example": "string" - }, - "status": { - "type": "string", - "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" - }, - "required": { - "type": "boolean", - "description": "Is attribute required?", - "x-example": true - }, - "array": { - "type": "boolean", - "description": "Is attribute an array?", - "x-example": false, - "x-nullable": true - }, - "format": { - "type": "string", - "description": "String format.", - "x-example": "url" - }, - "default": { - "type": "string", - "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", - "x-example": "http://example.com", - "x-nullable": true - } - }, - "required": ["key", "type", "status", "required", "format"] - }, - "index": { - "description": "Index", - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "Index Key.", - "x-example": "index1" - }, - "type": { - "type": "string", - "description": "Index type.", - "x-example": "primary" - }, - "status": { - "type": "string", - "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" - }, - "attributes": { - "type": "array", - "description": "Index attributes.", - "items": { "type": "string" }, - "x-example": [] - }, - "orders": { - "type": "array", - "description": "Index orders.", - "items": { "type": "string" }, - "x-example": [] - } - }, - "required": ["key", "type", "status", "attributes", "orders"] - }, - "document": { - "description": "Document", - "type": "object", - "properties": { - "$id": { - "type": "string", - "description": "Document ID.", - "x-example": "5e5ea5c16897e" - }, - "$collection": { - "type": "string", - "description": "Collection ID.", - "x-example": "5e5ea5c15117e" - }, - "$read": { - "type": "array", - "description": "Document read permissions.", - "items": { "type": "string" }, - "x-example": "role:all" - }, - "$write": { - "type": "array", - "description": "Document write permissions.", - "items": { "type": "string" }, - "x-example": "user:608f9da25e7e1" - } - }, - "additionalProperties": true, - "required": ["$id", "$collection", "$read", "$write"] - }, - "log": { - "description": "Log", - "type": "object", - "properties": { - "event": { - "type": "string", - "description": "Event name.", - "x-example": "account.sessions.create" - }, - "userId": { - "type": "string", - "description": "User ID.", - "x-example": "610fc2f985ee0" - }, - "userEmail": { - "type": "string", - "description": "User Email.", - "x-example": "john@appwrite.io" - }, - "userName": { - "type": "string", - "description": "User Name.", - "x-example": "John Doe" - }, - "mode": { - "type": "string", - "description": "API mode when event triggered.", - "x-example": "admin" - }, - "ip": { - "type": "string", - "description": "IP session in use when the session was created.", - "x-example": "127.0.0.1" - }, - "time": { - "type": "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", - "userId", - "userEmail", - "userName", - "mode", - "ip", - "time", - "osCode", - "osName", - "osVersion", - "clientType", - "clientCode", - "clientName", - "clientVersion", - "clientEngine", - "clientEngineVersion", - "deviceName", - "deviceBrand", - "deviceModel", - "countryCode", - "countryName" - ] - }, - "user": { - "description": "User", - "type": "object", - "properties": { - "$id": { - "type": "string", - "description": "User ID.", - "x-example": "5e5ea5c16897e" - }, - "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": "boolean", - "description": "User status. Pass `true` for enabled and `false` for disabled.", - "x-example": true - }, - "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" - }, - "providerAccessToken": { - "type": "string", - "description": "Session Provider Access Token.", - "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" - }, - "providerAccessTokenExpiry": { - "type": "integer", - "description": "Date, the Unix timestamp of when the access token expires.", - "x-example": 1592981250, - "format": "int32" - }, - "providerRefreshToken": { - "type": "string", - "description": "Session Provider Refresh Token.", - "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" - }, - "ip": { - "type": "string", - "description": "IP in use when the session was created.", - "x-example": "127.0.0.1" - }, - "osCode": { - "type": "string", - "description": "Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json).", - "x-example": "Mac" - }, - "osName": { - "type": "string", - "description": "Operating system name.", - "x-example": "Mac" - }, - "osVersion": { - "type": "string", - "description": "Operating system version.", - "x-example": "Mac" - }, - "clientType": { - "type": "string", - "description": "Client type.", - "x-example": "browser" - }, - "clientCode": { - "type": "string", - "description": "Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json).", - "x-example": "CM" - }, - "clientName": { - "type": "string", - "description": "Client name.", - "x-example": "Chrome Mobile iOS" - }, - "clientVersion": { - "type": "string", - "description": "Client version.", - "x-example": "84.0" - }, - "clientEngine": { - "type": "string", - "description": "Client engine name.", - "x-example": "WebKit" - }, - "clientEngineVersion": { - "type": "string", - "description": "Client engine name.", - "x-example": "605.1.15" - }, - "deviceName": { - "type": "string", - "description": "Device name.", - "x-example": "smartphone" - }, - "deviceBrand": { - "type": "string", - "description": "Device brand name.", - "x-example": "Google" - }, - "deviceModel": { - "type": "string", - "description": "Device model name.", - "x-example": "Nexus 5" - }, - "countryCode": { - "type": "string", - "description": "Country two-character ISO 3166-1 alpha code.", - "x-example": "US" - }, - "countryName": { - "type": "string", - "description": "Country name.", - "x-example": "United States" - }, - "current": { - "type": "boolean", - "description": "Returns true if this the current user session.", - "x-example": true - } - }, - "required": [ - "$id", - "userId", - "expire", - "provider", - "providerUid", - "providerAccessToken", - "providerAccessTokenExpiry", - "providerRefreshToken", - "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" - }, - "bucketId": { - "type": "string", - "description": "Bucket ID.", - "x-example": "5e5ea5c16897e" - }, - "$read": { - "type": "array", - "description": "File read permissions.", - "items": { "type": "string" }, - "x-example": "role:all" - }, - "$write": { - "type": "array", - "description": "File write permissions.", - "items": { "type": "string" }, - "x-example": "user:608f9da25e7e1" - }, - "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" - }, - "chunksTotal": { - "type": "integer", - "description": "Total number of chunks available", - "x-example": 17890, - "format": "int32" - }, - "chunksUploaded": { - "type": "integer", - "description": "Total number of chunks uploaded", - "x-example": 17890, - "format": "int32" - } - }, - "required": [ - "$id", - "bucketId", - "$read", - "$write", - "name", - "dateCreated", - "signature", - "mimeType", - "sizeOriginal", - "chunksTotal", - "chunksUploaded" - ] - }, - "bucket": { - "description": "Bucket", - "type": "object", - "properties": { - "$id": { - "type": "string", - "description": "Bucket ID.", - "x-example": "5e5ea5c16897e" - }, - "$read": { - "type": "array", - "description": "File read permissions.", - "items": { "type": "string" }, - "x-example": ["role:all"] - }, - "$write": { - "type": "array", - "description": "File write permissions.", - "items": { "type": "string" }, - "x-example": ["user:608f9da25e7e1"] - }, - "permission": { - "type": "string", - "description": "Bucket permission model. Possible values: `bucket` or `file`", - "x-example": "file" - }, - "dateCreated": { - "type": "integer", - "description": "Bucket creation date in Unix timestamp.", - "x-example": 1592981250, - "format": "int32" - }, - "dateUpdated": { - "type": "integer", - "description": "Bucket update date in Unix timestamp.", - "x-example": 1592981250, - "format": "int32" - }, - "name": { - "type": "string", - "description": "Bucket name.", - "x-example": "Documents" - }, - "enabled": { - "type": "boolean", - "description": "Bucket enabled.", - "x-example": false - }, - "maximumFileSize": { - "type": "integer", - "description": "Maximum file size supported.", - "x-example": 100, - "format": "int32" - }, - "allowedFileExtensions": { - "type": "array", - "description": "Allowed file extensions.", - "items": { "type": "string" }, - "x-example": ["jpg", "png"] - }, - "encryption": { - "type": "boolean", - "description": "Bucket is encrypted.", - "x-example": false - }, - "antivirus": { - "type": "boolean", - "description": "Virus scanning is enabled.", - "x-example": false - } - }, - "required": [ - "$id", - "$read", - "$write", - "permission", - "dateCreated", - "dateUpdated", - "name", - "enabled", - "maximumFileSize", - "allowedFileExtensions", - "encryption", - "antivirus" - ] - }, - "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" - }, - "total": { - "type": "integer", - "description": "Total number of team members.", - "x-example": 7, - "format": "int32" - } - }, - "required": ["$id", "name", "dateCreated", "total"] - }, - "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" - }, - "execute": { - "type": "array", - "description": "Execution permissions.", - "items": { "type": "string" }, - "x-example": "role:member" - }, - "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" - }, - "runtime": { - "type": "string", - "description": "Function execution runtime.", - "x-example": "python-3.8" - }, - "deployment": { - "type": "string", - "description": "Function's active deployment ID.", - "x-example": "5e5ea5c16897e" - }, - "vars": { - "type": "object", - "additionalProperties": true, - "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", - "execute", - "name", - "dateCreated", - "dateUpdated", - "status", - "runtime", - "deployment", - "vars", - "events", - "schedule", - "scheduleNext", - "schedulePrevious", - "timeout" - ] - }, - "runtime": { - "description": "Runtime", - "type": "object", - "properties": { - "$id": { - "type": "string", - "description": "Runtime ID.", - "x-example": "python-3.8" - }, - "name": { - "type": "string", - "description": "Runtime Name.", - "x-example": "Python" - }, - "version": { - "type": "string", - "description": "Runtime version.", - "x-example": "3.8" - }, - "base": { - "type": "string", - "description": "Base Docker image used to build the runtime.", - "x-example": "python:3.8-alpine" - }, - "image": { - "type": "string", - "description": "Image name of Docker Hub.", - "x-example": "appwrite\\/runtime-for-python:3.8" - }, - "logo": { - "type": "string", - "description": "Name of the logo image.", - "x-example": "python.png" - }, - "supports": { - "type": "array", - "description": "List of supported architectures.", - "items": { "type": "string" }, - "x-example": "amd64" - } - }, - "required": [ - "$id", - "name", - "version", - "base", - "image", - "logo", - "supports" - ] - }, - "deployment": { - "description": "Deployment", - "type": "object", - "properties": { - "$id": { - "type": "string", - "description": "Deployment ID.", - "x-example": "5e5ea5c16897e" - }, - "resourceId": { - "type": "string", - "description": "Resource ID.", - "x-example": "5e5ea6g16897e" - }, - "resourceType": { - "type": "string", - "description": "Resource type.", - "x-example": "functions" - }, - "dateCreated": { - "type": "integer", - "description": "The deployment creation date in Unix timestamp.", - "x-example": 1592981250, - "format": "int32" - }, - "entrypoint": { - "type": "string", - "description": "The entrypoint file to use to execute the deployment code.", - "x-example": "enabled" - }, - "size": { - "type": "integer", - "description": "The code size in bytes.", - "x-example": 128, - "format": "int32" - }, - "buildId": { - "type": "string", - "description": "The current build ID.", - "x-example": "5e5ea5c16897e" - }, - "activate": { - "type": "boolean", - "description": "Whether the deployment should be automatically activated.", - "x-example": true - }, - "status": { - "type": "string", - "description": "The deployment status.", - "x-example": "enabled" - }, - "buildStdout": { - "type": "string", - "description": "The build stdout.", - "x-example": "enabled" - }, - "buildStderr": { - "type": "string", - "description": "The build stderr.", - "x-example": "enabled" - } - }, - "required": [ - "$id", - "resourceId", - "resourceType", - "dateCreated", - "entrypoint", - "size", - "buildId", - "activate", - "status", - "buildStdout", - "buildStderr" - ] - }, - "execution": { - "description": "Execution", - "type": "object", - "properties": { - "$id": { - "type": "string", - "description": "Execution ID.", - "x-example": "5e5ea5c16897e" - }, - "$read": { - "type": "array", - "description": "Execution read permissions.", - "items": { "type": "string" }, - "x-example": "role:all" - }, - "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" - }, - "statusCode": { - "type": "integer", - "description": "The script status code.", - "x-example": 0, - "format": "int32" - }, - "stdout": { - "type": "string", - "description": "The script stdout output string. Logs the last 4,000 characters of the execution stdout output.", - "x-example": "" - }, - "stderr": { - "type": "string", - "description": "The script stderr output string. Logs the last 4,000 characters of the execution stderr output", - "x-example": "" - }, - "time": { - "type": "number", - "description": "The script execution time in seconds.", - "x-example": 0.4, - "format": "double" - } - }, - "required": [ - "$id", - "$read", - "functionId", - "dateCreated", - "trigger", - "status", - "statusCode", - "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" - }, - "authLimit": { - "type": "integer", - "description": "Max users allowed. 0 is unlimited.", - "x-example": 100, - "format": "int32" - }, - "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": {} - }, - "providerAmazonAppid": { - "type": "string", - "description": "Amazon OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerAmazonSecret": { - "type": "string", - "description": "Amazon OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerAppleAppid": { - "type": "string", - "description": "Apple OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerAppleSecret": { - "type": "string", - "description": "Apple OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerBitbucketAppid": { - "type": "string", - "description": "BitBucket OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerBitbucketSecret": { - "type": "string", - "description": "BitBucket OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerBitlyAppid": { - "type": "string", - "description": "Bitly OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerBitlySecret": { - "type": "string", - "description": "Bitly OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerBoxAppid": { - "type": "string", - "description": "Box OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerBoxSecret": { - "type": "string", - "description": "Box OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerDiscordAppid": { - "type": "string", - "description": "Discord OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerDiscordSecret": { - "type": "string", - "description": "Discord OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerDropboxAppid": { - "type": "string", - "description": "Dropbox OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerDropboxSecret": { - "type": "string", - "description": "Dropbox OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerFacebookAppid": { - "type": "string", - "description": "Facebook OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerFacebookSecret": { - "type": "string", - "description": "Facebook OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerGithubAppid": { - "type": "string", - "description": "GitHub OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerGithubSecret": { - "type": "string", - "description": "GitHub OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerGitlabAppid": { - "type": "string", - "description": "GitLab OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerGitlabSecret": { - "type": "string", - "description": "GitLab OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerGoogleAppid": { - "type": "string", - "description": "Google OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerGoogleSecret": { - "type": "string", - "description": "Google OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerLinkedinAppid": { - "type": "string", - "description": "LinkedIn OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerLinkedinSecret": { - "type": "string", - "description": "LinkedIn OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerMicrosoftAppid": { - "type": "string", - "description": "Microsoft OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerMicrosoftSecret": { - "type": "string", - "description": "Microsoft OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerNotionAppid": { - "type": "string", - "description": "Notion OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerNotionSecret": { - "type": "string", - "description": "Notion OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerPaypalAppid": { - "type": "string", - "description": "PayPal OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerPaypalSecret": { - "type": "string", - "description": "PayPal OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerPaypalSandboxAppid": { - "type": "string", - "description": "PayPal OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerPaypalSandboxSecret": { - "type": "string", - "description": "PayPal OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerSalesforceAppid": { - "type": "string", - "description": "Salesforce OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerSalesforceSecret": { - "type": "string", - "description": "Salesforce OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerSlackAppid": { - "type": "string", - "description": "Slack OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerSlackSecret": { - "type": "string", - "description": "Slack OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerSpotifyAppid": { - "type": "string", - "description": "Spotify OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerSpotifySecret": { - "type": "string", - "description": "Spotify OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerTradeshiftAppid": { - "type": "string", - "description": "Tradeshift OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerTradeshiftSecret": { - "type": "string", - "description": "Tradeshift OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerTradeshiftBoxAppid": { - "type": "string", - "description": "Tradeshift OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerTradeshiftBoxSecret": { - "type": "string", - "description": "Tradeshift OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerTwitchAppid": { - "type": "string", - "description": "Twitch OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerTwitchSecret": { - "type": "string", - "description": "Twitch OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerVkAppid": { - "type": "string", - "description": "VK OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerVkSecret": { - "type": "string", - "description": "VK OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerZoomAppid": { - "type": "string", - "description": "Zoom OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerZoomSecret": { - "type": "string", - "description": "Zoom OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerYahooAppid": { - "type": "string", - "description": "Yahoo OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerYahooSecret": { - "type": "string", - "description": "Yahoo OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerYammerAppid": { - "type": "string", - "description": "Yammer OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerYammerSecret": { - "type": "string", - "description": "Yammer OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerYandexAppid": { - "type": "string", - "description": "Yandex OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerYandexSecret": { - "type": "string", - "description": "Yandex OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerWordpressAppid": { - "type": "string", - "description": "WordPress OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerWordpressSecret": { - "type": "string", - "description": "WordPress OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerStripeAppid": { - "type": "string", - "description": "Stripe OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerStripeSecret": { - "type": "string", - "description": "Stripe OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "providerMockAppid": { - "type": "string", - "description": "Mock OAuth app ID.", - "x-example": "123247283472834787438" - }, - "providerMockSecret": { - "type": "string", - "description": "Mock OAuth secret ID.", - "x-example": "djsgudsdsewe43434343dd34..." - }, - "authEmailPassword": { - "type": "boolean", - "description": "Email/Password auth method status", - "x-example": true - }, - "authUsersAuthMagicURL": { - "type": "boolean", - "description": "Magic URL auth method status", - "x-example": true - }, - "authAnonymous": { - "type": "boolean", - "description": "Anonymous auth method status", - "x-example": true - }, - "authInvites": { - "type": "boolean", - "description": "Invites auth method status", - "x-example": true - }, - "authJWT": { - "type": "boolean", - "description": "JWT auth method status", - "x-example": true - }, - "authPhone": { - "type": "boolean", - "description": "Phone auth method status", - "x-example": true - }, - "serviceStatusForAccount": { - "type": "boolean", - "description": "Account service status", - "x-example": true - }, - "serviceStatusForAvatars": { - "type": "boolean", - "description": "Avatars service status", - "x-example": true - }, - "serviceStatusForDatabase": { - "type": "boolean", - "description": "Database service status", - "x-example": true - }, - "serviceStatusForLocale": { - "type": "boolean", - "description": "Locale service status", - "x-example": true - }, - "serviceStatusForHealth": { - "type": "boolean", - "description": "Health service status", - "x-example": true - }, - "serviceStatusForStorage": { - "type": "boolean", - "description": "Storage service status", - "x-example": true - }, - "serviceStatusForTeams": { - "type": "boolean", - "description": "Teams service status", - "x-example": true - }, - "serviceStatusForUsers": { - "type": "boolean", - "description": "Users service status", - "x-example": true - }, - "serviceStatusForFunctions": { - "type": "boolean", - "description": "Functions service status", - "x-example": true - } - }, - "required": [ - "$id", - "name", - "description", - "teamId", - "logo", - "url", - "legalName", - "legalCountry", - "legalState", - "legalCity", - "legalAddress", - "legalTaxId", - "authLimit", - "platforms", - "webhooks", - "keys", - "domains", - "providerAmazonAppid", - "providerAmazonSecret", - "providerAppleAppid", - "providerAppleSecret", - "providerBitbucketAppid", - "providerBitbucketSecret", - "providerBitlyAppid", - "providerBitlySecret", - "providerBoxAppid", - "providerBoxSecret", - "providerDiscordAppid", - "providerDiscordSecret", - "providerDropboxAppid", - "providerDropboxSecret", - "providerFacebookAppid", - "providerFacebookSecret", - "providerGithubAppid", - "providerGithubSecret", - "providerGitlabAppid", - "providerGitlabSecret", - "providerGoogleAppid", - "providerGoogleSecret", - "providerLinkedinAppid", - "providerLinkedinSecret", - "providerMicrosoftAppid", - "providerMicrosoftSecret", - "providerNotionAppid", - "providerNotionSecret", - "providerPaypalAppid", - "providerPaypalSecret", - "providerPaypalSandboxAppid", - "providerPaypalSandboxSecret", - "providerSalesforceAppid", - "providerSalesforceSecret", - "providerSlackAppid", - "providerSlackSecret", - "providerSpotifyAppid", - "providerSpotifySecret", - "providerTradeshiftAppid", - "providerTradeshiftSecret", - "providerTradeshiftBoxAppid", - "providerTradeshiftBoxSecret", - "providerTwitchAppid", - "providerTwitchSecret", - "providerVkAppid", - "providerVkSecret", - "providerZoomAppid", - "providerZoomSecret", - "providerYahooAppid", - "providerYahooSecret", - "providerYammerAppid", - "providerYammerSecret", - "providerYandexAppid", - "providerYandexSecret", - "providerWordpressAppid", - "providerWordpressSecret", - "providerStripeAppid", - "providerStripeSecret", - "providerMockAppid", - "providerMockSecret", - "authEmailPassword", - "authUsersAuthMagicURL", - "authAnonymous", - "authInvites", - "authJWT", - "authPhone", - "serviceStatusForAccount", - "serviceStatusForAvatars", - "serviceStatusForDatabase", - "serviceStatusForLocale", - "serviceStatusForHealth", - "serviceStatusForStorage", - "serviceStatusForTeams", - "serviceStatusForUsers", - "serviceStatusForFunctions" - ] - }, - "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"] - }, - "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": "double" - }, - "code": { - "type": "string", - "description": "Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format.", - "x-example": "USD" - }, - "namePlural": { - "type": "string", - "description": "Currency plural name", - "x-example": "US dollars" - } - }, - "required": [ - "symbol", - "name", - "symbolNative", - "decimalDigits", - "rounding", - "code", - "namePlural" - ] - }, - "phone": { - "description": "Phone", - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Phone code.", - "x-example": "+1" - }, - "countryCode": { - "type": "string", - "description": "Country two-character ISO 3166-1 alpha code.", - "x-example": "US" - }, - "countryName": { - "type": "string", - "description": "Country name.", - "x-example": "United States" - } - }, - "required": ["code", "countryCode", "countryName"] - }, - "healthAntivirus": { - "description": "Health Antivirus", - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "Antivirus version.", - "x-example": "1.0.0" - }, - "status": { - "type": "string", - "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", - "x-example": "online" - } - }, - "required": ["version", "status"] - }, - "healthQueue": { - "description": "Health Queue", - "type": "object", - "properties": { - "size": { - "type": "integer", - "description": "Amount of actions in the queue.", - "x-example": 8, - "format": "int32" - } - }, - "required": ["size"] - }, - "healthStatus": { - "description": "Health Status", - "type": "object", - "properties": { - "ping": { - "type": "integer", - "description": "Duration in milliseconds how long the health check took.", - "x-example": 128, - "format": "int32" - }, - "status": { - "type": "string", - "description": "Service status. Possible values can are: `pass`, `fail`", - "x-example": "pass" - } - }, - "required": ["ping", "status"] - }, - "healthTime": { - "description": "Health Time", - "type": "object", - "properties": { - "remoteTime": { - "type": "integer", - "description": "Current unix timestamp on trustful remote server.", - "x-example": 1639490751, - "format": "int32" - }, - "localTime": { - "type": "integer", - "description": "Current unix timestamp of local server where Appwrite runs.", - "x-example": 1639490844, - "format": "int32" - }, - "diff": { - "type": "integer", - "description": "Difference of unix remote and local timestamps in milliseconds.", - "x-example": 93, - "format": "int32" - } - }, - "required": ["remoteTime", "localTime", "diff"] - }, - "metric": { - "description": "Metric", - "type": "object", - "properties": { - "value": { - "type": "integer", - "description": "The value of this metric at the timestamp.", - "x-example": 1, - "format": "int32" - }, - "timestamp": { - "type": "integer", - "description": "The UNIX timestamp at which this metric was aggregated.", - "x-example": 1592981250, - "format": "int32" - } - }, - "required": ["value", "timestamp"] - }, - "usageDatabase": { - "description": "UsageDatabase", - "type": "object", - "properties": { - "range": { - "type": "string", - "description": "The time range of the usage stats.", - "x-example": "30d" - }, - "documentsCount": { - "type": "array", - "description": "Aggregated stats for total number of documents.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "collectionsCount": { - "type": "array", - "description": "Aggregated stats for total number of collections.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "documentsCreate": { - "type": "array", - "description": "Aggregated stats for documents created.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "documentsRead": { - "type": "array", - "description": "Aggregated stats for documents read.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "documentsUpdate": { - "type": "array", - "description": "Aggregated stats for documents updated.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "documentsDelete": { - "type": "array", - "description": "Aggregated stats for documents deleted.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "collectionsCreate": { - "type": "array", - "description": "Aggregated stats for collections created.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "collectionsRead": { - "type": "array", - "description": "Aggregated stats for collections read.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "collectionsUpdate": { - "type": "array", - "description": "Aggregated stats for collections updated.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "collectionsDelete": { - "type": "array", - "description": "Aggregated stats for collections delete.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - } - }, - "required": [ - "range", - "documentsCount", - "collectionsCount", - "documentsCreate", - "documentsRead", - "documentsUpdate", - "documentsDelete", - "collectionsCreate", - "collectionsRead", - "collectionsUpdate", - "collectionsDelete" - ] - }, - "usageCollection": { - "description": "UsageCollection", - "type": "object", - "properties": { - "range": { - "type": "string", - "description": "The time range of the usage stats.", - "x-example": "30d" - }, - "documentsCount": { - "type": "array", - "description": "Aggregated stats for total number of documents.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "documentsCreate": { - "type": "array", - "description": "Aggregated stats for documents created.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "documentsRead": { - "type": "array", - "description": "Aggregated stats for documents read.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "documentsUpdate": { - "type": "array", - "description": "Aggregated stats for documents updated.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "documentsDelete": { - "type": "array", - "description": "Aggregated stats for documents deleted.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - } - }, - "required": [ - "range", - "documentsCount", - "documentsCreate", - "documentsRead", - "documentsUpdate", - "documentsDelete" - ] - }, - "usageUsers": { - "description": "UsageUsers", - "type": "object", - "properties": { - "range": { - "type": "string", - "description": "The time range of the usage stats.", - "x-example": "30d" - }, - "usersCount": { - "type": "array", - "description": "Aggregated stats for total number of users.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "usersCreate": { - "type": "array", - "description": "Aggregated stats for users created.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "usersRead": { - "type": "array", - "description": "Aggregated stats for users read.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "usersUpdate": { - "type": "array", - "description": "Aggregated stats for users updated.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "usersDelete": { - "type": "array", - "description": "Aggregated stats for users deleted.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "sessionsCreate": { - "type": "array", - "description": "Aggregated stats for sessions created.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "sessionsProviderCreate": { - "type": "array", - "description": "Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "sessionsDelete": { - "type": "array", - "description": "Aggregated stats for sessions deleted.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - } - }, - "required": [ - "range", - "usersCount", - "usersCreate", - "usersRead", - "usersUpdate", - "usersDelete", - "sessionsCreate", - "sessionsProviderCreate", - "sessionsDelete" - ] - }, - "usageStorage": { - "description": "StorageUsage", - "type": "object", - "properties": { - "range": { - "type": "string", - "description": "The time range of the usage stats.", - "x-example": "30d" - }, - "filesStorage": { - "type": "array", - "description": "Aggregated stats for the occupied storage size by files (in bytes).", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "tagsStorage": { - "type": "array", - "description": "Aggregated stats for the occupied storage size by tags (in bytes).", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "filesCount": { - "type": "array", - "description": "Aggregated stats for total number of files.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "bucketsCount": { - "type": "array", - "description": "Aggregated stats for total number of buckets.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "bucketsCreate": { - "type": "array", - "description": "Aggregated stats for buckets created.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "bucketsRead": { - "type": "array", - "description": "Aggregated stats for buckets read.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "bucketsUpdate": { - "type": "array", - "description": "Aggregated stats for buckets updated.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "bucketsDelete": { - "type": "array", - "description": "Aggregated stats for buckets deleted.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "filesCreate": { - "type": "array", - "description": "Aggregated stats for files created.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "filesRead": { - "type": "array", - "description": "Aggregated stats for files read.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "filesUpdate": { - "type": "array", - "description": "Aggregated stats for files updated.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "filesDelete": { - "type": "array", - "description": "Aggregated stats for files deleted.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - } - }, - "required": [ - "range", - "filesStorage", - "tagsStorage", - "filesCount", - "bucketsCount", - "bucketsCreate", - "bucketsRead", - "bucketsUpdate", - "bucketsDelete", - "filesCreate", - "filesRead", - "filesUpdate", - "filesDelete" - ] - }, - "usageBuckets": { - "description": "UsageBuckets", - "type": "object", - "properties": { - "range": { - "type": "string", - "description": "The time range of the usage stats.", - "x-example": "30d" - }, - "filesCount": { - "type": "array", - "description": "Aggregated stats for total number of files in this bucket.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "filesStorage": { - "type": "array", - "description": "Aggregated stats for total storage of files in this bucket.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "filesCreate": { - "type": "array", - "description": "Aggregated stats for files created.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "filesRead": { - "type": "array", - "description": "Aggregated stats for files read.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "filesUpdate": { - "type": "array", - "description": "Aggregated stats for files updated.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "filesDelete": { - "type": "array", - "description": "Aggregated stats for files deleted.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - } - }, - "required": [ - "range", - "filesCount", - "filesStorage", - "filesCreate", - "filesRead", - "filesUpdate", - "filesDelete" - ] - }, - "usageFunctions": { - "description": "UsageFunctions", - "type": "object", - "properties": { - "range": { - "type": "string", - "description": "The time range of the usage stats.", - "x-example": "30d" - }, - "functionsExecutions": { - "type": "array", - "description": "Aggregated stats for function executions.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "functionsFailures": { - "type": "array", - "description": "Aggregated stats for function execution failures.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "functionsCompute": { - "type": "array", - "description": "Aggregated stats for function execution duration.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - } - }, - "required": [ - "range", - "functionsExecutions", - "functionsFailures", - "functionsCompute" - ] - }, - "usageProject": { - "description": "UsageProject", - "type": "object", - "properties": { - "range": { - "type": "string", - "description": "The time range of the usage stats.", - "x-example": "30d" - }, - "requests": { - "type": "array", - "description": "Aggregated stats for number of requests.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "network": { - "type": "array", - "description": "Aggregated stats for consumed bandwidth.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "functions": { - "type": "array", - "description": "Aggregated stats for function executions.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "documents": { - "type": "array", - "description": "Aggregated stats for number of documents.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "collections": { - "type": "array", - "description": "Aggregated stats for number of collections.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "users": { - "type": "array", - "description": "Aggregated stats for number of users.", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - }, - "storage": { - "type": "array", - "description": "Aggregated stats for the occupied storage size (in bytes).", - "items": { "type": "object", "$ref": "#/definitions/metricList" }, - "x-example": {} - } - }, - "required": [ - "range", - "requests", - "network", - "functions", - "documents", - "collections", - "users", - "storage" - ] - } - }, - "externalDocs": { - "description": "Full API docs, specs and tutorials", - "url": "https://appwrite.io/docs" - } -} diff --git a/specs/swagger2-latest-console.json b/specs/swagger2-latest-console.json new file mode 100644 index 0000000000..7c667134d2 --- /dev/null +++ b/specs/swagger2-latest-console.json @@ -0,0 +1 @@ +{"swagger":"2.0","info":{"version":"0.13.4","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@appwrite.io"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"HOSTNAME","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":47,"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":37,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete 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":56,"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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":54,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":46,"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:{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":50,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":52,"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, Team Invites and Magic URL, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":53,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 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":48,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":55,"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":{},"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":60,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":61,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":49,"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":38,"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 at least 8 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":59,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":45,"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\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":43,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":44,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":39,"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, notion, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, zoom, yahoo, yammer, yandex, wordpress, stripe.","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":"","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":"","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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":51,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to \"refresh\" the access token.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":58,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":57,"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 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":62,"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},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":63,"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 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 [GET \/account\/sessions](\/docs\/client\/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":65,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":64,"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":68,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":66,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":67,"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. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":70,"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.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":69,"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 1 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":1,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/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":72,"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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":71,"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":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[COLLECTION_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/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":73,"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 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":77,"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 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]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name","permission"]}}]},"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":78,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databaseListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":87,"cookies":false,"type":"","demo":"database\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databaseCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a boolean attribute.\n","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":86,"cookies":false,"type":"","demo":"database\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databaseCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an email attribute.\n","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":80,"cookies":false,"type":"","demo":"database\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databaseCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":81,"cookies":false,"type":"","demo":"database\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databaseCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":85,"cookies":false,"type":"","demo":"database\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"number","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"number","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databaseCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":84,"cookies":false,"type":"","demo":"database\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databaseCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create IP address attribute.\n","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":82,"cookies":false,"type":"","demo":"database\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databaseCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a string attribute.\n","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":79,"cookies":false,"type":"","demo":"database\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databaseCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a URL attribute.\n","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":83,"cookies":false,"type":"","demo":"database\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databaseGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":88,"cookies":false,"type":"","demo":"database\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databaseDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":89,"cookies":false,"type":"","demo":"database\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","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":95,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/database#querying-documents).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"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":94,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","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":96,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"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":98,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object. Include only attribute and value pairs to be updated.","default":{},"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":99,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databaseListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the document activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":97,"cookies":false,"type":"","demo":"database\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databaseListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":91,"cookies":false,"type":"","demo":"database\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databaseCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":90,"cookies":false,"type":"","demo":"database\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/database\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databaseGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":92,"cookies":false,"type":"","demo":"database\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databaseDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":93,"cookies":false,"type":"","demo":"database\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/database\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databaseListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":76,"cookies":false,"type":"","demo":"database\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databaseGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getUsage","weight":74,"cookies":false,"type":"","demo":"database\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/database\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databaseGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":75,"cookies":false,"type":"","demo":"database\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_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":193,"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":"Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":192,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[FUNCTION_ID]"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","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":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List runtimes","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active on your instance.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":194,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":195,"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 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":197,"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 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](https:\/\/appwrite.io\/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 that will be passed to the function as environment variables.","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":"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":199,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments":{"get":{"summary":"List Deployments","operationId":"functionsListDeployments","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code deployments. You can use the query params to filter your results.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"listDeployments","weight":201,"cookies":false,"type":"","demo":"functions\/list-deployments.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-deployments.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 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":"Maximum number of deployments to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 Deployment","operationId":"functionsCreateDeployment","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"createDeployment","weight":200,"cookies":false,"type":"","demo":"functions\/create-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"entrypoint","description":"Entrypoint File.","required":true,"type":"string","x-example":"[ENTRYPOINT]","in":"formData"},{"name":"code","description":"Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.","required":true,"type":"file","in":"formData"},{"name":"activate","description":"Automatically activate the deployment when it is finished building.","required":true,"type":"boolean","x-example":false,"in":"formData"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}":{"get":{"summary":"Get Deployment","operationId":"functionsGetDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code deployment by its unique ID.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"getDeployment","weight":202,"cookies":false,"type":"","demo":"functions\/get-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"patch":{"summary":"Update Function Deployment","operationId":"functionsUpdateDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateDeployment","weight":198,"cookies":false,"type":"","demo":"functions\/update-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"delete":{"summary":"Delete Deployment","operationId":"functionsDeleteDeployment","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code deployment by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDeployment","weight":203,"cookies":false,"type":"","demo":"functions\/delete-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":207,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":205,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":204,"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 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]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":206,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":196,"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 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":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":107,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":117,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":110,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":109,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":114,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":115,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":113,"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\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":112,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":116,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":111,"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":100,"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":104,"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":101,"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":102,"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":103,"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":105,"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":106,"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":120,"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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":119,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[PROJECT_ID]"},"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":["projectId","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":121,"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":123,"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":128,"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 at least 8 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":126,"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":"integer","description":"Set the max number of users allowed in this project. Use 0 for unlimited.","default":null,"x-example":0}},"required":["limit"]}}]}},"\/projects\/{projectId}\/auth\/{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":127,"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,magic-url,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":145,"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":144,"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":146,"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":148,"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":147,"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":135,"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":134,"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":136,"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":137,"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":138,"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":125,"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":140,"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":139,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":"[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":141,"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":142,"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":143,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":124,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":122,"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":130,"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":129,"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":131,"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":132,"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":133,"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\/buckets":{"get":{"summary":"List buckets","operationId":"storageListBuckets","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the storage buckets. You can use the query params to filter your results.","responses":{"200":{"description":"Buckets List","schema":{"$ref":"#\/definitions\/bucketList"}}},"x-appwrite":{"method":"listBuckets","weight":150,"cookies":false,"type":"","demo":"storage\/list-buckets.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"cursor","description":"ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 bucket","operationId":"storageCreateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new storage bucket.","responses":{"201":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"createBucket","weight":149,"cookies":false,"type":"","demo":"storage\/create-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"bucketId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[BUCKET_ID]"},"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":30000000,"x-example":null},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["bucketId","name","permission"]}}]}},"\/storage\/buckets\/{bucketId}":{"get":{"summary":"Get Bucket","operationId":"storageGetBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"getBucket","weight":151,"cookies":false,"type":"","demo":"storage\/get-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]},"put":{"summary":"Update Bucket","operationId":"storageUpdateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a storage bucket by its unique ID.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"updateBucket","weight":152,"cookies":false,"type":"","demo":"storage\/update-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":null,"x-example":null},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Bucket","operationId":"storageDeleteBucket","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a storage bucket by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteBucket","weight":153,"cookies":false,"type":"","demo":"storage\/delete-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["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":155,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":154,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/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":156,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":160,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":161,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":158,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":157,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":159,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":162,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":163,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":165,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":164,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":166,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":167,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":168,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/logs":{"get":{"summary":"List Team Logs","operationId":"teamsListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get the team activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":175,"cookies":false,"type":"","demo":"teams\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":170,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":169,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":171,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":172,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). 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":174,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":173,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":177,"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":"Maximum number of users to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":176,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":191,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":178,"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 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":190,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":186,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":181,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":184,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":185,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/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":179,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"usersUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":187,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":180,"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 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":189,"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 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":188,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":182,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateVerification","weight":183,"cookies":false,"type":"","demo":"users\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}}},"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":{"documentList":{"description":"Documents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of documents documents that matched your query.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["total","documents"]},"collectionList":{"description":"Collections List","type":"object","properties":{"total":{"type":"integer","description":"Total number of collections documents that matched your query.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["total","collections"]},"indexList":{"description":"Indexes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of indexes documents that matched your query.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["total","indexes"]},"userList":{"description":"Users List","type":"object","properties":{"total":{"type":"integer","description":"Total number of users documents that matched your query.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["total","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of sessions documents that matched your query.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["total","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"total":{"type":"integer","description":"Total number of logs documents that matched your query.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["total","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"total":{"type":"integer","description":"Total number of files documents that matched your query.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["total","files"]},"bucketList":{"description":"Buckets List","type":"object","properties":{"total":{"type":"integer","description":"Total number of buckets documents that matched your query.","x-example":5,"format":"int32"},"buckets":{"type":"array","description":"List of buckets.","items":{"type":"object","$ref":"#\/definitions\/bucket"},"x-example":""}},"required":["total","buckets"]},"teamList":{"description":"Teams List","type":"object","properties":{"total":{"type":"integer","description":"Total number of teams documents that matched your query.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["total","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"total":{"type":"integer","description":"Total number of memberships documents that matched your query.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["total","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of functions documents that matched your query.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["total","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of runtimes documents that matched your query.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["total","runtimes"]},"deploymentList":{"description":"Deployments List","type":"object","properties":{"total":{"type":"integer","description":"Total number of deployments documents that matched your query.","x-example":5,"format":"int32"},"deployments":{"type":"array","description":"List of deployments.","items":{"type":"object","$ref":"#\/definitions\/deployment"},"x-example":""}},"required":["total","deployments"]},"executionList":{"description":"Executions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of executions documents that matched your query.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["total","executions"]},"projectList":{"description":"Projects List","type":"object","properties":{"total":{"type":"integer","description":"Total number of projects documents that matched your query.","x-example":5,"format":"int32"},"projects":{"type":"array","description":"List of projects.","items":{"type":"object","$ref":"#\/definitions\/project"},"x-example":""}},"required":["total","projects"]},"webhookList":{"description":"Webhooks List","type":"object","properties":{"total":{"type":"integer","description":"Total number of webhooks documents that matched your query.","x-example":5,"format":"int32"},"webhooks":{"type":"array","description":"List of webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"},"x-example":""}},"required":["total","webhooks"]},"keyList":{"description":"API Keys List","type":"object","properties":{"total":{"type":"integer","description":"Total number of keys documents that matched your query.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["total","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"total":{"type":"integer","description":"Total number of platforms documents that matched your query.","x-example":5,"format":"int32"},"platforms":{"type":"array","description":"List of platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"},"x-example":""}},"required":["total","platforms"]},"domainList":{"description":"Domains List","type":"object","properties":{"total":{"type":"integer","description":"Total number of domains documents that matched your query.","x-example":5,"format":"int32"},"domains":{"type":"array","description":"List of domains.","items":{"type":"object","$ref":"#\/definitions\/domain"},"x-example":""}},"required":["total","domains"]},"countryList":{"description":"Countries List","type":"object","properties":{"total":{"type":"integer","description":"Total number of countries documents that matched your query.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["total","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of continents documents that matched your query.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["total","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"total":{"type":"integer","description":"Total number of languages documents that matched your query.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["total","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"total":{"type":"integer","description":"Total number of currencies documents that matched your query.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["total","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"total":{"type":"integer","description":"Total number of phones documents that matched your query.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["total","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"total":{"type":"integer","description":"Total number of metrics documents that matched your query.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["total","metrics"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$read","$write","name","enabled","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of attributes in the given collection.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["total","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"integer","description":"Attribute size.","x-example":128,"format":"int32"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"count"},"type":{"type":"string","description":"Attribute type.","x-example":"integer"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"percentageCompleted"},"type":{"type":"string","description":"Attribute type.","x-example":"double"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"isEnabled"},"type":{"type":"string","description":"Attribute type.","x-example":"boolean"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"userEmail"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"status"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"ipAddress"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"githubUrl"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":"primary"},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"integer","description":"Date, the Unix timestamp of when the access token expires.","x-example":1592981250,"format":"int32"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"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"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$read","$write","name","dateCreated","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"bucket":{"description":"Bucket","type":"object","properties":{"$id":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":["role:all"]},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":["user:608f9da25e7e1"]},"permission":{"type":"string","description":"Bucket permission model. Possible values: `bucket` or `file`","x-example":"file"},"dateCreated":{"type":"integer","description":"Bucket creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Bucket update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Bucket name.","x-example":"Documents"},"enabled":{"type":"boolean","description":"Bucket enabled.","x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size supported.","x-example":100,"format":"int32"},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions.","items":{"type":"string"},"x-example":["jpg","png"]},"encryption":{"type":"boolean","description":"Bucket is encrypted.","x-example":false},"antivirus":{"type":"boolean","description":"Virus scanning is enabled.","x-example":false}},"required":["$id","$read","$write","permission","dateCreated","dateUpdated","name","enabled","maximumFileSize","allowedFileExtensions","encryption","antivirus"]},"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"},"total":{"type":"integer","description":"Total number of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","total"]},"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"},"execute":{"type":"array","description":"Execution permissions.","items":{"type":"string"},"x-example":"role:member"},"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"},"runtime":{"type":"string","description":"Function execution runtime.","x-example":"python-3.8"},"deployment":{"type":"string","description":"Function's active deployment ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"object","additionalProperties":true,"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","execute","name","dateCreated","dateUpdated","status","runtime","deployment","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"deployment":{"description":"Deployment","type":"object","properties":{"$id":{"type":"string","description":"Deployment ID.","x-example":"5e5ea5c16897e"},"resourceId":{"type":"string","description":"Resource ID.","x-example":"5e5ea6g16897e"},"resourceType":{"type":"string","description":"Resource type.","x-example":"functions"},"dateCreated":{"type":"integer","description":"The deployment creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"entrypoint":{"type":"string","description":"The entrypoint file to use to execute the deployment code.","x-example":"enabled"},"size":{"type":"integer","description":"The code size in bytes.","x-example":128,"format":"int32"},"buildId":{"type":"string","description":"The current build ID.","x-example":"5e5ea5c16897e"},"activate":{"type":"boolean","description":"Whether the deployment should be automatically activated.","x-example":true},"status":{"type":"string","description":"The deployment status.","x-example":"enabled"},"buildStdout":{"type":"string","description":"The build stdout.","x-example":"enabled"},"buildStderr":{"type":"string","description":"The build stderr.","x-example":"enabled"}},"required":["$id","resourceId","resourceType","dateCreated","entrypoint","size","buildId","activate","status","buildStdout","buildStderr"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"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"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$read","functionId","dateCreated","trigger","status","statusCode","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"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerNotionAppid":{"type":"string","description":"Notion OAuth app ID.","x-example":"123247283472834787438"},"providerNotionSecret":{"type":"string","description":"Notion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerVkAppid":{"type":"string","description":"VK OAuth app ID.","x-example":"123247283472834787438"},"providerVkSecret":{"type":"string","description":"VK OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerZoomAppid":{"type":"string","description":"Zoom OAuth app ID.","x-example":"123247283472834787438"},"providerZoomSecret":{"type":"string","description":"Zoom OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYammerAppid":{"type":"string","description":"Yammer OAuth app ID.","x-example":"123247283472834787438"},"providerYammerSecret":{"type":"string","description":"Yammer OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerStripeAppid":{"type":"string","description":"Stripe OAuth app ID.","x-example":"123247283472834787438"},"providerStripeSecret":{"type":"string","description":"Stripe OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabase":{"type":"boolean","description":"Database service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDiscordAppid","providerDiscordSecret","providerDropboxAppid","providerDropboxSecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerNotionAppid","providerNotionSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerVkAppid","providerVkSecret","providerZoomAppid","providerZoomSecret","providerYahooAppid","providerYahooSecret","providerYammerAppid","providerYammerSecret","providerYandexAppid","providerYandexSecret","providerWordpressAppid","providerWordpressSecret","providerStripeAppid","providerStripeSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabase","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"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"]},"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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]},"metric":{"description":"Metric","type":"object","properties":{"value":{"type":"integer","description":"The value of this metric at the timestamp.","x-example":1,"format":"int32"},"timestamp":{"type":"integer","description":"The UNIX timestamp at which this metric was aggregated.","x-example":1592981250,"format":"int32"}},"required":["value","timestamp"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by files (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"tagsStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by tags (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCount":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCount":{"type":"array","description":"Aggregated stats for total number of buckets.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCreate":{"type":"array","description":"Aggregated stats for buckets created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsRead":{"type":"array","description":"Aggregated stats for buckets read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsUpdate":{"type":"array","description":"Aggregated stats for buckets updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsDelete":{"type":"array","description":"Aggregated stats for buckets deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesStorage","tagsStorage","filesCount","bucketsCount","bucketsCreate","bucketsRead","bucketsUpdate","bucketsDelete","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesStorage":{"type":"array","description":"Aggregated stats for total storage of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesStorage","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"functionsExecutions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsFailures":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsCompute":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","functionsExecutions","functionsFailures","functionsCompute"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","functions","documents","collections","users","storage"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file From 8bcd3fa565a050eb5aa8ac0442856e02f41e8d96 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 28 Apr 2022 14:33:08 +1200 Subject: [PATCH 010/555] Rename android/kotlin tests for consistency with other languages --- tests/Android11Java11Test.php | 2 +- tests/Android11Java8Test.php | 2 +- tests/Android12Java11Test.php | 2 +- tests/Android12Java8Test.php | 2 +- tests/Android5Java11Test.php | 2 +- tests/Android5Java8Test.php | 2 +- tests/KotlinJava11Test.php | 2 +- tests/KotlinJava17Test.php | 2 +- tests/KotlinJava8Test.php | 2 +- tests/languages/android/{ServiceTest.kt => Tests.kt} | 0 tests/languages/kotlin/{ServiceTest.kt => Tests.kt} | 0 11 files changed, 9 insertions(+), 9 deletions(-) rename tests/languages/android/{ServiceTest.kt => Tests.kt} (100%) rename tests/languages/kotlin/{ServiceTest.kt => Tests.kt} (100%) diff --git a/tests/Android11Java11Test.php b/tests/Android11Java11Test.php index 467bea95f5..e57467e9d9 100644 --- a/tests/Android11Java11Test.php +++ b/tests/Android11Java11Test.php @@ -8,7 +8,7 @@ class Android11Java11Test extends Base protected string $class = 'Appwrite\SDK\Language\Android'; protected array $build = [ 'mkdir -p tests/sdks/android/library/src/test/java', - 'cp tests/languages/android/ServiceTest.kt tests/sdks/android/library/src/test/java/ServiceTest.kt', + 'cp tests/languages/android/Tests.kt tests/sdks/android/library/src/test/java/Tests.kt', 'chmod +x tests/sdks/android/gradlew', ]; protected string $command = diff --git a/tests/Android11Java8Test.php b/tests/Android11Java8Test.php index f11a605d83..49c3f1d451 100644 --- a/tests/Android11Java8Test.php +++ b/tests/Android11Java8Test.php @@ -8,7 +8,7 @@ class Android11Java8Test extends Base protected string $class = 'Appwrite\SDK\Language\Android'; protected array $build = [ 'mkdir -p tests/sdks/android/library/src/test/java', - 'cp tests/languages/android/ServiceTest.kt tests/sdks/android/library/src/test/java/ServiceTest.kt', + 'cp tests/languages/android/Tests.kt tests/sdks/android/library/src/test/java/Tests.kt', 'chmod +x tests/sdks/android/gradlew', ]; protected string $command = diff --git a/tests/Android12Java11Test.php b/tests/Android12Java11Test.php index 6a98a1ba9d..3ac9d8c721 100644 --- a/tests/Android12Java11Test.php +++ b/tests/Android12Java11Test.php @@ -8,7 +8,7 @@ class Android12Java11Test extends Base protected string $class = 'Appwrite\SDK\Language\Android'; protected array $build = [ 'mkdir -p tests/sdks/android/library/src/test/java', - 'cp tests/languages/android/ServiceTest.kt tests/sdks/android/library/src/test/java/ServiceTest.kt', + 'cp tests/languages/android/Tests.kt tests/sdks/android/library/src/test/java/Tests.kt', 'chmod +x tests/sdks/android/gradlew', ]; protected string $command = diff --git a/tests/Android12Java8Test.php b/tests/Android12Java8Test.php index c701349e7a..e6fe729b96 100644 --- a/tests/Android12Java8Test.php +++ b/tests/Android12Java8Test.php @@ -8,7 +8,7 @@ class Android12Java8Test extends Base protected string $class = 'Appwrite\SDK\Language\Android'; protected array $build = [ 'mkdir -p tests/sdks/android/library/src/test/java', - 'cp tests/languages/android/ServiceTest.kt tests/sdks/android/library/src/test/java/ServiceTest.kt', + 'cp tests/languages/android/Tests.kt tests/sdks/android/library/src/test/java/Tests.kt', 'chmod +x tests/sdks/android/gradlew', ]; protected string $command = diff --git a/tests/Android5Java11Test.php b/tests/Android5Java11Test.php index e717558e00..a5808c9f8b 100644 --- a/tests/Android5Java11Test.php +++ b/tests/Android5Java11Test.php @@ -8,7 +8,7 @@ class Android5Java11Test extends Base protected string $class = 'Appwrite\SDK\Language\Android'; protected array $build = [ 'mkdir -p tests/sdks/android/library/src/test/java', - 'cp tests/languages/android/ServiceTest.kt tests/sdks/android/library/src/test/java/ServiceTest.kt', + 'cp tests/languages/android/Tests.kt tests/sdks/android/library/src/test/java/Tests.kt', 'chmod +x tests/sdks/android/gradlew', ]; protected string $command = diff --git a/tests/Android5Java8Test.php b/tests/Android5Java8Test.php index beda628792..b58abb4a00 100644 --- a/tests/Android5Java8Test.php +++ b/tests/Android5Java8Test.php @@ -8,7 +8,7 @@ class Android5Java8Test extends Base protected string $class = 'Appwrite\SDK\Language\Android'; protected array $build = [ 'mkdir -p tests/sdks/android/library/src/test/java', - 'cp tests/languages/android/ServiceTest.kt tests/sdks/android/library/src/test/java/ServiceTest.kt', + 'cp tests/languages/android/Tests.kt tests/sdks/android/library/src/test/java/Tests.kt', 'chmod +x tests/sdks/android/gradlew', ]; protected string $command = diff --git a/tests/KotlinJava11Test.php b/tests/KotlinJava11Test.php index 04e9347b6a..0ef12db6c6 100644 --- a/tests/KotlinJava11Test.php +++ b/tests/KotlinJava11Test.php @@ -8,7 +8,7 @@ class KotlinJava11Test extends Base protected string $class = 'Appwrite\SDK\Language\Kotlin'; protected array $build = [ 'mkdir -p tests/sdks/kotlin/src/test/kotlin', - 'cp tests/languages/kotlin/ServiceTest.kt tests/sdks/kotlin/src/test/kotlin/ServiceTest.kt', + 'cp tests/languages/kotlin/Tests.kt tests/sdks/kotlin/src/test/kotlin/Tests.kt', 'chmod +x tests/sdks/kotlin/gradlew', ]; protected string $command = diff --git a/tests/KotlinJava17Test.php b/tests/KotlinJava17Test.php index 332d6068b9..3e8d600b65 100644 --- a/tests/KotlinJava17Test.php +++ b/tests/KotlinJava17Test.php @@ -8,7 +8,7 @@ class KotlinJava17Test extends Base protected string $class = 'Appwrite\SDK\Language\Kotlin'; protected array $build = [ 'mkdir -p tests/sdks/kotlin/src/test/kotlin', - 'cp tests/languages/kotlin/ServiceTest.kt tests/sdks/kotlin/src/test/kotlin/ServiceTest.kt', + 'cp tests/languages/kotlin/Tests.kt tests/sdks/kotlin/src/test/kotlin/Tests.kt', 'chmod +x tests/sdks/kotlin/gradlew', ]; protected string $command = diff --git a/tests/KotlinJava8Test.php b/tests/KotlinJava8Test.php index 7379fd01cc..7167389e14 100644 --- a/tests/KotlinJava8Test.php +++ b/tests/KotlinJava8Test.php @@ -8,7 +8,7 @@ class KotlinJava8Test extends Base protected string $class = 'Appwrite\SDK\Language\Kotlin'; protected array $build = [ 'mkdir -p tests/sdks/kotlin/src/test/kotlin', - 'cp tests/languages/kotlin/ServiceTest.kt tests/sdks/kotlin/src/test/kotlin/ServiceTest.kt', + 'cp tests/languages/kotlin/Tests.kt tests/sdks/kotlin/src/test/kotlin/Tests.kt', 'chmod +x tests/sdks/kotlin/gradlew', ]; protected string $command = diff --git a/tests/languages/android/ServiceTest.kt b/tests/languages/android/Tests.kt similarity index 100% rename from tests/languages/android/ServiceTest.kt rename to tests/languages/android/Tests.kt diff --git a/tests/languages/kotlin/ServiceTest.kt b/tests/languages/kotlin/Tests.kt similarity index 100% rename from tests/languages/kotlin/ServiceTest.kt rename to tests/languages/kotlin/Tests.kt From 21f74b5496a6701716c4ee80b9cb06e51cec79ab Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 5 May 2022 15:26:00 +1200 Subject: [PATCH 011/555] Collect body bytes --- templates/swift/Sources/Client.swift.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index f489f4b63f..4c76251999 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -285,7 +285,7 @@ open class Client { case is Bool.Type: return true as! T case is ByteBuffer.Type: - return response.body as! T + return try await response.body.collect(upTo: Int.max) as! T default: let data = try await response.body.collect(upTo: Int.max) let dict = try JSONSerialization.jsonObject(with: data) as? [String: Any] From 0810b84c3331952076a0c31c0d693ff33ba5c7be Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 9 May 2022 10:54:27 +0100 Subject: [PATCH 012/555] Merge Matej's Changes into my changes --- templates/cli/lib/commands/init.js.twig | 84 +++++++++++++------------ 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index dced6fc551..9f059dc199 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -54,9 +54,17 @@ const initProject = async () => { } const initFunction = async () => { - let answers = await inquirer.prompt(questionsInitFunction) + let answers = await inquirer.prompt(questionsInitFunction); - if (fs.existsSync(path.join(process.cwd(), 'functions', answers.name))) { + if (!fs.existsSync(path.join(process.cwd(), 'functions'))) { + fs.mkdirSync(path.join(process.cwd(), 'functions'), { + recursive: true + }); + } + + const functionDir = path.join(process.cwd(), 'functions', answers.name); + + if (fs.existsSync(functionDir)) { throw new Error(`( ${answers.name} ) already exists in the current directory. Please choose another name.`); } @@ -71,53 +79,47 @@ const initFunction = async () => { parseOutput: false }) - let initFirstCommand = ` - cd '${answers.name}' && \ - git init && \ - git remote add -f origin https://github.com/{{ sdk.gitUserName }}/functions-starter && \ - git config core.sparseCheckout true`; + fs.mkdirSync(functionDir, "777"); - let initSecondCommand = ` - cd '${answers.name}' && \ - git pull origin dev && \ - git checkout dev`; + const gitInitCommands = + `git init && ` + + `git remote add -f origin https://github.com/{{ sdk.gitUserName }}/functions-starter && ` + + `git config core.sparseCheckout true`; - // Convert commands from unix based ones to windows based ones + const gitPullCommands = `git pull origin main`; + + // Force use CMD as powershell does not support && if (process.platform == 'win32') { - initFirstCommand = initFirstCommand.replace(/'/g, '"').replace(/\\/g, '').replace(/\n/g, '').replace(/ +/g, ' '); - initFirstCommand = 'cmd /c "' + initFirstCommand + '"'; - initSecondCommand = initSecondCommand.replace(/'/g, '"').replace(/\\/g, '').replace(/\n/g, '').replace(/ +/g, ' '); - initSecondCommand = 'cmd /c "' + initSecondCommand + '"'; + gitInitCommands = 'cmd /c "' + gitInitCommands + '"'; + gitPullCommands = 'cmd /c "' + gitPullCommands + '"'; } - fs.mkdirSync(answers.name, { recursive: true }); - fs.chmodSync(answers.name, 0o777); - // Execute the child process but do not print any std output - childProcess.execSync(initFirstCommand, { stdio: 'pipe' }); - - fs.writeFileSync(`${answers.name}/.git/info/sparse-checkout`, answers.runtime.id); - - childProcess.execSync(initSecondCommand, { stdio: 'pipe' }); - - fs.rmSync(`${answers.name}/.git`, { recursive: true, force: true }); - - // Copy files - function copyFolderSync(from, to) { - if (!fs.existsSync(to)) { - fs.mkdirSync(to, { recursive: true }); + childProcess.execSync(gitInitCommands, { stdio: 'pipe' }); + + fs.writeFileSync(path.join(functionDir, ".git/info/sparse-checkout"), `${answers.runtime.id}`); + + childProcess.execSync(gitPullCommands, { stdio: 'pipe' }); + + fs.rmSync(path.join(functionDir, ".git"), { recursive: true }); + const copyRecursiveSync = (src, dest) => { + let exists = fs.existsSync(src); + let stats = exists && fs.statSync(src); + let isDirectory = exists && stats.isDirectory(); + if (isDirectory) { + if (!fs.existsSync(dest)) { + fs.mkdirSync(dest); + } + + fs.readdirSync(src).forEach(function(childItemName) { + copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName)); + }); + } else { + fs.copyFileSync(src, dest); } + }; + copyRecursiveSync(path.join(functionDir, answers.runtime.id), functionDir); - fs.readdirSync(from).forEach(element => { - if (fs.lstatSync(path.join(from, element)).isFile()) { - fs.copyFileSync(path.join(from, element), path.join(to, element)); - } else { - copyFolderSync(path.join(from, element), path.join(to, element)); - } - }); -} - - copyFolderSync(`./${answers.name}/${answers.runtime.id}`, `./${answers.name}/`); fs.rmSync(`./${answers.name}/${answers.runtime.id}`, { recursive: true, force: true }); const readmePath = path.join(process.cwd(), 'functions', answers.name, 'README.md'); From aef15ad3754b796db7df45a781c4e3e0609f6f06 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 9 May 2022 13:14:29 +0000 Subject: [PATCH 013/555] input file factory contstructors --- templates/dart/lib/src/input_file.dart.twig | 12 ++++++++++-- templates/flutter/lib/src/input_file.dart.twig | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/templates/dart/lib/src/input_file.dart.twig b/templates/dart/lib/src/input_file.dart.twig index 1b85e4ba84..a2abcabd17 100644 --- a/templates/dart/lib/src/input_file.dart.twig +++ b/templates/dart/lib/src/input_file.dart.twig @@ -1,9 +1,17 @@ -import 'package:http/http.dart' show MultipartFile; +import 'package:http/http.dart' show MultipartFile, encoding; class InputFile { final MultipartFile? file; final String? path; final String? filename; + final List? bytes; + final String? contentType; + + InputFile({this.path, this.filename, @deprecated this.file}); + + /// Only for Files below 5 MB in size + InputFile.fromMultipartFile(this.file); + + InputFile.fromBytes(this.bytes, { this.filename, this.contentType }); - InputFile({this.file, this.path, this.filename}); } diff --git a/templates/flutter/lib/src/input_file.dart.twig b/templates/flutter/lib/src/input_file.dart.twig index 1b85e4ba84..a2abcabd17 100644 --- a/templates/flutter/lib/src/input_file.dart.twig +++ b/templates/flutter/lib/src/input_file.dart.twig @@ -1,9 +1,17 @@ -import 'package:http/http.dart' show MultipartFile; +import 'package:http/http.dart' show MultipartFile, encoding; class InputFile { final MultipartFile? file; final String? path; final String? filename; + final List? bytes; + final String? contentType; + + InputFile({this.path, this.filename, @deprecated this.file}); + + /// Only for Files below 5 MB in size + InputFile.fromMultipartFile(this.file); + + InputFile.fromBytes(this.bytes, { this.filename, this.contentType }); - InputFile({this.file, this.path, this.filename}); } From d4133c31e9e21a6af70ace979a6db7a4d0d517fe Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Wed, 11 May 2022 18:03:26 +0000 Subject: [PATCH 014/555] add empty dictionary to Swift SDK examples. --- src/SDK/Language/Swift.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/SDK/Language/Swift.php b/src/SDK/Language/Swift.php index 11c6ca6e65..089bccae25 100644 --- a/src/SDK/Language/Swift.php +++ b/src/SDK/Language/Swift.php @@ -404,6 +404,10 @@ public function getParamExample(array $param) case self::TYPE_ARRAY: $output .= '[]'; break; + case self::TYPE_OBJECT: + $output .= '[:]'; + break; + } } else { @@ -420,6 +424,9 @@ public function getParamExample(array $param) case self::TYPE_STRING: $output .= "\"{$example}\""; break; + case self::TYPE_OBJECT: + $output .= '[:]'; + break; } } From 9d859810b9dbde60316deeb3bc57626c52fc5a84 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 18 May 2022 08:11:43 +0000 Subject: [PATCH 015/555] comments --- templates/dart/lib/src/input_file.dart.twig | 4 +++- templates/flutter/lib/src/input_file.dart.twig | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/dart/lib/src/input_file.dart.twig b/templates/dart/lib/src/input_file.dart.twig index a2abcabd17..a69c81b207 100644 --- a/templates/dart/lib/src/input_file.dart.twig +++ b/templates/dart/lib/src/input_file.dart.twig @@ -7,9 +7,11 @@ class InputFile { final List? bytes; final String? contentType; + /// Type definition for file parameters + /// @deprecated @param file use `InputFile.fromMultipartFile(file)` instead InputFile({this.path, this.filename, @deprecated this.file}); - /// Only for Files below 5 MB in size + /// Use only for Files below 5 MB in size InputFile.fromMultipartFile(this.file); InputFile.fromBytes(this.bytes, { this.filename, this.contentType }); diff --git a/templates/flutter/lib/src/input_file.dart.twig b/templates/flutter/lib/src/input_file.dart.twig index a2abcabd17..a69c81b207 100644 --- a/templates/flutter/lib/src/input_file.dart.twig +++ b/templates/flutter/lib/src/input_file.dart.twig @@ -7,9 +7,11 @@ class InputFile { final List? bytes; final String? contentType; + /// Type definition for file parameters + /// @deprecated @param file use `InputFile.fromMultipartFile(file)` instead InputFile({this.path, this.filename, @deprecated this.file}); - /// Only for Files below 5 MB in size + /// Use only for Files below 5 MB in size InputFile.fromMultipartFile(this.file); InputFile.fromBytes(this.bytes, { this.filename, this.contentType }); From 1ecf4e909baa1afd76d2b081340a14d6ad57b7c9 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 23 May 2022 09:18:27 +0000 Subject: [PATCH 016/555] dart input file improvement --- templates/dart/lib/package.dart.twig | 3 +- templates/dart/lib/services/service.dart.twig | 5 +- .../dart/lib/src/chunked_upload_io.dart.twig | 52 ++++++++++++++----- .../lib/src/chunked_upload_stub.dart.twig | 2 +- templates/dart/lib/src/input_file.dart.twig | 26 +++++----- 5 files changed, 60 insertions(+), 28 deletions(-) diff --git a/templates/dart/lib/package.dart.twig b/templates/dart/lib/package.dart.twig index df3ed39081..2d1a50add1 100644 --- a/templates/dart/lib/package.dart.twig +++ b/templates/dart/lib/package.dart.twig @@ -2,6 +2,7 @@ library {{ language.params.packageName }}; import 'dart:async'; import 'dart:typed_data'; +import 'package:http/http.dart' show MultipartFile; import 'src/chunked_upload_stub.dart' if (dart.library.io) 'src/chunked_upload_io.dart'; import 'src/enums.dart'; @@ -10,13 +11,13 @@ import 'src/service.dart'; import 'src/input_file.dart'; import 'src/upload_progress.dart'; import 'models.dart' as models; +import 'src/exception.dart'; export 'src/response.dart'; export 'src/client.dart'; export 'src/exception.dart'; export 'src/input_file.dart'; export 'src/upload_progress.dart'; -export 'package:http/http.dart' show MultipartFile; part 'query.dart'; {% for service in spec.services %} diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index 1a5390b2af..063e1b0452 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -56,7 +56,10 @@ class {{ service.name | caseUcfirst }} extends Service { if(identical(0, 0.0)) { {% for parameter in method.parameters.all %} {% if parameter.type == 'file' %} - params['{{ parameter.name }}'] = {{ parameter.name }}.file; + if(file.bytes == null) { + throw {{spec.title | caseUcfirst}}Exception("Bytes must be provided for non IO platforms"); + } + params['{{ parameter.name }}'] = MultipartFile.fromBytes('{{ parameter.name }}', {{ parameter.name }}.bytes!, filename: {{ parameter.name }}.filename); {% endif %} {% endfor %} res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); diff --git a/templates/dart/lib/src/chunked_upload_io.dart.twig b/templates/dart/lib/src/chunked_upload_io.dart.twig index 710b07c35a..a34bf8e384 100644 --- a/templates/dart/lib/src/chunked_upload_io.dart.twig +++ b/templates/dart/lib/src/chunked_upload_io.dart.twig @@ -18,15 +18,32 @@ Future chunkedUpload({ Function(UploadProgress)? onProgress, }) async { InputFile file = params[paramName]; - if (file.path == null) { - throw AppwriteException("File path must be provided for dart:io"); + if (file.path == null && file.bytes == null) { + throw {{spec.title | caseUcfirst}}Exception("File path or bytes must be provided"); + } + + int size = 0; + if (file.bytes != null) { + size = file.bytes!.length; + } + + io.File? iofile; + + if (file.path != null) { + iofile = io.File(file.path!); + size = await iofile.length(); } - io.File iofile = io.File(file.path!); - final size = await iofile.length(); late Response res; if (size <= Client.CHUNK_SIZE) { - params[paramName] = await http.MultipartFile.fromPath(paramName, file.path!, filename: file.filename); + if (file.path != null) { + params[paramName] = await http.MultipartFile.fromPath( + paramName, file.path!, + filename: file.filename); + } else { + params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!, + filename: file.filename); + } return client.call( HttpMethod.post, path: path, @@ -36,7 +53,7 @@ Future chunkedUpload({ } var offset = 0; - if(idParamName.isNotEmpty && params[idParamName] != 'unique()') { + if (idParamName.isNotEmpty && params[idParamName] != 'unique()') { //make a request to check if a file already exists try { res = await client.call( @@ -48,12 +65,21 @@ Future chunkedUpload({ offset = min(size, chunksUploaded * Client.CHUNK_SIZE); } on {{spec.title | caseUcfirst}}Exception catch (_) {} } + + io.RandomAccessFile? raf; // read chunk and upload each chunk - final raf = iofile.openSync(mode: io.FileMode.read); + if (iofile != null) { + raf = await iofile.open(mode: io.FileMode.read); + } while (offset < size) { - raf.setPositionSync(offset); - final chunk = raf.readSync(Client.CHUNK_SIZE); + var chunk; + if (file.bytes != null) { + chunk = file.bytes!.getRange(offset, offset + Client.CHUNK_SIZE - 1); + } else { + raf!.setPositionSync(offset); + chunk = raf.readSync(Client.CHUNK_SIZE); + } params[paramName] = http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); headers['content-range'] = @@ -61,18 +87,18 @@ Future chunkedUpload({ res = await client.call(HttpMethod.post, path: path, headers: headers, params: params); offset += Client.CHUNK_SIZE; - if(offset < size) { + if (offset < size) { headers['x-{{spec.title | caseLower }}-id'] = res.data['\$id']; } final progress = UploadProgress( $id: res.data['\$id'] ?? '', - progress: min(offset-1,size)/size * 100, - sizeUploaded: min(offset-1,size), + progress: min(offset - 1, size) / size * 100, + sizeUploaded: min(offset - 1, size), chunksTotal: res.data['chunksTotal'] ?? 0, chunksUploaded: res.data['chunksUploaded'] ?? 0, ); onProgress?.call(progress); } - raf.close(); + raf?.close(); return res; } diff --git a/templates/dart/lib/src/chunked_upload_stub.dart.twig b/templates/dart/lib/src/chunked_upload_stub.dart.twig index da8e8ca835..94f7b73980 100644 --- a/templates/dart/lib/src/chunked_upload_stub.dart.twig +++ b/templates/dart/lib/src/chunked_upload_stub.dart.twig @@ -11,4 +11,4 @@ Future chunkedUpload({ required Map headers, Function(UploadProgress)? onProgress }) => - throw UnsupportedError('Cannot redirect to url without dart:html'); + throw UnsupportedError('Chunked upload not yet supported in dart:html'); diff --git a/templates/dart/lib/src/input_file.dart.twig b/templates/dart/lib/src/input_file.dart.twig index a69c81b207..b27b10874d 100644 --- a/templates/dart/lib/src/input_file.dart.twig +++ b/templates/dart/lib/src/input_file.dart.twig @@ -1,19 +1,21 @@ -import 'package:http/http.dart' show MultipartFile, encoding; - class InputFile { - final MultipartFile? file; - final String? path; + late final String? path; + late final List? bytes; final String? filename; - final List? bytes; final String? contentType; - /// Type definition for file parameters - /// @deprecated @param file use `InputFile.fromMultipartFile(file)` instead - InputFile({this.path, this.filename, @deprecated this.file}); - - /// Use only for Files below 5 MB in size - InputFile.fromMultipartFile(this.file); + /// Provide a file using path + InputFile({required this.path, this.filename, this.contentType}) { + bytes = null; + } - InputFile.fromBytes(this.bytes, { this.filename, this.contentType }); + InputFile._internal(this.bytes, {this.filename, this.contentType}) { + path = null; + } + /// Provide a file using bytes + factory InputFile.fromBytes( + {required List bytes, String? filename, String? contentType}) { + return InputFile._internal(bytes, filename: filename, contentType: contentType); + } } From 20bc2910cc5f8296787fe521a3b8e880a238d92c Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 23 May 2022 09:22:54 +0000 Subject: [PATCH 017/555] flutter input type improvement --- templates/flutter/lib/package.dart.twig | 3 +- .../flutter/lib/services/service.dart.twig | 5 +- .../lib/src/chunked_upload_io.dart.twig | 52 ++++++++++++++----- .../flutter/lib/src/input_file.dart.twig | 26 +++++----- 4 files changed, 59 insertions(+), 27 deletions(-) diff --git a/templates/flutter/lib/package.dart.twig b/templates/flutter/lib/package.dart.twig index 3828d22586..abbb4d10e5 100644 --- a/templates/flutter/lib/package.dart.twig +++ b/templates/flutter/lib/package.dart.twig @@ -3,6 +3,7 @@ library {{ language.params.packageName }}; import 'dart:async'; import 'dart:typed_data'; import 'package:flutter/foundation.dart'; +import 'package:http/http.dart' show MultipartFile; import 'src/chunked_upload_stub.dart' if (dart.library.io) 'src/chunked_upload_io.dart'; import 'src/enums.dart'; @@ -11,6 +12,7 @@ import 'src/service.dart'; import 'src/input_file.dart'; import 'models.dart' as models; import 'src/upload_progress.dart'; +import 'src/exception.dart'; export 'src/response.dart'; export 'src/client.dart'; @@ -20,7 +22,6 @@ export 'src/upload_progress.dart'; export 'src/realtime_subscription.dart'; export 'src/realtime_message.dart'; export 'src/input_file.dart'; -export 'package:http/http.dart' show MultipartFile; part 'query.dart'; {% for service in spec.services %} diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index 23cc10289a..4188044fa7 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -79,7 +79,10 @@ class {{ service.name | caseUcfirst }} extends Service { if(kIsWeb) { {% for parameter in method.parameters.all %} {% if parameter.type == 'file' %} - params['{{ parameter.name }}'] = {{ parameter.name }}.file; + if(file.bytes == null) { + throw {{spec.title | caseUcfirst}}Exception("Bytes must be provided for non IO platforms"); + } + params['{{ parameter.name }}'] = MultipartFile.fromBytes('{{ parameter.name }}', {{ parameter.name }}.bytes!, filename: {{ parameter.name }}.filename); {% endif %} {% endfor %} res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); diff --git a/templates/flutter/lib/src/chunked_upload_io.dart.twig b/templates/flutter/lib/src/chunked_upload_io.dart.twig index 710b07c35a..a34bf8e384 100644 --- a/templates/flutter/lib/src/chunked_upload_io.dart.twig +++ b/templates/flutter/lib/src/chunked_upload_io.dart.twig @@ -18,15 +18,32 @@ Future chunkedUpload({ Function(UploadProgress)? onProgress, }) async { InputFile file = params[paramName]; - if (file.path == null) { - throw AppwriteException("File path must be provided for dart:io"); + if (file.path == null && file.bytes == null) { + throw {{spec.title | caseUcfirst}}Exception("File path or bytes must be provided"); + } + + int size = 0; + if (file.bytes != null) { + size = file.bytes!.length; + } + + io.File? iofile; + + if (file.path != null) { + iofile = io.File(file.path!); + size = await iofile.length(); } - io.File iofile = io.File(file.path!); - final size = await iofile.length(); late Response res; if (size <= Client.CHUNK_SIZE) { - params[paramName] = await http.MultipartFile.fromPath(paramName, file.path!, filename: file.filename); + if (file.path != null) { + params[paramName] = await http.MultipartFile.fromPath( + paramName, file.path!, + filename: file.filename); + } else { + params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!, + filename: file.filename); + } return client.call( HttpMethod.post, path: path, @@ -36,7 +53,7 @@ Future chunkedUpload({ } var offset = 0; - if(idParamName.isNotEmpty && params[idParamName] != 'unique()') { + if (idParamName.isNotEmpty && params[idParamName] != 'unique()') { //make a request to check if a file already exists try { res = await client.call( @@ -48,12 +65,21 @@ Future chunkedUpload({ offset = min(size, chunksUploaded * Client.CHUNK_SIZE); } on {{spec.title | caseUcfirst}}Exception catch (_) {} } + + io.RandomAccessFile? raf; // read chunk and upload each chunk - final raf = iofile.openSync(mode: io.FileMode.read); + if (iofile != null) { + raf = await iofile.open(mode: io.FileMode.read); + } while (offset < size) { - raf.setPositionSync(offset); - final chunk = raf.readSync(Client.CHUNK_SIZE); + var chunk; + if (file.bytes != null) { + chunk = file.bytes!.getRange(offset, offset + Client.CHUNK_SIZE - 1); + } else { + raf!.setPositionSync(offset); + chunk = raf.readSync(Client.CHUNK_SIZE); + } params[paramName] = http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); headers['content-range'] = @@ -61,18 +87,18 @@ Future chunkedUpload({ res = await client.call(HttpMethod.post, path: path, headers: headers, params: params); offset += Client.CHUNK_SIZE; - if(offset < size) { + if (offset < size) { headers['x-{{spec.title | caseLower }}-id'] = res.data['\$id']; } final progress = UploadProgress( $id: res.data['\$id'] ?? '', - progress: min(offset-1,size)/size * 100, - sizeUploaded: min(offset-1,size), + progress: min(offset - 1, size) / size * 100, + sizeUploaded: min(offset - 1, size), chunksTotal: res.data['chunksTotal'] ?? 0, chunksUploaded: res.data['chunksUploaded'] ?? 0, ); onProgress?.call(progress); } - raf.close(); + raf?.close(); return res; } diff --git a/templates/flutter/lib/src/input_file.dart.twig b/templates/flutter/lib/src/input_file.dart.twig index a69c81b207..b27b10874d 100644 --- a/templates/flutter/lib/src/input_file.dart.twig +++ b/templates/flutter/lib/src/input_file.dart.twig @@ -1,19 +1,21 @@ -import 'package:http/http.dart' show MultipartFile, encoding; - class InputFile { - final MultipartFile? file; - final String? path; + late final String? path; + late final List? bytes; final String? filename; - final List? bytes; final String? contentType; - /// Type definition for file parameters - /// @deprecated @param file use `InputFile.fromMultipartFile(file)` instead - InputFile({this.path, this.filename, @deprecated this.file}); - - /// Use only for Files below 5 MB in size - InputFile.fromMultipartFile(this.file); + /// Provide a file using path + InputFile({required this.path, this.filename, this.contentType}) { + bytes = null; + } - InputFile.fromBytes(this.bytes, { this.filename, this.contentType }); + InputFile._internal(this.bytes, {this.filename, this.contentType}) { + path = null; + } + /// Provide a file using bytes + factory InputFile.fromBytes( + {required List bytes, String? filename, String? contentType}) { + return InputFile._internal(bytes, filename: filename, contentType: contentType); + } } From 8f542751986921e92a266131143c6a73faa33ecd Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 23 May 2022 09:23:01 +0000 Subject: [PATCH 018/555] composer update --- composer.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.lock b/composer.lock index ac22884f93..0befea3c5d 100644 --- a/composer.lock +++ b/composer.lock @@ -296,16 +296,16 @@ }, { "name": "twig/twig", - "version": "v3.3.10", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "8442df056c51b706793adf80a9fd363406dd3674" + "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/8442df056c51b706793adf80a9fd363406dd3674", - "reference": "8442df056c51b706793adf80a9fd363406dd3674", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/e939eae92386b69b49cfa4599dd9bead6bf4a342", + "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342", "shasum": "" }, "require": { @@ -320,7 +320,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -356,7 +356,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.3.10" + "source": "https://github.com/twigphp/Twig/tree/v3.4.1" }, "funding": [ { @@ -368,7 +368,7 @@ "type": "tidelift" } ], - "time": "2022-04-06T06:47:41+00:00" + "time": "2022-05-17T05:48:52+00:00" } ], "packages-dev": [ @@ -3030,5 +3030,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From f0c7c4c7a3c95b1596a0ba79901f4607dca81e86 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 25 May 2022 07:27:28 +0000 Subject: [PATCH 019/555] chunked upload for dart html platforms --- src/SDK/Language/Dart.php | 6 ++ templates/dart/lib/package.dart.twig | 1 + .../lib/src/chunked_upload_browser.dart.twig | 74 +++++++++++++++++++ .../lib/src/chunked_upload_stub.dart.twig | 2 +- 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 templates/dart/lib/src/chunked_upload_browser.dart.twig diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index 5f78f3a7c2..f00fa9468c 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -426,6 +426,12 @@ public function getFiles() 'template' => 'dart/lib/src/chunked_upload_io.dart.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'lib/src/chunked_upload_browser.dart', + 'template' => 'dart/lib/src/chunked_upload_browser.dart.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'lib/src/chunked_upload_stub.dart', diff --git a/templates/dart/lib/package.dart.twig b/templates/dart/lib/package.dart.twig index 2d1a50add1..72844c3000 100644 --- a/templates/dart/lib/package.dart.twig +++ b/templates/dart/lib/package.dart.twig @@ -5,6 +5,7 @@ import 'dart:typed_data'; import 'package:http/http.dart' show MultipartFile; import 'src/chunked_upload_stub.dart' if (dart.library.io) 'src/chunked_upload_io.dart'; + if (dart.library.html) 'src/chunked_upload_browser.dart' import 'src/enums.dart'; import 'src/client.dart'; import 'src/service.dart'; diff --git a/templates/dart/lib/src/chunked_upload_browser.dart.twig b/templates/dart/lib/src/chunked_upload_browser.dart.twig new file mode 100644 index 0000000000..c9c3c4b9e7 --- /dev/null +++ b/templates/dart/lib/src/chunked_upload_browser.dart.twig @@ -0,0 +1,74 @@ +import 'client.dart'; +import 'enums.dart'; +import 'package:http/http.dart' as http; +import 'response.dart'; +import 'dart:math'; +import 'input_file.dart'; +import 'exception.dart'; +import 'upload_progress.dart'; + +Future chunkedUpload({ + required Client client, + required String path, + required Map params, + required String paramName, + required String idParamName, + required Map headers, + Function(UploadProgress)? onProgress, +}) async { + InputFile file = params[paramName]; + if (file.bytes == null) { + throw {{spec.title | caseUcfirst}}Exception("File bytes must be provided"); + } + + int size = file.bytes!.length; + + late Response res; + if (size <= Client.CHUNK_SIZE) { + params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!, filename: file.filename); + return client.call( + HttpMethod.post, + path: path, + params: params, + headers: headers, + ); + } + + var offset = 0; + if (idParamName.isNotEmpty && params[idParamName] != 'unique()') { + //make a request to check if a file already exists + try { + res = await client.call( + HttpMethod.get, + path: path + '/' + params[idParamName], + headers: headers, + ); + final int chunksUploaded = res.data['chunksUploaded'] as int; + offset = min(size, chunksUploaded * Client.CHUNK_SIZE); + } on {{spec.title | caseUcfirst}}Exception catch (_) {} + } + + while (offset < size) { + var chunk; + chunk = file.bytes!.getRange(offset, offset + Client.CHUNK_SIZE - 1); + params[paramName] = + http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); + headers['content-range'] = + 'bytes $offset-${min(((offset + Client.CHUNK_SIZE) - 1), size)}/$size'; + res = await client.call(HttpMethod.post, + path: path, headers: headers, params: params); + offset += Client.CHUNK_SIZE; + if (offset < size) { + headers['x-{{spec.title | caseLower }}-id'] = res.data['\$id']; + } + final progress = UploadProgress( + $id: res.data['\$id'] ?? '', + progress: min(offset - 1, size) / size * 100, + sizeUploaded: min(offset - 1, size), + chunksTotal: res.data['chunksTotal'] ?? 0, + chunksUploaded: res.data['chunksUploaded'] ?? 0, + ); + onProgress?.call(progress); + } + return res; +} diff --git a/templates/dart/lib/src/chunked_upload_stub.dart.twig b/templates/dart/lib/src/chunked_upload_stub.dart.twig index 94f7b73980..46129af35e 100644 --- a/templates/dart/lib/src/chunked_upload_stub.dart.twig +++ b/templates/dart/lib/src/chunked_upload_stub.dart.twig @@ -11,4 +11,4 @@ Future chunkedUpload({ required Map headers, Function(UploadProgress)? onProgress }) => - throw UnsupportedError('Chunked upload not yet supported in dart:html'); + throw UnsupportedError('Chunked upload not yet supported in this platform'); From 5e24d6f4c7281b0f55c154f71a60f27fdfd1a496 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 25 May 2022 07:45:21 +0000 Subject: [PATCH 020/555] fix service dart --- templates/dart/lib/services/service.dart.twig | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index 063e1b0452..ee5f20dc34 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -50,30 +50,17 @@ class {{ service.name | caseUcfirst }} extends Service { {% endfor %} }; - {% if 'multipart/form-data' in method.consumes %} - dynamic res; - if(identical(0, 0.0)) { -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - if(file.bytes == null) { - throw {{spec.title | caseUcfirst}}Exception("Bytes must be provided for non IO platforms"); - } - params['{{ parameter.name }}'] = MultipartFile.fromBytes('{{ parameter.name }}', {{ parameter.name }}.bytes!, filename: {{ parameter.name }}.filename); -{% endif %} -{% endfor %} - res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); - } else { - String idParamName = ''; + String idParamName = ''; {% for parameter in method.parameters.all %} {% if parameter.type == 'file' %} - final paramName = '{{ parameter.name }}'; + final paramName = '{{ parameter.name }}'; {% endif %} {% if parameter.isUploadID %} - idParamName = '{{ parameter.name }}'; + idParamName = '{{ parameter.name }}'; {% endif %} {% endfor %} - res = await chunkedUpload( + final res = await chunkedUpload( client: client, path: path, params: params, @@ -81,8 +68,7 @@ class {{ service.name | caseUcfirst }} extends Service { idParamName: idParamName, headers: headers, onProgress: onProgress, - ); - } + ); {% else %} final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); {% endif %} From cf69de77025ee2ec3b7f268ba6b445f84870816e Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 25 May 2022 07:58:26 +0000 Subject: [PATCH 021/555] flutter web chunked upload support --- src/SDK/Language/Flutter.php | 6 ++ templates/flutter/lib/package.dart.twig | 1 + .../flutter/lib/services/service.dart.twig | 21 +----- .../lib/src/chunked_upload_browser.dart.twig | 74 +++++++++++++++++++ 4 files changed, 85 insertions(+), 17 deletions(-) create mode 100644 templates/flutter/lib/src/chunked_upload_browser.dart.twig diff --git a/src/SDK/Language/Flutter.php b/src/SDK/Language/Flutter.php index 30186331b3..08afd70de3 100644 --- a/src/SDK/Language/Flutter.php +++ b/src/SDK/Language/Flutter.php @@ -283,6 +283,12 @@ public function getFiles() 'template' => 'flutter/lib/src/chunked_upload_io.dart.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'lib/src/chunked_upload_browser.dart', + 'template' => 'flutter/lib/src/chunked_upload_browser.dart.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'lib/src/chunked_upload_stub.dart', diff --git a/templates/flutter/lib/package.dart.twig b/templates/flutter/lib/package.dart.twig index abbb4d10e5..2ae5c01cb3 100644 --- a/templates/flutter/lib/package.dart.twig +++ b/templates/flutter/lib/package.dart.twig @@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart'; import 'package:http/http.dart' show MultipartFile; import 'src/chunked_upload_stub.dart' if (dart.library.io) 'src/chunked_upload_io.dart'; + if (dart.library.html) 'src/chunked_upload_browser.dart'; import 'src/enums.dart'; import 'src/client.dart'; import 'src/service.dart'; diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index 4188044fa7..87394897d3 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -75,28 +75,16 @@ class {{ service.name | caseUcfirst }} extends Service { }; {% if 'multipart/form-data' in method.consumes %} - dynamic res; - if(kIsWeb) { + String idParamName = ''; {% for parameter in method.parameters.all %} {% if parameter.type == 'file' %} - if(file.bytes == null) { - throw {{spec.title | caseUcfirst}}Exception("Bytes must be provided for non IO platforms"); - } - params['{{ parameter.name }}'] = MultipartFile.fromBytes('{{ parameter.name }}', {{ parameter.name }}.bytes!, filename: {{ parameter.name }}.filename); -{% endif %} -{% endfor %} - res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); - } else { - String idParamName = ''; -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - final paramName = '{{ parameter.name }}'; + final paramName = '{{ parameter.name }}'; {% endif %} {% if parameter.isUploadID %} - idParamName = '{{ parameter.name }}'; + idParamName = '{{ parameter.name }}'; {% endif %} {% endfor %} - res = await chunkedUpload( + final res = await chunkedUpload( client: client, path: path, params: params, @@ -105,7 +93,6 @@ class {{ service.name | caseUcfirst }} extends Service { headers: headers, onProgress: onProgress, ); - } {% else %} final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); {% endif %} diff --git a/templates/flutter/lib/src/chunked_upload_browser.dart.twig b/templates/flutter/lib/src/chunked_upload_browser.dart.twig new file mode 100644 index 0000000000..a30f678894 --- /dev/null +++ b/templates/flutter/lib/src/chunked_upload_browser.dart.twig @@ -0,0 +1,74 @@ +import 'client.dart'; +import 'enums.dart'; +import 'package:http/http.dart' as http; +import 'response.dart'; +import 'dart:math'; +import 'input_file.dart'; +import 'exception.dart'; +import 'upload_progress.dart'; + +Future chunkedUpload({ + required Client client, + required String path, + required Map params, + required String paramName, + required String idParamName, + required Map headers, + Function(UploadProgress)? onProgress, +}) async { + InputFile file = params[paramName]; + if (file.bytes == null) { + throw {{spec.title | caseUcfirst}}Exception("File bytes must be provided for Flutter web"); + } + + int size = file.bytes!.length; + + late Response res; + if (size <= Client.CHUNK_SIZE) { + params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!, filename: file.filename); + return client.call( + HttpMethod.post, + path: path, + params: params, + headers: headers, + ); + } + + var offset = 0; + if (idParamName.isNotEmpty && params[idParamName] != 'unique()') { + //make a request to check if a file already exists + try { + res = await client.call( + HttpMethod.get, + path: path + '/' + params[idParamName], + headers: headers, + ); + final int chunksUploaded = res.data['chunksUploaded'] as int; + offset = min(size, chunksUploaded * Client.CHUNK_SIZE); + } on {{spec.title | caseUcfirst}}Exception catch (_) {} + } + + while (offset < size) { + var chunk; + chunk = file.bytes!.getRange(offset, offset + Client.CHUNK_SIZE - 1); + params[paramName] = + http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); + headers['content-range'] = + 'bytes $offset-${min(((offset + Client.CHUNK_SIZE) - 1), size)}/$size'; + res = await client.call(HttpMethod.post, + path: path, headers: headers, params: params); + offset += Client.CHUNK_SIZE; + if (offset < size) { + headers['x-{{spec.title | caseLower }}-id'] = res.data['\$id']; + } + final progress = UploadProgress( + $id: res.data['\$id'] ?? '', + progress: min(offset - 1, size) / size * 100, + sizeUploaded: min(offset - 1, size), + chunksTotal: res.data['chunksTotal'] ?? 0, + chunksUploaded: res.data['chunksUploaded'] ?? 0, + ); + onProgress?.call(progress); + } + return res; +} From 9e38346d10183950d03841e4c60bb9d34e1a6fc6 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 25 May 2022 08:02:01 +0000 Subject: [PATCH 022/555] fix import --- templates/dart/lib/package.dart.twig | 2 +- templates/flutter/lib/package.dart.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/dart/lib/package.dart.twig b/templates/dart/lib/package.dart.twig index 72844c3000..2b3f629a58 100644 --- a/templates/dart/lib/package.dart.twig +++ b/templates/dart/lib/package.dart.twig @@ -4,8 +4,8 @@ import 'dart:async'; import 'dart:typed_data'; import 'package:http/http.dart' show MultipartFile; import 'src/chunked_upload_stub.dart' - if (dart.library.io) 'src/chunked_upload_io.dart'; if (dart.library.html) 'src/chunked_upload_browser.dart' + if (dart.library.io) 'src/chunked_upload_io.dart'; import 'src/enums.dart'; import 'src/client.dart'; import 'src/service.dart'; diff --git a/templates/flutter/lib/package.dart.twig b/templates/flutter/lib/package.dart.twig index 2ae5c01cb3..dacd631851 100644 --- a/templates/flutter/lib/package.dart.twig +++ b/templates/flutter/lib/package.dart.twig @@ -5,8 +5,8 @@ import 'dart:typed_data'; import 'package:flutter/foundation.dart'; import 'package:http/http.dart' show MultipartFile; import 'src/chunked_upload_stub.dart' + if (dart.library.html) 'src/chunked_upload_browser.dart' if (dart.library.io) 'src/chunked_upload_io.dart'; - if (dart.library.html) 'src/chunked_upload_browser.dart'; import 'src/enums.dart'; import 'src/client.dart'; import 'src/service.dart'; From 2d88d723bf857e65c1303be532edfd54905d5c18 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 26 May 2022 11:28:22 +0545 Subject: [PATCH 023/555] fix chunked upload with bytes --- templates/dart/lib/src/chunked_upload_browser.dart.twig | 3 ++- templates/dart/lib/src/chunked_upload_io.dart.twig | 3 ++- templates/flutter/lib/src/chunked_upload_browser.dart.twig | 3 ++- templates/flutter/lib/src/chunked_upload_io.dart.twig | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/templates/dart/lib/src/chunked_upload_browser.dart.twig b/templates/dart/lib/src/chunked_upload_browser.dart.twig index c9c3c4b9e7..b06a5acd19 100644 --- a/templates/dart/lib/src/chunked_upload_browser.dart.twig +++ b/templates/dart/lib/src/chunked_upload_browser.dart.twig @@ -50,7 +50,8 @@ Future chunkedUpload({ while (offset < size) { var chunk; - chunk = file.bytes!.getRange(offset, offset + Client.CHUNK_SIZE - 1); + final end = min(offset + Client.CHUNK_SIZE-1, size-1); + chunk = file.bytes!.getRange(offset, end).toList(); params[paramName] = http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); headers['content-range'] = diff --git a/templates/dart/lib/src/chunked_upload_io.dart.twig b/templates/dart/lib/src/chunked_upload_io.dart.twig index a34bf8e384..02aa19d267 100644 --- a/templates/dart/lib/src/chunked_upload_io.dart.twig +++ b/templates/dart/lib/src/chunked_upload_io.dart.twig @@ -75,7 +75,8 @@ Future chunkedUpload({ while (offset < size) { var chunk; if (file.bytes != null) { - chunk = file.bytes!.getRange(offset, offset + Client.CHUNK_SIZE - 1); + final end = min(offset + Client.CHUNK_SIZE-1, size-1); + chunk = file.bytes!.getRange(offset, end).toList(); } else { raf!.setPositionSync(offset); chunk = raf.readSync(Client.CHUNK_SIZE); diff --git a/templates/flutter/lib/src/chunked_upload_browser.dart.twig b/templates/flutter/lib/src/chunked_upload_browser.dart.twig index a30f678894..16a074508d 100644 --- a/templates/flutter/lib/src/chunked_upload_browser.dart.twig +++ b/templates/flutter/lib/src/chunked_upload_browser.dart.twig @@ -50,7 +50,8 @@ Future chunkedUpload({ while (offset < size) { var chunk; - chunk = file.bytes!.getRange(offset, offset + Client.CHUNK_SIZE - 1); + final end = min(offset + Client.CHUNK_SIZE-1, size-1); + chunk = file.bytes!.getRange(offset, end).toList(); params[paramName] = http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); headers['content-range'] = diff --git a/templates/flutter/lib/src/chunked_upload_io.dart.twig b/templates/flutter/lib/src/chunked_upload_io.dart.twig index a34bf8e384..92289669b1 100644 --- a/templates/flutter/lib/src/chunked_upload_io.dart.twig +++ b/templates/flutter/lib/src/chunked_upload_io.dart.twig @@ -75,7 +75,8 @@ Future chunkedUpload({ while (offset < size) { var chunk; if (file.bytes != null) { - chunk = file.bytes!.getRange(offset, offset + Client.CHUNK_SIZE - 1); + final end = min(offset + Client.CHUNK_SIZE-1, size-1); + chunk = file.bytes!.getRange(offset, end).toList(); } else { raf!.setPositionSync(offset); chunk = raf.readSync(Client.CHUNK_SIZE); From 69f56b62bdf84a8886d7f529eee9a36fffeb1d6c Mon Sep 17 00:00:00 2001 From: Chau Tran Date: Fri, 27 May 2022 10:24:44 -0500 Subject: [PATCH 024/555] web - add index type to Models that have additionalProperties set to true --- templates/web/src/sdk.ts.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/web/src/sdk.ts.twig b/templates/web/src/sdk.ts.twig index 6844f1e0ea..8eaeab0b31 100644 --- a/templates/web/src/sdk.ts.twig +++ b/templates/web/src/sdk.ts.twig @@ -13,6 +13,7 @@ namespace Models { * {{ property.description }} */ {{ property.name | escapeKeyword }}{% if not property.required %}?{% endif %}: {{_self.sub_schema(property)}}; + {% if definition.additionalProperties %}[key: string]?: any;{% endif %} {% endfor %} } {% endfor %} From a1fc092dd4f180f36fd92d246116108b97490da6 Mon Sep 17 00:00:00 2001 From: Chau Tran Date: Mon, 30 May 2022 12:21:09 -0500 Subject: [PATCH 025/555] web - move index type out of the inner properties loop --- templates/web/src/sdk.ts.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/web/src/sdk.ts.twig b/templates/web/src/sdk.ts.twig index 8eaeab0b31..4aa75261de 100644 --- a/templates/web/src/sdk.ts.twig +++ b/templates/web/src/sdk.ts.twig @@ -13,8 +13,8 @@ namespace Models { * {{ property.description }} */ {{ property.name | escapeKeyword }}{% if not property.required %}?{% endif %}: {{_self.sub_schema(property)}}; - {% if definition.additionalProperties %}[key: string]?: any;{% endif %} {% endfor %} + {% if definition.additionalProperties %}[key: string]?: any;{% endif %} } {% endfor %} } From 156963dba7c987ea6d5e63f1b2e1be242dc5c255 Mon Sep 17 00:00:00 2001 From: Chau Tran Date: Mon, 30 May 2022 12:23:27 -0500 Subject: [PATCH 026/555] web - fix syntax on index type --- templates/web/src/sdk.ts.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/web/src/sdk.ts.twig b/templates/web/src/sdk.ts.twig index 4aa75261de..394be3855b 100644 --- a/templates/web/src/sdk.ts.twig +++ b/templates/web/src/sdk.ts.twig @@ -14,7 +14,7 @@ namespace Models { */ {{ property.name | escapeKeyword }}{% if not property.required %}?{% endif %}: {{_self.sub_schema(property)}}; {% endfor %} - {% if definition.additionalProperties %}[key: string]?: any;{% endif %} + {% if definition.additionalProperties %}[key: string]: any;{% endif %} } {% endfor %} } From acf35189bb3a9a5aa4dc23e10a74fbda6d46dd07 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 31 May 2022 13:17:35 +0200 Subject: [PATCH 027/555] feat: make web oop --- src/SDK/Language/Web.php | 34 ++- templates/web/rollup.config.js.twig | 4 +- .../web/src/{sdk.ts.twig => client.ts.twig} | 261 +----------------- templates/web/src/index.ts.twig | 6 + templates/web/src/models.ts.twig | 17 ++ templates/web/src/query.ts.twig | 39 +++ templates/web/src/service.ts.twig | 30 ++ templates/web/src/services/template.ts.twig | 168 +++++++++++ tests/WebChromiumTest.php | 6 +- tests/WebNodeTest.php | 6 +- tests/languages/web/index.html | 46 +-- tests/languages/web/node.js | 40 +-- 12 files changed, 357 insertions(+), 300 deletions(-) rename templates/web/src/{sdk.ts.twig => client.ts.twig} (56%) create mode 100644 templates/web/src/index.ts.twig create mode 100644 templates/web/src/models.ts.twig create mode 100644 templates/web/src/query.ts.twig create mode 100644 templates/web/src/service.ts.twig create mode 100644 templates/web/src/services/template.ts.twig diff --git a/src/SDK/Language/Web.php b/src/SDK/Language/Web.php index e60240b597..694ea26e9f 100644 --- a/src/SDK/Language/Web.php +++ b/src/SDK/Language/Web.php @@ -23,8 +23,38 @@ public function getFiles() return [ [ 'scope' => 'default', - 'destination' => 'src/sdk.ts', - 'template' => '/web/src/sdk.ts.twig', + 'destination' => 'src/index.ts', + 'template' => 'web/src/index.ts.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => 'src/client.ts', + 'template' => 'web/src/client.ts.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => 'src/service.ts', + 'template' => 'web/src/service.ts.twig', + 'minify' => false, + ], + [ + 'scope' => 'service', + 'destination' => 'src/services/{{service.name | caseDash}}.ts', + 'template' => 'web/src/services/template.ts.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => 'src/models.ts', + 'template' => 'web/src/models.ts.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => 'src/query.ts', + 'template' => 'web/src/query.ts.twig', 'minify' => false, ], [ diff --git a/templates/web/rollup.config.js.twig b/templates/web/rollup.config.js.twig index 883245e6a7..a9c3354118 100644 --- a/templates/web/rollup.config.js.twig +++ b/templates/web/rollup.config.js.twig @@ -3,7 +3,7 @@ import typescript from "@rollup/plugin-typescript"; export default { external: Object.keys(pkg.dependencies), - input: "src/sdk.ts", + input: "src/index.ts", plugins: [typescript()], output: [ { @@ -20,7 +20,7 @@ export default { { format: "iife", file: pkg.jsdelivr, - name: "window", + name: "Appwrite", extend: true, globals: { "cross-fetch": "window", diff --git a/templates/web/src/sdk.ts.twig b/templates/web/src/client.ts.twig similarity index 56% rename from templates/web/src/sdk.ts.twig rename to templates/web/src/client.ts.twig index 1f97c794e7..df27427833 100644 --- a/templates/web/src/sdk.ts.twig +++ b/templates/web/src/client.ts.twig @@ -1,22 +1,7 @@ import 'isomorphic-form-data'; import { fetch } from 'cross-fetch'; - -namespace Models { -{% for definition in spec.definitions %} - /** - * {{ definition.description }} - */ - export type {{ definition.name | caseUcfirst }}{{ definition.name | getGenerics(spec, true) | raw }} = { -{% for property in definition.properties %} - /** - * {{ property.description }} - */ - {{ property.name | escapeKeyword }}{% if not property.required %}?{% endif %}: {{ property | getSubSchema(spec) | raw }}; -{% endfor %} - {% if definition.additionalProperties %}[key: string]: any;{% endif %} - } -{% endfor %} -} +import { Models } from './models'; +import { Service } from './service'; type Payload = { [key: string]: any; @@ -27,8 +12,8 @@ type Headers = { } type RealtimeResponse = { - type: 'error'|'event'|'connected'|'response'; - data: RealtimeResponseAuthenticated|RealtimeResponseConnected|RealtimeResponseError|RealtimeResponseEvent; + type: 'error' | 'event' | 'connected' | 'response'; + data: RealtimeResponseAuthenticated | RealtimeResponseConnected | RealtimeResponseError | RealtimeResponseEvent; } type RealtimeRequest = { @@ -105,9 +90,7 @@ class {{spec.title | caseUcfirst}}Exception extends Error { } } -class {{ spec.title | caseUcfirst }} { - static CHUNK_SIZE = 5*1024*1024; // 5MB - +class Client { config = { endpoint: '{{ spec.endpoint }}', endpointRealtime: '', @@ -350,12 +333,12 @@ class {{ spec.title | caseUcfirst }} { } } - private async call(method: string, url: URL, headers: Headers = {}, params: Payload = {}): Promise { + async call(method: string, url: URL, headers: Headers = {}, params: Payload = {}): Promise { method = method.toUpperCase(); headers = Object.assign({}, this.headers, headers); - + let options: RequestInit = { method, headers, @@ -367,7 +350,7 @@ class {{ spec.title | caseUcfirst }} { } if (method === 'GET') { - for (const [key, value] of Object.entries(this.flatten(params))) { + for (const [key, value] of Object.entries(Service.flatten(params))) { url.searchParams.append(key, value); } } else { @@ -426,229 +409,9 @@ class {{ spec.title | caseUcfirst }} { throw new {{spec.title | caseUcfirst}}Exception((e).message); } } - - private flatten(data: Payload, prefix = ''): Payload { - let output: Payload = {}; - - 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; - } - -{% for service in spec.services %} - {{service.name | caseCamel}} = { -{% for method in service.methods %} - - /** - * {{ method.title }} - * -{% if method.description %} -{{ method.description|comment3 }} -{% endif %} - * -{% for parameter in method.parameters.all %} - * @param {{ '{' }}{{ parameter.type | getPropertyType(method) | raw }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} -{% endfor %} - * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} - * @returns {% if method.type == 'webAuth' %}{void|string}{% elseif method.type == 'location' %}{URL}{% else %}{Promise}{% endif %} - - */ - {{ method.name | caseCamel }}: {% if method.type != 'location' and method.type != 'webAuth'%}async {{ method.responseModel | getGenerics(spec) | raw }}{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | getPropertyType(method) | raw }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): {{ method | getReturn(spec) | raw }} => { -{% for parameter in method.parameters.all %} -{% if parameter.required %} - if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { - throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); - } - -{% endif %} -{% endfor %} - let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel | escapeKeyword }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; - let payload: Payload = {}; - -{% for parameter in method.parameters.query %} - if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}; - } - -{% endfor %} -{% for parameter in method.parameters.body %} - if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}; - } - -{% endfor %} - const uri = new URL(this.config.endpoint + path); -{% if method.type == 'location' or method.type == 'webAuth' %} -{% if method.security|length > 0 %} -{% for node in method.security %} -{% for key,header in node|keys %} - payload['{{header|caseLower}}'] = this.config.{{header|caseLower}}; - -{% endfor %} -{% endfor %} -{% endif %} - - for (const [key, value] of Object.entries(this.flatten(payload))) { - uri.searchParams.append(key, value); - } -{% endif %} -{% if method.type == 'webAuth' %} - if (typeof window !== 'undefined' && window?.location) { - window.location.href = uri.toString(); - } else { - return uri; - } -{% elseif method.type == 'location' %} - return uri; -{% else %} -{% if 'multipart/form-data' in method.consumes %} -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - - if(!({{ parameter.name | caseCamel | escapeKeyword }} instanceof File)) { - throw new {{spec.title | caseUcfirst}}Exception('Parameter "{{ parameter.name | caseCamel | escapeKeyword }}" has to be a File.'); - } - - const size = {{ parameter.name | caseCamel | escapeKeyword }}.size; - - if (size <= {{ spec.title | caseUcfirst }}.CHUNK_SIZE) { - return await this.call('{{ method.method | caseLower }}', uri, { - -{% for parameter in method.parameters.header %} - '{{ parameter.name | caseCamel | escapeKeyword }}': this.${{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}': '{{ header }}', -{% endfor %} - }, payload); - } - let id = undefined; - let response = undefined; - - const headers: { [header: string]: string } = { -{% for parameter in method.parameters.header %} - '{{ parameter.name | caseCamel | escapeKeyword }}': this.${{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}': '{{ header }}', -{% endfor %} - } - - let counter = 0; - const totalCounters = Math.ceil(size / {{ spec.title | caseUcfirst }}.CHUNK_SIZE); -{% for parameter in method.parameters.all %} -{% if parameter.isUploadID %} - if({{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { - try { - response = await this.call('GET', new URL(this.config.endpoint + path + '/' + {{ parameter.name }}), headers); - counter = response.chunksUploaded; - } catch(e) { - } - } -{% endif %} -{% endfor %} - - for (counter; counter < totalCounters; counter++) { - const start = (counter * {{ spec.title | caseUcfirst }}.CHUNK_SIZE); - const end = Math.min((((counter * {{ spec.title | caseUcfirst }}.CHUNK_SIZE) + {{ spec.title | caseUcfirst }}.CHUNK_SIZE) - 1), size); - - headers['content-range'] = 'bytes ' + start + '-' + end + '/' + size - - if (id) { - headers['x-{{spec.title | caseLower }}-id'] = id; - } - - const stream = {{ parameter.name | caseCamel | escapeKeyword }}.slice(start, end + 1); - payload['{{ parameter.name }}'] = new File([stream], {{ parameter.name | caseCamel | escapeKeyword }}.name); - - response = await this.call('{{ method.method | caseLower }}', uri, headers, payload); - - if (!id) { - id = response['$id']; - } - - if (onProgress) { - onProgress({ - $id: response.$id, - progress: Math.min((counter + 1) * {{ spec.title | caseUcfirst }}.CHUNK_SIZE - 1, size) / size * 100, - sizeUploaded: end, - chunksTotal: response.chunksTotal, - chunksUploaded: response.chunksUploaded - }); - } - } - - return response; -{% endif %} -{% endfor %} -{% else %} - return await this.call('{{ method.method | caseLower }}', uri, { -{% for parameter in method.parameters.header %} - '{{ parameter.name | caseCamel | escapeKeyword }}': this.${{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}': '{{ header }}', -{% endfor %} - }, payload); -{% endif %} -{% endif %} - }{% if not loop.last %}, -{% endif %} -{% endfor %} - - }; - -{% endfor %} -}; - -type QueryTypesSingle = string | number | boolean; -type QueryTypesList = string[] | number[] | boolean[]; -type QueryTypes = QueryTypesSingle | QueryTypesList; - -class Query { - static equal = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "equal", value); - - static notEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "notEqual", value); - - static lesser = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "lesser", value); - - static lesserEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "lesserEqual", value); - - static greater = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "greater", value); - - static greaterEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "greaterEqual", value); - - static search = (attribute: string, value: string): string => - Query.addQuery(attribute, "search", value); - - private static addQuery = (attribute: string, oper: string, value: QueryTypes): string => - value instanceof Array - ? `${attribute}.${oper}(${value - .map((v: QueryTypesSingle) => Query.parseValues(v)) - .join(",")})` - : `${attribute}.${oper}(${Query.parseValues(value)})`; - - private static parseValues = (value: QueryTypes): string => - typeof value === "string" || value instanceof String - ? `"${value}"` - : `${value}`; } -export { {{spec.title | caseUcfirst}}, Query } -export type { {{spec.title | caseUcfirst}}Exception, Models, QueryTypes, QueryTypesList } +export { Client, {{spec.title | caseUcfirst}}Exception }; +export { Query } from './query'; +export type { Models, Payload }; +export type { QueryTypes, QueryTypesList } from './query'; diff --git a/templates/web/src/index.ts.twig b/templates/web/src/index.ts.twig new file mode 100644 index 0000000000..b675a39f0b --- /dev/null +++ b/templates/web/src/index.ts.twig @@ -0,0 +1,6 @@ +export { Client, Query, {{spec.title | caseUcfirst}}Exception } from './client'; +{% for service in spec.services %} +export { {{service.name | caseUcfirst}} } from './services/{{service.name | caseDash}}'; +{% endfor %} +export type { Models, Payload } from './client'; +export type { QueryTypes, QueryTypesList } from './query'; \ No newline at end of file diff --git a/templates/web/src/models.ts.twig b/templates/web/src/models.ts.twig new file mode 100644 index 0000000000..749faf765a --- /dev/null +++ b/templates/web/src/models.ts.twig @@ -0,0 +1,17 @@ +export namespace Models { +{% for definition in spec.definitions %} + /** + * {{ definition.description }} + */ + export type {{ definition.name | caseUcfirst }}{{ definition.name | getGenerics(spec, true) | raw }} = { +{% for property in definition.properties %} + /** + * {{ property.description }} + */ + {{ property.name | escapeKeyword }}{% if not property.required %}?{% endif %}: {{ property | getSubSchema(spec) | raw }}; +{% endfor %} +{% if definition.additionalProperties %} [key: string]: any; +{% endif %} + } +{% endfor %} +} diff --git a/templates/web/src/query.ts.twig b/templates/web/src/query.ts.twig new file mode 100644 index 0000000000..03ad93ef0b --- /dev/null +++ b/templates/web/src/query.ts.twig @@ -0,0 +1,39 @@ +type QueryTypesSingle = string | number | boolean; +export type QueryTypesList = string[] | number[] | boolean[]; +export type QueryTypes = QueryTypesSingle | QueryTypesList; + + +export class Query { + static equal = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, 'equal', value); + + static notEqual = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, 'notEqual', value); + + static lesser = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, 'lesser', value); + + static lesserEqual = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, 'lesserEqual', value); + + static greater = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, 'greater', value); + + static greaterEqual = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, 'greaterEqual', value); + + static search = (attribute: string, value: string): string => + Query.addQuery(attribute, 'search', value); + + private static addQuery = (attribute: string, oper: string, value: QueryTypes): string => + value instanceof Array + ? `${attribute}.${oper}(${value + .map((v: QueryTypesSingle) => Query.parseValues(v)) + .join(',')})` + : `${attribute}.${oper}(${Query.parseValues(value)})`; + + private static parseValues = (value: QueryTypes): string => + typeof value === 'string' || value instanceof String + ? `"${value}"` + : `${value}`; +} \ No newline at end of file diff --git a/templates/web/src/service.ts.twig b/templates/web/src/service.ts.twig new file mode 100644 index 0000000000..0c9662be37 --- /dev/null +++ b/templates/web/src/service.ts.twig @@ -0,0 +1,30 @@ +import { Client } from './client'; +import type { Payload } from './client'; + +export class Service { + static CHUNK_SIZE = 5*1024*1024; // 5MB + + client: Client; + + constructor(client: Client) { + this.client = client; + } + + static flatten(data: Payload, prefix = ''): Payload { + let output: Payload = {}; + + 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; + } +} \ No newline at end of file diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig new file mode 100644 index 0000000000..900bb99ca7 --- /dev/null +++ b/templates/web/src/services/template.ts.twig @@ -0,0 +1,168 @@ +import { Service } from '../service'; +import { {{ spec.title | caseUcfirst}}Exception } from '../client'; +import type { Models } from '../models'; +import type { UploadProgress } from '../client'; + +type Payload = { + [key: string]: any; +} + +export class {{ service.name | caseUcfirst }} extends Service { +{% for method in service.methods %} + + /** + * {{ method.title }} + * +{% if method.description %} +{{ method.description|comment3 }} +{% endif %} + * +{% for parameter in method.parameters.all %} + * @param {{ '{' }}{{ parameter.type | getPropertyType(method) | raw }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} +{% endfor %} + * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} + * @returns {% if method.type == 'webAuth' %}{void|string}{% elseif method.type == 'location' %}{URL}{% else %}{Promise}{% endif %} + + */ + {% if method.type != 'location' and method.type != 'webAuth'%}async {% endif %}{{ method.name | caseCamel }}{{ method.responseModel | getGenerics(spec) | raw }}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | getPropertyType(method) | raw }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): {{ method | getReturn(spec) | raw }} { +{% for parameter in method.parameters.all %} +{% if parameter.required %} + if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { + throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); + } + +{% endif %} +{% endfor %} + let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel | escapeKeyword }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; + let payload: Payload = {}; + +{% for parameter in method.parameters.query %} + if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}; + } + +{% endfor %} +{% for parameter in method.parameters.body %} + if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}; + } + +{% endfor %} + const uri = new URL(this.client.config.endpoint + path); +{% if method.type == 'location' or method.type == 'webAuth' %} +{% if method.security|length > 0 %} +{% for node in method.security %} +{% for key,header in node|keys %} + payload['{{header|caseLower}}'] = this.client.config.{{header|caseLower}}; + +{% endfor %} +{% endfor %} +{% endif %} + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } +{% endif %} +{% if method.type == 'webAuth' %} + if (typeof window !== 'undefined' && window?.location) { + window.location.href = uri.toString(); + } else { + return uri; + } +{% elseif method.type == 'location' %} + return uri; +{% else %} +{% if 'multipart/form-data' in method.consumes %} +{% for parameter in method.parameters.all %} +{% if parameter.type == 'file' %} + + if(!({{ parameter.name | caseCamel | escapeKeyword }} instanceof File)) { + throw new {{spec.title | caseUcfirst}}Exception('Parameter "{{ parameter.name | caseCamel | escapeKeyword }}" has to be a File.'); + } + + const size = {{ parameter.name | caseCamel | escapeKeyword }}.size; + + if (size <= Service.CHUNK_SIZE) { + return await this.client.call('{{ method.method | caseLower }}', uri, { + +{% for parameter in method.parameters.header %} + '{{ parameter.name | caseCamel | escapeKeyword }}': this.client.${{ parameter.name | caseCamel | escapeKeyword }}, +{% endfor %} +{% for key, header in method.headers %} + '{{ key }}': '{{ header }}', +{% endfor %} + }, payload); + } + let id = undefined; + let response = undefined; + + const headers: { [header: string]: string } = { +{% for parameter in method.parameters.header %} + '{{ parameter.name | caseCamel | escapeKeyword }}': this.client.${{ parameter.name | caseCamel | escapeKeyword }}, +{% endfor %} +{% for key, header in method.headers %} + '{{ key }}': '{{ header }}', +{% endfor %} + } + + let counter = 0; + const totalCounters = Math.ceil(size / Service.CHUNK_SIZE); +{% for parameter in method.parameters.all %} +{% if parameter.isUploadID %} + if({{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { + try { + response = await this.client.call('GET', new URL(this.client.config.endpoint + path + '/' + {{ parameter.name }}), headers); + counter = response.chunksUploaded; + } catch(e) { + } + } +{% endif %} +{% endfor %} + + for (counter; counter < totalCounters; counter++) { + const start = (counter * Service.CHUNK_SIZE); + const end = Math.min((((counter * Service.CHUNK_SIZE) + Service.CHUNK_SIZE) - 1), size); + + headers['content-range'] = 'bytes ' + start + '-' + end + '/' + size + + if (id) { + headers['x-{{spec.title | caseLower }}-id'] = id; + } + + const stream = {{ parameter.name | caseCamel | escapeKeyword }}.slice(start, end + 1); + payload['{{ parameter.name }}'] = new File([stream], {{ parameter.name | caseCamel | escapeKeyword }}.name); + + response = await this.client.call('{{ method.method | caseLower }}', uri, headers, payload); + + if (!id) { + id = response['$id']; + } + + if (onProgress) { + onProgress({ + $id: response.$id, + progress: Math.min((counter + 1) * Service.CHUNK_SIZE - 1, size) / size * 100, + sizeUploaded: end, + chunksTotal: response.chunksTotal, + chunksUploaded: response.chunksUploaded + }); + } + } + + return response; +{% endif %} +{% endfor %} +{% else %} + return await this.client.call('{{ method.method | caseLower }}', uri, { +{% for parameter in method.parameters.header %} + '{{ parameter.name | caseCamel | escapeKeyword }}': this.client.${{ parameter.name | caseCamel | escapeKeyword }}, +{% endfor %} +{% for key, header in method.headers %} + '{{ key }}': '{{ header }}', +{% endfor %} + }, payload); +{% endif %} +{% endif %} + } +{% endfor %} +}; diff --git a/tests/WebChromiumTest.php b/tests/WebChromiumTest.php index c74d6557ea..4f9c93313d 100644 --- a/tests/WebChromiumTest.php +++ b/tests/WebChromiumTest.php @@ -10,11 +10,11 @@ class WebChromiumTest extends Base 'cp tests/languages/web/tests.js tests/sdks/web/tests.js', 'cp tests/languages/web/node.js tests/sdks/web/node.js', 'cp tests/languages/web/index.html tests/sdks/web/index.html', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.21.0-focal npm install', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.21.0-focal npm run build', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal npm install', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal npm run build', ]; protected string $command = - 'docker run --rm -v $(pwd):/app -e BROWSER=chromium -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.21.0-focal node tests.js'; + 'docker run --rm -v $(pwd):/app -e BROWSER=chromium -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal node tests.js'; protected array $expectedOutput = [ ...Base::FOO_RESPONSES, diff --git a/tests/WebNodeTest.php b/tests/WebNodeTest.php index 069521b358..48c202045f 100644 --- a/tests/WebNodeTest.php +++ b/tests/WebNodeTest.php @@ -10,11 +10,11 @@ class WebNodeTest extends Base 'cp tests/languages/web/tests.js tests/sdks/web/tests.js', 'cp tests/languages/web/node.js tests/sdks/web/node.js', 'cp tests/languages/web/index.html tests/sdks/web/index.html', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal npm install', // npm list --depth 0 && - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal npm run build', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal npm install', // npm list --depth 0 && + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal npm run build', ]; protected string $command = - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal node node.js'; + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal node node.js'; protected array $expectedOutput = [ ...Base::FOO_RESPONSES, diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index f28f751aac..bab5e567f5 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -20,52 +20,56 @@ let response; let responseRealtime = 'Realtime failed!'; // Init SDK - let sdk = new Appwrite(); + const { Client, Foo, Bar, General } = Appwrite; + const client = new Client(); + const foo = new Foo(client); + const bar = new Bar(client); + const general = new General(client); - sdk.setProject('console'); - sdk.setEndpointRealtime('ws://demo.appwrite.io/v1'); + client.setProject('console'); + client.setEndpointRealtime('ws://demo.appwrite.io/v1'); - sdk.subscribe('tests', event => { + client.subscribe('tests', event => { responseRealtime = event.payload.response; }); // Foo - response = await sdk.foo.get("string", 123, ["string in array"]); + response = await foo.get("string", 123, ["string in array"]); console.log(response.result); - response = await sdk.foo.post("string", 123, ["string in array"]); + response = await foo.post("string", 123, ["string in array"]); console.log(response.result); - response = await sdk.foo.put("string", 123, ["string in array"]); + response = await foo.put("string", 123, ["string in array"]); console.log(response.result); - response = await sdk.foo.patch("string", 123, ["string in array"]); + response = await foo.patch("string", 123, ["string in array"]); console.log(response.result); - response = await sdk.foo.delete("string", 123, ["string in array"]); + response = await foo.delete("string", 123, ["string in array"]); console.log(response.result); // Bar - response = await sdk.bar.get("string", 123, ["string in array"]); + response = await bar.get("string", 123, ["string in array"]); console.log(response.result); - response = await sdk.bar.post("string", 123, ["string in array"]); + response = await bar.post("string", 123, ["string in array"]); console.log(response.result); - response = await sdk.bar.put("string", 123, ["string in array"]); + response = await bar.put("string", 123, ["string in array"]); console.log(response.result); - response = await sdk.bar.patch("string", 123, ["string in array"]); + response = await bar.patch("string", 123, ["string in array"]); console.log(response.result); - response = await sdk.bar.delete("string", 123, ["string in array"]); + response = await bar.delete("string", 123, ["string in array"]); console.log(response.result); // General - response = await sdk.general.redirect(); + response = await general.redirect(); console.log(response.result); - response = await sdk.general.upload( + response = await general.upload( "string", 123, ["string in array"], @@ -73,7 +77,7 @@ ); console.log(response.result); - response = await sdk.general.upload( + response = await general.upload( "string", 123, ["string in array"], @@ -82,25 +86,25 @@ console.log(response.result); try { - response = await sdk.general.empty(); + response = await general.empty(); } catch (error) { console.log(error); } try { - response = await sdk.general.error400(); + response = await general.error400(); } catch (error) { console.log(error.message); } try { - response = await sdk.general.error500(); + response = await general.error500(); } catch (error) { console.log(error.message); } try { - response = await sdk.general.error502(); + response = await general.error502(); } catch (error) { console.log(error.message); } diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js index d7fe294657..e5fccb359f 100644 --- a/tests/languages/web/node.js +++ b/tests/languages/web/node.js @@ -1,69 +1,69 @@ -const requireAppwrite = require('./dist/cjs/sdk.js'); -const fs = require('fs'); +const { Client, Foo, Bar, General } = require('./dist/cjs/sdk.js'); async function start() { let response; console.log('\nTest Started'); - const { Appwrite } = requireAppwrite; - const sdk = new Appwrite(); - + const client = new Client(); + const foo = new Foo(client); + const bar = new Bar(client); + const general = new General(client); // Foo - response = await sdk.foo.get('string', 123, ['string in array']); + response = await foo.get('string', 123, ['string in array']); console.log(response.result); - response = await sdk.foo.post('string', 123, ['string in array']); + response = await foo.post('string', 123, ['string in array']); console.log(response.result); - response = await sdk.foo.put('string', 123, ['string in array']); + response = await foo.put('string', 123, ['string in array']); console.log(response.result); - response = await sdk.foo.patch('string', 123, ['string in array']); + response = await foo.patch('string', 123, ['string in array']); console.log(response.result); - response = await sdk.foo.delete('string', 123, ['string in array']); + response = await foo.delete('string', 123, ['string in array']); console.log(response.result); // Bar - response = await sdk.bar.get('string', 123, ['string in array']); + response = await bar.get('string', 123, ['string in array']); console.log(response.result); - response = await sdk.bar.post('string', 123, ['string in array']); + response = await bar.post('string', 123, ['string in array']); console.log(response.result); - response = await sdk.bar.put('string', 123, ['string in array']); + response = await bar.put('string', 123, ['string in array']); console.log(response.result); - response = await sdk.bar.patch('string', 123, ['string in array']); + response = await bar.patch('string', 123, ['string in array']); console.log(response.result); - response = await sdk.bar.delete('string', 123, ['string in array']); + response = await bar.delete('string', 123, ['string in array']); console.log(response.result); // General - response = await sdk.general.redirect(); + response = await general.redirect(); console.log(response.result); console.log('POST:/v1/mock/tests/general/upload:passed'); // Skip file upload test on Node.js console.log('POST:/v1/mock/tests/general/upload:passed'); // Skip big file upload test on Node.js try { - response = await sdk.general.empty(); + response = await general.empty(); } catch (error) { console.log(error); } try { - response = await sdk.general.error400(); + response = await general.error400(); } catch(error) { console.log(error.message); } try { - response = await sdk.general.error500(); + response = await general.error500(); } catch(error) { console.log(error.message); } try { - response = await sdk.general.error502(); + response = await general.error502(); } catch (error) { console.log(error.message); } From 53ed5aa262b0d60c441a376940f5188355f93178 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 31 May 2022 14:32:20 +0200 Subject: [PATCH 028/555] tests: use proper node images for building web --- tests/WebChromiumTest.php | 4 ++-- tests/WebNodeTest.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/WebChromiumTest.php b/tests/WebChromiumTest.php index 4f9c93313d..a04ec4dd31 100644 --- a/tests/WebChromiumTest.php +++ b/tests/WebChromiumTest.php @@ -10,8 +10,8 @@ class WebChromiumTest extends Base 'cp tests/languages/web/tests.js tests/sdks/web/tests.js', 'cp tests/languages/web/node.js tests/sdks/web/node.js', 'cp tests/languages/web/index.html tests/sdks/web/index.html', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal npm install', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal npm run build', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web node:18-alpine npm install', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web node:18-alpine npm run build', ]; protected string $command = 'docker run --rm -v $(pwd):/app -e BROWSER=chromium -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal node tests.js'; diff --git a/tests/WebNodeTest.php b/tests/WebNodeTest.php index 48c202045f..4f02d12f20 100644 --- a/tests/WebNodeTest.php +++ b/tests/WebNodeTest.php @@ -10,11 +10,11 @@ class WebNodeTest extends Base 'cp tests/languages/web/tests.js tests/sdks/web/tests.js', 'cp tests/languages/web/node.js tests/sdks/web/node.js', 'cp tests/languages/web/index.html tests/sdks/web/index.html', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal npm install', // npm list --depth 0 && - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal npm run build', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web node:18-alpine npm install', // npm list --depth 0 && + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web node:18-alpine npm run build', ]; protected string $command = - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal node node.js'; + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web node:18-alpine node node.js'; protected array $expectedOutput = [ ...Base::FOO_RESPONSES, From 3f53036da0594be3ea9f8a1ec23c543383fef37d Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 31 May 2022 14:36:09 +0200 Subject: [PATCH 029/555] web: have hardcoded dependency versions --- templates/web/package.json.twig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/web/package.json.twig b/templates/web/package.json.twig index 45b7cd2543..1c9bab063e 100644 --- a/templates/web/package.json.twig +++ b/templates/web/package.json.twig @@ -24,16 +24,16 @@ "build:libs": "rollup -c" }, "devDependencies": { - "@rollup/plugin-typescript": "^8.3.0", - "playwright": "^1.21.0", - "rollup": "^2.70.0", - "serve-handler": "^6.1.0", - "tslib": "^2.4.0", - "typescript": "^4.6.0" + "@rollup/plugin-typescript": "8.3.2", + "playwright": "1.22.2", + "rollup": "2.75.4", + "serve-handler": "6.1.0", + "tslib": "2.4.0", + "typescript": "4.7.2" }, "dependencies": { - "cross-fetch": "^3.1.0", - "isomorphic-form-data": "^2.0.0" + "cross-fetch": "3.1.5", + "isomorphic-form-data": "2.0.0" }, "jsdelivr": "dist/iife/sdk.js", "unpkg": "dist/iife/sdk.js" From 437a011a07da710e6ceb576ad18c3ce67756f719 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 31 May 2022 15:37:30 +0200 Subject: [PATCH 030/555] fix: tests --- tests/WebChromiumTest.php | 4 ++-- tests/WebNodeTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/WebChromiumTest.php b/tests/WebChromiumTest.php index a04ec4dd31..ff76969e01 100644 --- a/tests/WebChromiumTest.php +++ b/tests/WebChromiumTest.php @@ -10,8 +10,8 @@ class WebChromiumTest extends Base 'cp tests/languages/web/tests.js tests/sdks/web/tests.js', 'cp tests/languages/web/node.js tests/sdks/web/node.js', 'cp tests/languages/web/index.html tests/sdks/web/index.html', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web node:18-alpine npm install', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web node:18-alpine npm run build', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal sudo npm install', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal npm run build', ]; protected string $command = 'docker run --rm -v $(pwd):/app -e BROWSER=chromium -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal node tests.js'; diff --git a/tests/WebNodeTest.php b/tests/WebNodeTest.php index 4f02d12f20..ecb3ed45a8 100644 --- a/tests/WebNodeTest.php +++ b/tests/WebNodeTest.php @@ -10,8 +10,8 @@ class WebNodeTest extends Base 'cp tests/languages/web/tests.js tests/sdks/web/tests.js', 'cp tests/languages/web/node.js tests/sdks/web/node.js', 'cp tests/languages/web/index.html tests/sdks/web/index.html', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web node:18-alpine npm install', // npm list --depth 0 && - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web node:18-alpine npm run build', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal sudo npm install', // npm list --depth 0 && + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal npm run build', ]; protected string $command = 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web node:18-alpine node node.js'; From 0080fbb977f9adf29e5bf99ed13985e2c6580234 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 31 May 2022 16:24:59 +0200 Subject: [PATCH 031/555] tests: downgrade playwright --- templates/web/package.json.twig | 2 +- tests/WebChromiumTest.php | 6 +++--- tests/WebNodeTest.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/web/package.json.twig b/templates/web/package.json.twig index 1c9bab063e..a06e0645d5 100644 --- a/templates/web/package.json.twig +++ b/templates/web/package.json.twig @@ -25,7 +25,7 @@ }, "devDependencies": { "@rollup/plugin-typescript": "8.3.2", - "playwright": "1.22.2", + "playwright": "1.15.0", "rollup": "2.75.4", "serve-handler": "6.1.0", "tslib": "2.4.0", diff --git a/tests/WebChromiumTest.php b/tests/WebChromiumTest.php index ff76969e01..9f11a056da 100644 --- a/tests/WebChromiumTest.php +++ b/tests/WebChromiumTest.php @@ -10,11 +10,11 @@ class WebChromiumTest extends Base 'cp tests/languages/web/tests.js tests/sdks/web/tests.js', 'cp tests/languages/web/node.js tests/sdks/web/node.js', 'cp tests/languages/web/index.html tests/sdks/web/index.html', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal sudo npm install', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal npm run build', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal sudo npm install', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal npm run build', ]; protected string $command = - 'docker run --rm -v $(pwd):/app -e BROWSER=chromium -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal node tests.js'; + 'docker run --rm -v $(pwd):/app -e BROWSER=chromium -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal node tests.js'; protected array $expectedOutput = [ ...Base::FOO_RESPONSES, diff --git a/tests/WebNodeTest.php b/tests/WebNodeTest.php index ecb3ed45a8..07daf3cdc4 100644 --- a/tests/WebNodeTest.php +++ b/tests/WebNodeTest.php @@ -10,8 +10,8 @@ class WebNodeTest extends Base 'cp tests/languages/web/tests.js tests/sdks/web/tests.js', 'cp tests/languages/web/node.js tests/sdks/web/node.js', 'cp tests/languages/web/index.html tests/sdks/web/index.html', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal sudo npm install', // npm list --depth 0 && - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.22.2-focal npm run build', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal sudo npm install', // npm list --depth 0 && + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal npm run build', ]; protected string $command = 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web node:18-alpine node node.js'; From ae559d87a95be9943b6c4e5779f324e4760aa8f7 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 31 May 2022 18:23:03 +0200 Subject: [PATCH 032/555] tests: remove sudo npm install from web --- tests/WebChromiumTest.php | 2 +- tests/WebNodeTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/WebChromiumTest.php b/tests/WebChromiumTest.php index 9f11a056da..0c70197c35 100644 --- a/tests/WebChromiumTest.php +++ b/tests/WebChromiumTest.php @@ -10,7 +10,7 @@ class WebChromiumTest extends Base 'cp tests/languages/web/tests.js tests/sdks/web/tests.js', 'cp tests/languages/web/node.js tests/sdks/web/node.js', 'cp tests/languages/web/index.html tests/sdks/web/index.html', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal sudo npm install', + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal npm install', 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal npm run build', ]; protected string $command = diff --git a/tests/WebNodeTest.php b/tests/WebNodeTest.php index 07daf3cdc4..ac3dad3656 100644 --- a/tests/WebNodeTest.php +++ b/tests/WebNodeTest.php @@ -10,7 +10,7 @@ class WebNodeTest extends Base 'cp tests/languages/web/tests.js tests/sdks/web/tests.js', 'cp tests/languages/web/node.js tests/sdks/web/node.js', 'cp tests/languages/web/index.html tests/sdks/web/index.html', - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal sudo npm install', // npm list --depth 0 && + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal npm install', // npm list --depth 0 && 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal npm run build', ]; protected string $command = From 1c67d718f17d683e88449cac39a60f3579bc7b6f Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 1 Jun 2022 11:47:35 +0200 Subject: [PATCH 033/555] web: fix typings reference --- templates/web/package.json.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/web/package.json.twig b/templates/web/package.json.twig index a06e0645d5..b184c59f88 100644 --- a/templates/web/package.json.twig +++ b/templates/web/package.json.twig @@ -13,7 +13,7 @@ "./package.json": "./package.json" }, "module": "dist/esm/sdk.js", - "types": "types/sdk.d.ts", + "types": "types/index.d.ts", "repository": { "type": "git", "url": "{{ sdk.gitURL }}" From b3d36f412f2f51f422d1331b4135987f0566c4e8 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 6 Jun 2022 14:51:01 +0100 Subject: [PATCH 034/555] Simplfy git commands Thank you @stnguyen90 for this idea --- templates/cli/lib/commands/init.js.twig | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index 9f059dc199..f1d1617999 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -81,12 +81,9 @@ const initFunction = async () => { fs.mkdirSync(functionDir, "777"); - const gitInitCommands = - `git init && ` + - `git remote add -f origin https://github.com/{{ sdk.gitUserName }}/functions-starter && ` + - `git config core.sparseCheckout true`; + const gitInitCommands = "git clone --depth 1 --sparse https://github.com/{{ sdk.gitUserName }}/functions-starter ."; // depth prevents fetching older commits reducing the amount fetched - const gitPullCommands = `git pull origin main`; + const gitPullCommands = `git sparse-checkout add ${answers.runtime.id}`; // Force use CMD as powershell does not support && if (process.platform == 'win32') { @@ -95,11 +92,9 @@ const initFunction = async () => { } // Execute the child process but do not print any std output - childProcess.execSync(gitInitCommands, { stdio: 'pipe' }); + childProcess.execSync(gitInitCommands, { stdio: 'pipe', cwd: functionDir }); - fs.writeFileSync(path.join(functionDir, ".git/info/sparse-checkout"), `${answers.runtime.id}`); - - childProcess.execSync(gitPullCommands, { stdio: 'pipe' }); + childProcess.execSync(gitPullCommands, { stdio: 'pipe', cwd: functionDir }); fs.rmSync(path.join(functionDir, ".git"), { recursive: true }); const copyRecursiveSync = (src, dest) => { @@ -120,7 +115,7 @@ const initFunction = async () => { }; copyRecursiveSync(path.join(functionDir, answers.runtime.id), functionDir); - fs.rmSync(`./${answers.name}/${answers.runtime.id}`, { recursive: true, force: true }); + fs.rmSync(`${functionDir}/${answers.runtime.id}`, { recursive: true, force: true }); const readmePath = path.join(process.cwd(), 'functions', answers.name, 'README.md'); const readmeFile = fs.readFileSync(readmePath).toString(); From ca4f527e03884d91669a6bdcc61d74015021fcfc Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 7 Jun 2022 12:42:33 +0100 Subject: [PATCH 035/555] Update init.js.twig --- templates/cli/lib/commands/init.js.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index f1d1617999..0847db49e1 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -81,9 +81,9 @@ const initFunction = async () => { fs.mkdirSync(functionDir, "777"); - const gitInitCommands = "git clone --depth 1 --sparse https://github.com/{{ sdk.gitUserName }}/functions-starter ."; // depth prevents fetching older commits reducing the amount fetched + let gitInitCommands = "git clone --depth 1 --sparse https://github.com/{{ sdk.gitUserName }}/functions-starter ."; // depth prevents fetching older commits reducing the amount fetched - const gitPullCommands = `git sparse-checkout add ${answers.runtime.id}`; + let gitPullCommands = `git sparse-checkout add ${answers.runtime.id}`; // Force use CMD as powershell does not support && if (process.platform == 'win32') { From b9328744e3d934fee15c162d4e89ea9ae385a68a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 8 Jun 2022 11:02:51 +0000 Subject: [PATCH 036/555] Improve node file upload --- composer.lock | 229 +++++++++++++------- src/SDK/Language/Node.php | 8 +- templates/node/index.js.twig | 2 + templates/node/lib/client.js.twig | 8 +- templates/node/lib/inputFile.js.twig | 47 ++++ templates/node/lib/services/service.js.twig | 159 +++++++++----- 6 files changed, 315 insertions(+), 138 deletions(-) create mode 100644 templates/node/lib/inputFile.js.twig diff --git a/composer.lock b/composer.lock index ac22884f93..4bf3efda89 100644 --- a/composer.lock +++ b/composer.lock @@ -131,16 +131,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", "shasum": "" }, "require": { @@ -155,7 +155,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -193,7 +193,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" }, "funding": [ { @@ -209,20 +209,20 @@ "type": "tidelift" } ], - "time": "2021-10-20T20:35:02+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", "shasum": "" }, "require": { @@ -237,7 +237,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -276,7 +276,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" }, "funding": [ { @@ -292,20 +292,20 @@ "type": "tidelift" } ], - "time": "2021-11-30T18:21:41+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "twig/twig", - "version": "v3.3.10", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "8442df056c51b706793adf80a9fd363406dd3674" + "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/8442df056c51b706793adf80a9fd363406dd3674", - "reference": "8442df056c51b706793adf80a9fd363406dd3674", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/e939eae92386b69b49cfa4599dd9bead6bf4a342", + "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342", "shasum": "" }, "require": { @@ -320,7 +320,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -356,7 +356,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.3.10" + "source": "https://github.com/twigphp/Twig/tree/v3.4.1" }, "funding": [ { @@ -368,7 +368,7 @@ "type": "tidelift" } ], - "time": "2022-04-06T06:47:41+00:00" + "time": "2022-05-17T05:48:52+00:00" } ], "packages-dev": [ @@ -591,16 +591,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.13.2", + "version": "v4.14.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", "shasum": "" }, "require": { @@ -641,9 +641,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" }, - "time": "2021-11-30T19:35:32+00:00" + "time": "2022-05-31T20:59:12+00:00" }, { "name": "phar-io/manifest", @@ -2423,20 +2423,21 @@ }, { "name": "symfony/console", - "version": "v6.0.8", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0d00aa289215353aa8746a31d101f8e60826285c" + "reference": "c9646197ef43b0e2ff44af61e7f0571526fd4170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0d00aa289215353aa8746a31d101f8e60826285c", - "reference": "0d00aa289215353aa8746a31d101f8e60826285c", + "url": "https://api.github.com/repos/symfony/console/zipball/c9646197ef43b0e2ff44af61e7f0571526fd4170", + "reference": "c9646197ef43b0e2ff44af61e7f0571526fd4170", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^1.1|^2|^3", "symfony/string": "^5.4|^6.0" @@ -2498,7 +2499,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.0.8" + "source": "https://github.com/symfony/console/tree/v6.1.0" }, "funding": [ { @@ -2514,20 +2515,87 @@ "type": "tidelift" } ], - "time": "2022-04-20T15:01:42+00:00" + "time": "2022-05-27T06:34:22+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-02-25T11:15:52+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" + "reference": "433d05519ce6990bf3530fba6957499d327395c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", + "reference": "433d05519ce6990bf3530fba6957499d327395c2", "shasum": "" }, "require": { @@ -2539,7 +2607,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2579,7 +2647,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" }, "funding": [ { @@ -2595,20 +2663,20 @@ "type": "tidelift" } ], - "time": "2021-11-23T21:10:46+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + "reference": "219aa369ceff116e673852dce47c3a41794c14bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", + "reference": "219aa369ceff116e673852dce47c3a41794c14bd", "shasum": "" }, "require": { @@ -2620,7 +2688,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2663,7 +2731,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" }, "funding": [ { @@ -2679,24 +2747,24 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/process", - "version": "v6.0.8", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "d074154ea8b1443a96391f6e39f9e547b2dd01b9" + "reference": "318718453c2be58266f1a9e74063d13cb8dd4165" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/d074154ea8b1443a96391f6e39f9e547b2dd01b9", - "reference": "d074154ea8b1443a96391f6e39f9e547b2dd01b9", + "url": "https://api.github.com/repos/symfony/process/zipball/318718453c2be58266f1a9e74063d13cb8dd4165", + "reference": "318718453c2be58266f1a9e74063d13cb8dd4165", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=8.1" }, "type": "library", "autoload": { @@ -2724,7 +2792,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.0.8" + "source": "https://github.com/symfony/process/tree/v6.1.0" }, "funding": [ { @@ -2740,24 +2808,24 @@ "type": "tidelift" } ], - "time": "2022-04-12T16:11:42+00:00" + "time": "2022-05-11T12:12:29+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.0.1", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c" + "reference": "d66cd8ab656780f62c4215b903a420eb86358957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e517458f278c2131ca9f262f8fbaf01410f2c65c", - "reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d66cd8ab656780f62c4215b903a420eb86358957", + "reference": "d66cd8ab656780f62c4215b903a420eb86358957", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "psr/container": "^2.0" }, "conflict": { @@ -2769,7 +2837,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.1-dev" }, "thanks": { "name": "symfony/contracts", @@ -2779,7 +2847,10 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2806,7 +2877,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.0.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.1.0" }, "funding": [ { @@ -2822,24 +2893,24 @@ "type": "tidelift" } ], - "time": "2022-03-13T20:10:05+00:00" + "time": "2022-05-07T08:07:09+00:00" }, { "name": "symfony/string", - "version": "v6.0.8", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d" + "reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", - "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", + "url": "https://api.github.com/repos/symfony/string/zipball/d3edc75baf9f1d4f94879764dda2e1ac33499529", + "reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -2891,7 +2962,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.8" + "source": "https://github.com/symfony/string/tree/v6.1.0" }, "funding": [ { @@ -2907,7 +2978,7 @@ "type": "tidelift" } ], - "time": "2022-04-22T08:18:02+00:00" + "time": "2022-04-22T08:18:23+00:00" }, { "name": "theseer/tokenizer", @@ -2961,21 +3032,21 @@ }, { "name": "webmozart/assert", - "version": "1.10.0", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" + "ext-ctype": "*", + "php": "^7.2 || ^8.0" }, "conflict": { "phpstan/phpstan": "<0.12.20", @@ -3013,9 +3084,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" + "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, - "time": "2021-03-09T10:59:23+00:00" + "time": "2022-06-03T18:03:27+00:00" } ], "aliases": [], diff --git a/src/SDK/Language/Node.php b/src/SDK/Language/Node.php index dbb3daf3cd..4d932e5b6f 100644 --- a/src/SDK/Language/Node.php +++ b/src/SDK/Language/Node.php @@ -26,7 +26,7 @@ public function getTypeName($type) case self::TYPE_ARRAY: return 'string[]'; case self::TYPE_FILE: - return 'string'; + return 'InputFile'; break; } @@ -63,6 +63,12 @@ public function getFiles() 'template' => 'node/lib/query.js.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'lib/inputFile.js', + 'template' => 'node/lib/inputFile.js.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/lib/service.js', diff --git a/templates/node/index.js.twig b/templates/node/index.js.twig index f6aa0040ef..e5639608b6 100644 --- a/templates/node/index.js.twig +++ b/templates/node/index.js.twig @@ -1,5 +1,6 @@ const Client = require('./lib/client.js'); const Query = require('./lib/query.js'); +const InputFile = require('./lib/inputFile.js'); const {{spec.title | caseUcfirst}}Exception = require('./lib/exception.js'); {% for service in spec.services %} const {{service.name | caseUcfirst}} = require('./lib/services/{{service.name | caseDash}}.js'); @@ -8,6 +9,7 @@ const {{service.name | caseUcfirst}} = require('./lib/services/{{service.name | module.exports = { Client, Query, + InputFile, {{spec.title | caseUcfirst}}Exception, {% for service in spec.services %} {{service.name | caseUcfirst}}, diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index 0786a290e6..5442b8d538 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -93,7 +93,13 @@ class Client { let flatParams = Client.flatten(params); for (const key in flatParams) { - form.append(key, flatParams[key]) + const value = flatParams[key]; + + if(value && value.type && value.type === 'file') { + form.append(key, value.file, { filename: value.filename }); + } else { + form.append(key, flatParams[key]); + } } headers = { diff --git a/templates/node/lib/inputFile.js.twig b/templates/node/lib/inputFile.js.twig new file mode 100644 index 0000000000..c0ba0c99b9 --- /dev/null +++ b/templates/node/lib/inputFile.js.twig @@ -0,0 +1,47 @@ +const { Readable } = require('stream'); +const fs = require('fs'); +const { promisify } = require('util'); + +class InputFile { + stream; // Content of file, readable stream + size; // Total final size of the file content + name; // File name + + static fromPath = (filePath, name) => { + const stream = fs.createReadStream(filePath); + const { size } = fs.statSync(filePath); + return new InputFile(stream, name, size); + }; + + static fromBuffer = (buffer, name) => { + const stream = Readable.from(buffer.toString()); + const size = Buffer.byteLength(buffer); + return new InputFile(stream, name, size); + }; + + static fromBlob = (blob, name) => { + const buffer = blob.arrayBuffer(); + const stream = Readable.from(buffer.toString()); + const size = Buffer.byteLength(buffer); + return new InputFile(stream, name); + }; + + static fromStream = (stream, name, size) => { + return new InputFile(stream, name, size); + }; + + static fromPlainText = (content, name) => { + const buffer = Buffer.from(content, "utf-8"); + const stream = Readable.from(buffer.toString()); + const size = Buffer.byteLength(buffer); + return new InputFile(stream, name, size); + }; + + constructor(stream, name, size) { + this.stream = stream; + this.name = name; + this.size = size; + } +} + +module.exports = InputFile; diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 5190ed83c9..63bc3c35b0 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -1,6 +1,8 @@ const Service = require('../service.js'); const {{spec.title | caseUcfirst}}Exception = require('../exception.js'); +const InputFile = require('../inputFile.js'); const client = require('../client.js'); +const Stream = require('stream'); const { promisify } = require('util'); const fs = require('fs'); @@ -34,95 +36,138 @@ class {{ service.name | caseUcfirst }} extends Service { {% for parameter in method.parameters.query %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %}.toString(){% endif %}; + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; } {% endfor %} {% for parameter in method.parameters.body %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword}}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %}.toString(){% endif %}; + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword}}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; } {% endfor %} {% if 'multipart/form-data' in method.consumes %} {% for parameter in method.parameters.all %} {% if parameter.type == 'file' %} - const { size: size } = await promisify(fs.stat)({{ parameter.name | caseCamel | escapeKeyword }}); + const size = {{ parameter.name | caseCamel | escapeKeyword }}.size; - if (size <= client.CHUNK_SIZE) { - payload['{{ parameter.name }}'] = fs.createReadStream({{ parameter.name | caseCamel | escapeKeyword }}); - - return await this.client.call('{{ method.method | caseLower }}', path, { + // TODO: Resumable upload, somehow + + const headers = { {% for parameter in method.parameters.header %} - '{{ parameter.name }}': ${{ parameter.name | caseCamel | escapeKeyword }}, + '{{ parameter.name }}': ${{ parameter.name | caseCamel | escapeKeyword }}, {% endfor %} {% for key, header in method.headers %} - '{{ key }}': '{{ header }}', + '{{ key }}': '{{ header }}', {% endfor %} - }, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); - } else { - let id = undefined; - let response = undefined; + }; - let counter = 0; - const totalCounters = Math.ceil(size / client.CHUNK_SIZE); + let id = undefined; + let response = undefined; - const headers = { -{% for parameter in method.parameters.header %} - '{{ parameter.name }}': ${{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}': '{{ header }}', -{% endfor %} - }; + let currentChunk = Buffer.from(''); + let currentChunkSize = 0; + let currentChunkStart = 0; -{% for parameter in method.parameters.all %} -{% if parameter.isUploadID %} - if({{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { - try { - response = await this.client.call('get', path + '/' + {{ parameter.name }}, headers); - counter = response.chunksUploaded; - } catch(e) { - } - } -{% endif %} -{% endfor %} + const selfClient = this.client; - for (counter; counter < totalCounters; counter++) { - const start = (counter * client.CHUNK_SIZE); - const end = Math.min((((counter * client.CHUNK_SIZE) + client.CHUNK_SIZE) - 1), size); + async function uploadChunk(lastUpload = false) { + const start = currentChunkStart; + const end = Math.min(((start + client.CHUNK_SIZE) - 1), size); + if(!lastUpload || currentChunkStart !== 0) { headers['content-range'] = 'bytes ' + start + '-' + end + '/' + size; + } - if (id) { - headers['x-{{spec.title | caseLower }}-id'] = id; - } + if (id) { + headers['x-{{spec.title | caseLower }}-id'] = id; + } + + const stream = Stream.Readable.from(currentChunk.toString()); + payload['{{ parameter.name }}'] = { type: 'file', file: stream, filename: file.name }; + + response = await selfClient.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); - const stream = fs.createReadStream({{ parameter.name | caseCamel | escapeKeyword }}, { - start, - end + if (!id) { + id = response['$id']; + } + + if (onProgress !== null) { + onProgress({ + $id: response['$id'], + progress: Math.min((start+client.CHUNK_SIZE) * client.CHUNK_SIZE, size) / size * 100, + sizeUploaded: end+1, + chunksTotal: response['chunksTotal'], + chunksUploaded: response['chunksUploaded'] }); - payload['{{ parameter.name }}'] = stream; + } - response = await this.client.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); + currentChunkStart += client.CHUNK_SIZE; + } + + return await new Promise((resolve, reject) => { + const writeStream = new Stream.Writable(); + writeStream._write = async (chunk, encoding, next) => { + // TODO: What if chunk is 50MB? We need while loop here + const chunkSize = Buffer.byteLength(chunk); + + if(chunkSize + currentChunkSize == client.CHUNK_SIZE) { + // Upload chunk + currentChunk = Buffer.concat([currentChunk, chunk]); + await uploadChunk(); + currentChunk = Buffer.from(''); + currentChunkSize = 0; + } else if(chunkSize + currentChunkSize > client.CHUNK_SIZE) { + // Upload chunk, put rest into next chunk + const bytesToUpload = client.CHUNK_SIZE - currentChunkSize; + chunk.copy(currentChunk, currentChunkSize + 1, 0, bytesToUpload); + await uploadChunk(); + currentChunk = Buffer.from(''); + chunk.copy(currentChunk, 0, 0, chunkSize - bytesToUpload); + currentChunkSize = chunkSize - bytesToUpload; + } else { + // Append into current chunk + currentChunk = Buffer.concat([currentChunk, chunk]); + currentChunkSize = chunkSize + currentChunkSize; + } + + next(); + } - if (!id) { - id = response['$id']; + writeStream.on("finish", async () => { + if(currentChunkSize > 0) { + await uploadChunk(true); } - if (onProgress !== null) { - onProgress({ - $id: response['$id'], - progress: Math.min((counter+1) * client.CHUNK_SIZE, size) / size * 100, - sizeUploaded: end+1, - chunksTotal: response['chunksTotal'], - chunksUploaded: response['chunksUploaded'] - }); + resolve(response); + }); + + writeStream.on("error", (err) => { + reject(err); + }); + + {{ parameter.name | caseCamel | escapeKeyword }}.stream.pipe(writeStream); + }); + + /* +// UPLOAD SINGLE_CHUNKED FILE +payload['{{ parameter.name }}'] = fs.createReadStream({{ parameter.name | caseCamel | escapeKeyword }}); +return await this.client.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); + +// RESUMABLE UPLOAD: +{% for parameter in method.parameters.all %} +{% if parameter.isUploadID %} + if({{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { + try { + response = await this.client.call('get', path + '/' + {{ parameter.name }}, headers); + counter = response.chunksUploaded; + } catch(e) { } } +{% endif %} +{% endfor %} - return response; - } + */ {% endif %} {% endfor %} {% else %} From 582bad6c6dfa00c62868de1a68e0a83a82a7eb4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 8 Jun 2022 11:26:10 +0000 Subject: [PATCH 037/555] Fixes after QA --- templates/node/lib/services/service.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 63bc3c35b0..f75308a091 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -83,7 +83,7 @@ class {{ service.name | caseUcfirst }} extends Service { headers['x-{{spec.title | caseLower }}-id'] = id; } - const stream = Stream.Readable.from(currentChunk.toString()); + const stream = Stream.Readable.from(currentChunk); payload['{{ parameter.name }}'] = { type: 'file', file: stream, filename: file.name }; response = await selfClient.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); From 9259fc8293e4b05d8705012a6efc7d31e0ccebf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 8 Jun 2022 12:02:34 +0000 Subject: [PATCH 038/555] Upgrade CI/CD php version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 451a7056c8..99e74d2508 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ os: linux language: php php: - - 8.0 + - 8.1 env: - SDK=Android11Java8 From a8aa50b7423114b8e689189a029575cbadb36c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 8 Jun 2022 12:54:25 +0000 Subject: [PATCH 039/555] Fix node tests --- templates/node/lib/services/service.js.twig | 41 +++++++++------------ tests/languages/node/test.js | 5 ++- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index f75308a091..9e8e489b9a 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -52,6 +52,20 @@ class {{ service.name | caseUcfirst }} extends Service { const size = {{ parameter.name | caseCamel | escapeKeyword }}.size; // TODO: Resumable upload, somehow + /* +// RESUMABLE UPLOAD PREVIOUS LOGIC: +{% for parameter in method.parameters.all %} +{% if parameter.isUploadID %} + if({{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { + try { + response = await this.client.call('get', path + '/' + {{ parameter.name }}, headers); + counter = response.chunksUploaded; + } catch(e) { + } + } +{% endif %} +{% endfor %} + */ const headers = { {% for parameter in method.parameters.header %} @@ -120,10 +134,11 @@ class {{ service.name | caseUcfirst }} extends Service { } else if(chunkSize + currentChunkSize > client.CHUNK_SIZE) { // Upload chunk, put rest into next chunk const bytesToUpload = client.CHUNK_SIZE - currentChunkSize; - chunk.copy(currentChunk, currentChunkSize + 1, 0, bytesToUpload); + const newChunkSection = chunk.slice(0, bytesToUpload); + currentChunk = Buffer.concat([currentChunk, newChunkSection]); + currentChunkSize = Buffer.byteLength(currentChunk); await uploadChunk(); - currentChunk = Buffer.from(''); - chunk.copy(currentChunk, 0, 0, chunkSize - bytesToUpload); + currentChunk = chunk.slice(bytesToUpload, undefined); currentChunkSize = chunkSize - bytesToUpload; } else { // Append into current chunk @@ -148,26 +163,6 @@ class {{ service.name | caseUcfirst }} extends Service { {{ parameter.name | caseCamel | escapeKeyword }}.stream.pipe(writeStream); }); - - /* -// UPLOAD SINGLE_CHUNKED FILE -payload['{{ parameter.name }}'] = fs.createReadStream({{ parameter.name | caseCamel | escapeKeyword }}); -return await this.client.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); - -// RESUMABLE UPLOAD: -{% for parameter in method.parameters.all %} -{% if parameter.isUploadID %} - if({{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { - try { - response = await this.client.call('get', path + '/' + {{ parameter.name }}, headers); - counter = response.chunksUploaded; - } catch(e) { - } - } -{% endif %} -{% endfor %} - - */ {% endif %} {% endfor %} {% else %} diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index 623882a364..eb68f1be2c 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -1,5 +1,6 @@ const appwrite = require('../../sdks/node/index'); +const InputFile = require('../../sdks/node/lib/inputFile'); const fs = require('fs'); async function start() { @@ -53,10 +54,10 @@ async function start() { response = await general.redirect(); console.log(response.result); - response = await general.upload('string', 123, ['string in array'], __dirname + '/../../resources/file.png'); + response = await general.upload('string', 123, ['string in array'], InputFile.fromPath(__dirname + '/../../resources/file.png', 'file.png')); console.log(response.result); - response = await general.upload('string', 123, ['string in array'], __dirname + '/../../resources/large_file.mp4'); + response = await general.upload('string', 123, ['string in array'], InputFile.fromPath(__dirname + '/../../resources/large_file.mp4', 'large_file.mp4')); console.log(response.result); try { From 242c484666584d07946b025208c385f0672b6f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 9 Jun 2022 08:43:47 +0000 Subject: [PATCH 040/555] Implement chunk segmentation --- templates/node/lib/services/service.js.twig | 57 +++++++++++++-------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 9e8e489b9a..c9894ad45a 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -122,28 +122,41 @@ class {{ service.name | caseUcfirst }} extends Service { return await new Promise((resolve, reject) => { const writeStream = new Stream.Writable(); writeStream._write = async (chunk, encoding, next) => { - // TODO: What if chunk is 50MB? We need while loop here - const chunkSize = Buffer.byteLength(chunk); - - if(chunkSize + currentChunkSize == client.CHUNK_SIZE) { - // Upload chunk - currentChunk = Buffer.concat([currentChunk, chunk]); - await uploadChunk(); - currentChunk = Buffer.from(''); - currentChunkSize = 0; - } else if(chunkSize + currentChunkSize > client.CHUNK_SIZE) { - // Upload chunk, put rest into next chunk - const bytesToUpload = client.CHUNK_SIZE - currentChunkSize; - const newChunkSection = chunk.slice(0, bytesToUpload); - currentChunk = Buffer.concat([currentChunk, newChunkSection]); - currentChunkSize = Buffer.byteLength(currentChunk); - await uploadChunk(); - currentChunk = chunk.slice(bytesToUpload, undefined); - currentChunkSize = chunkSize - bytesToUpload; - } else { - // Append into current chunk - currentChunk = Buffer.concat([currentChunk, chunk]); - currentChunkSize = chunkSize + currentChunkSize; + // Segment incoming chunk into up to 5MB chunks + const mainChunk = chunk; + const mainChunkSize = Buffer.byteLength(chunk); + + const chunksCount = Math.ceil(mainChunkSize / client.CHUNK_SIZE); + const chunks = []; + + for(let i = 0; i < chunksCount; i++) { + const chunk = chunk.slice(chunksCount * client.CHUNK_SIZE, client.CHUNK_SIZE); + chunks.push(chunk); + } + + for (const chunk of chunks) { + const chunkSize = Buffer.byteLength(chunk); + + if(chunkSize + currentChunkSize == client.CHUNK_SIZE) { + // Upload chunk + currentChunk = Buffer.concat([currentChunk, chunk]); + await uploadChunk(); + currentChunk = Buffer.from(''); + currentChunkSize = 0; + } else if(chunkSize + currentChunkSize > client.CHUNK_SIZE) { + // Upload chunk, put rest into next chunk + const bytesToUpload = client.CHUNK_SIZE - currentChunkSize; + const newChunkSection = chunk.slice(0, bytesToUpload); + currentChunk = Buffer.concat([currentChunk, newChunkSection]); + currentChunkSize = Buffer.byteLength(currentChunk); + await uploadChunk(); + currentChunk = chunk.slice(bytesToUpload, undefined); + currentChunkSize = chunkSize - bytesToUpload; + } else { + // Append into current chunk + currentChunk = Buffer.concat([currentChunk, chunk]); + currentChunkSize = chunkSize + currentChunkSize; + } } next(); From 0a695ce2ac750c6e4da5525f70c91b2537cbfae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 9 Jun 2022 09:19:45 +0000 Subject: [PATCH 041/555] Bug fix, resumable upload --- templates/node/lib/services/service.js.twig | 43 +++++++++++---------- tests/languages/node/test.js | 4 +- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index c9894ad45a..81ccc1f77d 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -51,22 +51,6 @@ class {{ service.name | caseUcfirst }} extends Service { {% if parameter.type == 'file' %} const size = {{ parameter.name | caseCamel | escapeKeyword }}.size; - // TODO: Resumable upload, somehow - /* -// RESUMABLE UPLOAD PREVIOUS LOGIC: -{% for parameter in method.parameters.all %} -{% if parameter.isUploadID %} - if({{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { - try { - response = await this.client.call('get', path + '/' + {{ parameter.name }}, headers); - counter = response.chunksUploaded; - } catch(e) { - } - } -{% endif %} -{% endfor %} - */ - const headers = { {% for parameter in method.parameters.header %} '{{ parameter.name }}': ${{ parameter.name | caseCamel | escapeKeyword }}, @@ -79,6 +63,20 @@ class {{ service.name | caseUcfirst }} extends Service { let id = undefined; let response = undefined; + let chunksUploaded = 0; + +{% for parameter in method.parameters.all %} +{% if parameter.isUploadID %} + if({{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { + try { + response = await this.client.call('get', path + '/' + {{ parameter.name }}, headers); + chunksUploaded = response.chunksUploaded; + } catch(e) { + } + } +{% endif %} +{% endfor %} + let currentChunk = Buffer.from(''); let currentChunkSize = 0; let currentChunkStart = 0; @@ -86,6 +84,11 @@ class {{ service.name | caseUcfirst }} extends Service { const selfClient = this.client; async function uploadChunk(lastUpload = false) { + if(chunksUploaded - 1 >= currentChunkStart / client.CHUNK_SIZE) { + return; + } + + // TODO: Use chunksUploaded somehow const start = currentChunkStart; const end = Math.min(((start + client.CHUNK_SIZE) - 1), size); @@ -121,16 +124,14 @@ class {{ service.name | caseUcfirst }} extends Service { return await new Promise((resolve, reject) => { const writeStream = new Stream.Writable(); - writeStream._write = async (chunk, encoding, next) => { + writeStream._write = async (mainChunk, encoding, next) => { // Segment incoming chunk into up to 5MB chunks - const mainChunk = chunk; - const mainChunkSize = Buffer.byteLength(chunk); - + const mainChunkSize = Buffer.byteLength(mainChunk); const chunksCount = Math.ceil(mainChunkSize / client.CHUNK_SIZE); const chunks = []; for(let i = 0; i < chunksCount; i++) { - const chunk = chunk.slice(chunksCount * client.CHUNK_SIZE, client.CHUNK_SIZE); + const chunk = mainChunk.slice(i * client.CHUNK_SIZE, client.CHUNK_SIZE); chunks.push(chunk); } diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index eb68f1be2c..76a31d2b18 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -81,4 +81,6 @@ async function start() { await general.empty(); } -start(); \ No newline at end of file +start().catch((err) => { + console.log(err); +}); \ No newline at end of file From 23bdd044ac909e3bf7b0bf525f2029291758d5a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 9 Jun 2022 09:19:57 +0000 Subject: [PATCH 042/555] Previous commit missing change --- templates/node/lib/services/service.js.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 81ccc1f77d..3487c7974c 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -88,7 +88,6 @@ class {{ service.name | caseUcfirst }} extends Service { return; } - // TODO: Use chunksUploaded somehow const start = currentChunkStart; const end = Math.min(((start + client.CHUNK_SIZE) - 1), size); From 2018e6ca3a12f0e4eccc2bba0fa90815fb306068 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 9 Jun 2022 15:54:38 +0100 Subject: [PATCH 043/555] Update templates/cli/lib/commands/init.js.twig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matej Bačo --- templates/cli/lib/commands/init.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index 0847db49e1..7c0f32c628 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -97,7 +97,7 @@ const initFunction = async () => { childProcess.execSync(gitPullCommands, { stdio: 'pipe', cwd: functionDir }); fs.rmSync(path.join(functionDir, ".git"), { recursive: true }); - const copyRecursiveSync = (src, dest) => { + const copyRecursiveSync = (src, dest) => { let exists = fs.existsSync(src); let stats = exists && fs.statSync(src); let isDirectory = exists && stats.isDirectory(); From 52bca450ee4e00cdcd43aedfdb68c146834ee616 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 10 Jun 2022 07:34:36 +0000 Subject: [PATCH 044/555] input file --- templates/php/src/InputFile.php.twig | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 templates/php/src/InputFile.php.twig diff --git a/templates/php/src/InputFile.php.twig b/templates/php/src/InputFile.php.twig new file mode 100644 index 0000000000..a3a71fb767 --- /dev/null +++ b/templates/php/src/InputFile.php.twig @@ -0,0 +1,47 @@ +data; + } + + public function getPath(): ?string + { + return $this->path; + } + + public function getMimeType(): ?string + { + return $this->mimeType; + } + + public function getFilename(): ?string + { + return $this->filename; + } + + public static function withPath(string $path, ?string $mimeType, ?string $filename) + { + $instance = new InputFile(); + $instance->path = $path; + $instance->mimeType = $mimeType; + $instance->filename = $filename; + } + + public static function withData(string $data, ?string $mimeType, ?string $filename) + { + $instance = new InputFile(); + $instance->data = $data; + $instance->mimeType = $mimeType; + $instance->filename = $filename; + } +} \ No newline at end of file From 38de8cdcc82d3fa238428d3e46390ed53245442e Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 10 Jun 2022 07:35:57 +0000 Subject: [PATCH 045/555] inputfile template render --- src/SDK/Language/PHP.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index a5d789d232..d4d2926d9f 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -183,6 +183,12 @@ public function getFiles() 'template' => 'php/src/Query.php.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'src/{{ spec.title | caseUcfirst}}/InputFile.php', + 'template' => 'php/src/InputFile.php.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'src/{{ spec.title | caseUcfirst}}/{{ spec.title | caseUcfirst}}Exception.php', From d814b3f9bc7154d830dfe797e03a03c3553cece0 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 10 Jun 2022 08:17:53 +0000 Subject: [PATCH 046/555] fixes an updates --- composer.lock | 231 +++++++++++++------- src/SDK/Language/PHP.php | 2 +- templates/php/src/InputFile.php.twig | 8 +- templates/php/src/Services/Service.php.twig | 82 +++++-- tests/languages/php/test.php | 6 +- 5 files changed, 219 insertions(+), 110 deletions(-) diff --git a/composer.lock b/composer.lock index ac22884f93..4e905a1387 100644 --- a/composer.lock +++ b/composer.lock @@ -131,16 +131,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", "shasum": "" }, "require": { @@ -155,7 +155,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -193,7 +193,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" }, "funding": [ { @@ -209,20 +209,20 @@ "type": "tidelift" } ], - "time": "2021-10-20T20:35:02+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", "shasum": "" }, "require": { @@ -237,7 +237,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -276,7 +276,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" }, "funding": [ { @@ -292,20 +292,20 @@ "type": "tidelift" } ], - "time": "2021-11-30T18:21:41+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "twig/twig", - "version": "v3.3.10", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "8442df056c51b706793adf80a9fd363406dd3674" + "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/8442df056c51b706793adf80a9fd363406dd3674", - "reference": "8442df056c51b706793adf80a9fd363406dd3674", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/e939eae92386b69b49cfa4599dd9bead6bf4a342", + "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342", "shasum": "" }, "require": { @@ -320,7 +320,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -356,7 +356,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.3.10" + "source": "https://github.com/twigphp/Twig/tree/v3.4.1" }, "funding": [ { @@ -368,7 +368,7 @@ "type": "tidelift" } ], - "time": "2022-04-06T06:47:41+00:00" + "time": "2022-05-17T05:48:52+00:00" } ], "packages-dev": [ @@ -591,16 +591,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.13.2", + "version": "v4.14.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", "shasum": "" }, "require": { @@ -641,9 +641,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" }, - "time": "2021-11-30T19:35:32+00:00" + "time": "2022-05-31T20:59:12+00:00" }, { "name": "phar-io/manifest", @@ -2423,20 +2423,21 @@ }, { "name": "symfony/console", - "version": "v6.0.8", + "version": "v6.1.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0d00aa289215353aa8746a31d101f8e60826285c" + "reference": "6187424023fbffcd757789aeb517c9161b1eabee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0d00aa289215353aa8746a31d101f8e60826285c", - "reference": "0d00aa289215353aa8746a31d101f8e60826285c", + "url": "https://api.github.com/repos/symfony/console/zipball/6187424023fbffcd757789aeb517c9161b1eabee", + "reference": "6187424023fbffcd757789aeb517c9161b1eabee", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^1.1|^2|^3", "symfony/string": "^5.4|^6.0" @@ -2498,7 +2499,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.0.8" + "source": "https://github.com/symfony/console/tree/v6.1.1" }, "funding": [ { @@ -2514,20 +2515,87 @@ "type": "tidelift" } ], - "time": "2022-04-20T15:01:42+00:00" + "time": "2022-06-08T14:02:09+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-02-25T11:15:52+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" + "reference": "433d05519ce6990bf3530fba6957499d327395c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", + "reference": "433d05519ce6990bf3530fba6957499d327395c2", "shasum": "" }, "require": { @@ -2539,7 +2607,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2579,7 +2647,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" }, "funding": [ { @@ -2595,20 +2663,20 @@ "type": "tidelift" } ], - "time": "2021-11-23T21:10:46+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + "reference": "219aa369ceff116e673852dce47c3a41794c14bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", + "reference": "219aa369ceff116e673852dce47c3a41794c14bd", "shasum": "" }, "require": { @@ -2620,7 +2688,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2663,7 +2731,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" }, "funding": [ { @@ -2679,24 +2747,24 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/process", - "version": "v6.0.8", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "d074154ea8b1443a96391f6e39f9e547b2dd01b9" + "reference": "318718453c2be58266f1a9e74063d13cb8dd4165" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/d074154ea8b1443a96391f6e39f9e547b2dd01b9", - "reference": "d074154ea8b1443a96391f6e39f9e547b2dd01b9", + "url": "https://api.github.com/repos/symfony/process/zipball/318718453c2be58266f1a9e74063d13cb8dd4165", + "reference": "318718453c2be58266f1a9e74063d13cb8dd4165", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=8.1" }, "type": "library", "autoload": { @@ -2724,7 +2792,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.0.8" + "source": "https://github.com/symfony/process/tree/v6.1.0" }, "funding": [ { @@ -2740,24 +2808,24 @@ "type": "tidelift" } ], - "time": "2022-04-12T16:11:42+00:00" + "time": "2022-05-11T12:12:29+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.0.1", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c" + "reference": "d66cd8ab656780f62c4215b903a420eb86358957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e517458f278c2131ca9f262f8fbaf01410f2c65c", - "reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d66cd8ab656780f62c4215b903a420eb86358957", + "reference": "d66cd8ab656780f62c4215b903a420eb86358957", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "psr/container": "^2.0" }, "conflict": { @@ -2769,7 +2837,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.1-dev" }, "thanks": { "name": "symfony/contracts", @@ -2779,7 +2847,10 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2806,7 +2877,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.0.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.1.0" }, "funding": [ { @@ -2822,24 +2893,24 @@ "type": "tidelift" } ], - "time": "2022-03-13T20:10:05+00:00" + "time": "2022-05-07T08:07:09+00:00" }, { "name": "symfony/string", - "version": "v6.0.8", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d" + "reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", - "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", + "url": "https://api.github.com/repos/symfony/string/zipball/d3edc75baf9f1d4f94879764dda2e1ac33499529", + "reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -2891,7 +2962,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.8" + "source": "https://github.com/symfony/string/tree/v6.1.0" }, "funding": [ { @@ -2907,7 +2978,7 @@ "type": "tidelift" } ], - "time": "2022-04-22T08:18:02+00:00" + "time": "2022-04-22T08:18:23+00:00" }, { "name": "theseer/tokenizer", @@ -2961,21 +3032,21 @@ }, { "name": "webmozart/assert", - "version": "1.10.0", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" + "ext-ctype": "*", + "php": "^7.2 || ^8.0" }, "conflict": { "phpstan/phpstan": "<0.12.20", @@ -3013,9 +3084,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" + "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, - "time": "2021-03-09T10:59:23+00:00" + "time": "2022-06-03T18:03:27+00:00" } ], "aliases": [], @@ -3030,5 +3101,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index d4d2926d9f..f9a5be25df 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -228,7 +228,7 @@ public function getTypeName($type) $type = 'array'; break; case self::TYPE_FILE: - $type = 'string'; + $type = 'InputFile'; break; } diff --git a/templates/php/src/InputFile.php.twig b/templates/php/src/InputFile.php.twig index a3a71fb767..29f85b4f98 100644 --- a/templates/php/src/InputFile.php.twig +++ b/templates/php/src/InputFile.php.twig @@ -1,5 +1,5 @@ filename; } - public static function withPath(string $path, ?string $mimeType, ?string $filename) + public static function withPath(string $path, ?string $mimeType = null, ?string $filename = null) { $instance = new InputFile(); $instance->path = $path; $instance->mimeType = $mimeType; $instance->filename = $filename; + return $instance; } - public static function withData(string $data, ?string $mimeType, ?string $filename) + public static function withData(string $data, ?string $mimeType = null, ?string $filename = null) { $instance = new InputFile(); $instance->data = $data; $instance->mimeType = $mimeType; $instance->filename = $filename; + return $instance; } } \ No newline at end of file diff --git a/templates/php/src/Services/Service.php.twig b/templates/php/src/Services/Service.php.twig index 7e4d6ee022..6fbea7e8dd 100644 --- a/templates/php/src/Services/Service.php.twig +++ b/templates/php/src/Services/Service.php.twig @@ -5,6 +5,7 @@ namespace {{ spec.title | caseUcfirst }}\Services; use {{ spec.title | caseUcfirst }}\{{spec.title | caseUcfirst}}Exception; use {{ spec.title | caseUcfirst }}\Client; use {{ spec.title | caseUcfirst }}\Service; +use {{ spec.title | caseUcfirst }}\InputFile; class {{ service.name | caseUcfirst }} extends Service { @@ -58,20 +59,40 @@ class {{ service.name | caseUcfirst }} extends Service {% if 'multipart/form-data' in method.consumes %} {% for parameter in method.parameters.all %} {% if parameter.type == 'file' %} - $size = filesize(${{ parameter.name | caseCamel }}); - $mimeType = mime_content_type(${{ parameter.name | caseCamel }}); - $postedName = basename(${{ parameter.name | caseCamel }}); - //send single file if size is less than or equal to 5MB - if ($size <= Client::CHUNK_SIZE) { - $params['{{ parameter.name }}'] = new \CURLFile(${{ parameter.name | caseCamel }}, $mimeType, $postedName); - return $this->client->call(Client::METHOD_{{ method.method | caseUpper }}, $path, [ -{% for param in method.parameters.header %} - '{{ param.name }}' => ${{ param.name | caseCamel }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}' => '{{ header }}', -{% endfor %} - ], $params); + $size = 0; + $mimeType = null; + $postedName = null; + if(empty(${{ parameter.name | caseCamel }}->getPath())) { + $size = strlen(${{ parameter.name | caseCamel }}->getData()); + $mimeType = ${{ parameter.name | caseCamel }}->getMimeType(); + $postedName = ${{ parameter.name | caseCamel }}->getFilename(); + if ($size <= Client::CHUNK_SIZE) { + $params['{{ parameter.name | caseCamel }}'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode(${{ parameter.name | caseCamel }}->getData()), $mimeType, $postedName); + return $this->client->call(Client::METHOD_POST, $path, [ + {% for param in method.parameters.header %} + '{{ param.name }}' => ${{ param.name | caseCamel }}, + {% endfor %} + {% for key, header in method.headers %} + '{{ key }}' => '{{ header }}', + {% endfor %} + ], $params); + } + } else { + $size = filesize(${{ parameter.name | caseCamel }}->getPath()); + $mimeType = ${{ parameter.name | caseCamel }}->getMimeType() ?? mime_content_type(${{ parameter.name | caseCamel }}->getPath()); + $postedName = ${{ parameter.name | caseCamel }}->getFilename() ?? basename(${{ parameter.name | caseCamel }}->getPath()); + //send single file if size is less than or equal to 5MB + if ($size <= Client::CHUNK_SIZE) { + $params['{{ parameter.name }}'] = new \CURLFile(${{ parameter.name | caseCamel }}->getPath(), $mimeType, $postedName); + return $this->client->call(Client::METHOD_{{ method.method | caseUpper }}, $path, [ + {% for param in method.parameters.header %} + '{{ param.name }}' => ${{ param.name | caseCamel }}, + {% endfor %} + {% for key, header in method.headers %} + '{{ key }}' => '{{ header }}', + {% endfor %} + ], $params); + } } $id = ''; @@ -79,22 +100,33 @@ class {{ service.name | caseUcfirst }} extends Service {% for parameter in method.parameters.all %} {% if parameter.isUploadID %} - if(${{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { - try { - $response = $this->client->call(Client::METHOD_GET, new URL($path . '/' . {{ parameter.name }}), headers); - $counter = $response['chunksUploaded'] ?? 0; - } catch(\Exception $e) { - } + if(${{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { + try { + $response = $this->client->call(Client::METHOD_GET, $path . '/' . ${{ parameter.name }},); + $counter = $response['chunksUploaded'] ?? 0; + } catch(\Exception $e) { } + } {% endif %} {% endfor %} $headers = ['content-type' => 'multipart/form-data']; - $handle = @fopen(${{ parameter.name | caseCamel }}, "rb"); + $handle = null; + + if(!empty(${{parameter.name}}->getPath())) { + $handle = @fopen(${{parameter.name}}->getPath(), "rb"); + } + $start = $counter * Client::CHUNK_SIZE; while ($start < $size) { - fseek($handle, $start); - $params['{{ parameter.name }}'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode(@fread($handle, Client::CHUNK_SIZE)), $mimeType, $postedName); + $chunk = ''; + if(!empty($handle)) { + fseek($handle, $start); + $chunk = @fread($handle, Client::CHUNK_SIZE); + } else { + $chunk = substr($file->getData(), $start, Client::CHUNK_SIZE); + } + $params['{{ parameter.name }}'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($chunk), $mimeType, $postedName); $headers['content-range'] = 'bytes ' . ($counter * Client::CHUNK_SIZE) . '-' . min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size) . '/' . $size; if(!empty($id)) { $headers['x-{{spec.title | caseLower }}-id'] = $id; @@ -115,7 +147,9 @@ class {{ service.name | caseUcfirst }} extends Service ]); } } - @fclose($handle); + if(!empty($handle)) { + @fclose($handle); + } return $response; {% endif %} {% endfor %} diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index f0dea23ba4..614a3a5e58 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -2,6 +2,7 @@ include __DIR__ . '/../../sdks/php/src/Appwrite/Client.php'; include __DIR__ . '/../../sdks/php/src/Appwrite/Service.php'; +include __DIR__ . '/../../sdks/php/src/Appwrite/InputFile.php'; include __DIR__ . '/../../sdks/php/src/Appwrite/AppwriteException.php'; include __DIR__ . '/../../sdks/php/src/Appwrite/Services/Foo.php'; include __DIR__ . '/../../sdks/php/src/Appwrite/Services/Bar.php'; @@ -9,6 +10,7 @@ use Appwrite\AppwriteException; use Appwrite\Client; +use Appwrite\InputFile; use Appwrite\Services\Bar; use Appwrite\Services\Foo; use Appwrite\Services\General; @@ -59,10 +61,10 @@ $response = $general->redirect(); echo "{$response['result']}\n"; -$response = $general->upload('string', 123, ['string in array'], __DIR__ . '/../../resources/file.png'); +$response = $general->upload('string', 123, ['string in array'], InputFile::withPath(__DIR__ .'/../../resources/file.png')); echo "{$response['result']}\n"; -$response = $general->upload('string', 123, ['string in array'], __DIR__ . '/../../resources/large_file.mp4'); +$response = $general->upload('string', 123, ['string in array'], InputFile::withPath(__DIR__ .'/../../resources/large_file.mp4')); echo "{$response['result']}\n"; try { From cd839f4a3a8dad817985ea5bae0236ba676b0217 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 10 Jun 2022 09:25:44 +0100 Subject: [PATCH 047/555] Add suggestions to git errors with init command --- templates/cli/lib/commands/init.js.twig | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index 7c0f32c628..ea61f6d038 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -92,9 +92,20 @@ const initFunction = async () => { } // Execute the child process but do not print any std output - childProcess.execSync(gitInitCommands, { stdio: 'pipe', cwd: functionDir }); - - childProcess.execSync(gitPullCommands, { stdio: 'pipe', cwd: functionDir }); + try { + childProcess.execSync(gitInitCommands, { stdio: 'pipe', cwd: functionDir }); + + childProcess.execSync(gitPullCommands, { stdio: 'pipe', cwd: functionDir }); + } catch (error) { + // Specialised errors with recommended actions to take + if (error.message.includes('error: unknown option `--sparse')) { + throw new Error(`Error: ${error.message} \n\n Suggestion: Try updating your git to the latest version, then trying to run this command again.`) + } else if (error.message.includes('is not recognized as an internal or external command,') || error.message.includes('command not found')) { + throw new Error(`Error: ${error.message} \n\n Suggestion: It appears that git is not installed, try installing git then trying to run this command again.`) + } else { + throw error; + } + } fs.rmSync(path.join(functionDir, ".git"), { recursive: true }); const copyRecursiveSync = (src, dest) => { From 69db8be5b3c798fa4dd877ad8f243405344edef5 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 10 Jun 2022 09:53:45 +0100 Subject: [PATCH 048/555] Update init.js.twig --- templates/cli/lib/commands/init.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index ea61f6d038..900ac3365a 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -98,7 +98,7 @@ const initFunction = async () => { childProcess.execSync(gitPullCommands, { stdio: 'pipe', cwd: functionDir }); } catch (error) { // Specialised errors with recommended actions to take - if (error.message.includes('error: unknown option `--sparse')) { + if (error.message.includes('error: unknown option`)) { throw new Error(`Error: ${error.message} \n\n Suggestion: Try updating your git to the latest version, then trying to run this command again.`) } else if (error.message.includes('is not recognized as an internal or external command,') || error.message.includes('command not found')) { throw new Error(`Error: ${error.message} \n\n Suggestion: It appears that git is not installed, try installing git then trying to run this command again.`) From 017b825ad3b1162076db7c37eebd33f063f4b005 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 10 Jun 2022 09:56:45 +0100 Subject: [PATCH 049/555] Update init.js.twig --- templates/cli/lib/commands/init.js.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index 900ac3365a..ef93fb0710 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -98,10 +98,10 @@ const initFunction = async () => { childProcess.execSync(gitPullCommands, { stdio: 'pipe', cwd: functionDir }); } catch (error) { // Specialised errors with recommended actions to take - if (error.message.includes('error: unknown option`)) { - throw new Error(`Error: ${error.message} \n\n Suggestion: Try updating your git to the latest version, then trying to run this command again.`) + if (error.message.includes('error: unknown option')) { + throw new Error(`${error.message} \n\nSuggestion: Try updating your git to the latest version, then trying to run this command again.`) } else if (error.message.includes('is not recognized as an internal or external command,') || error.message.includes('command not found')) { - throw new Error(`Error: ${error.message} \n\n Suggestion: It appears that git is not installed, try installing git then trying to run this command again.`) + throw new Error(`${error.message} \n\nSuggestion: It appears that git is not installed, try installing git then trying to run this command again.`) } else { throw error; } From 6dfebe2fb96f14ce47bcec8a3e9b46e14b830e07 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 12 Jun 2022 04:34:46 +0000 Subject: [PATCH 050/555] update php version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 451a7056c8..99e74d2508 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ os: linux language: php php: - - 8.0 + - 8.1 env: - SDK=Android11Java8 From ec4e4419ac5b2d452a89161031870eeea59c26ea Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 12 Jun 2022 10:06:48 +0000 Subject: [PATCH 051/555] Flutter template refactoring --- templates/flutter/base/api.twig | 34 +++++++ templates/flutter/base/file.twig | 49 ++++++++++ templates/flutter/base/macros.twig | 5 + templates/flutter/base/oauth.twig | 44 +++++++++ .../flutter/lib/services/service.dart.twig | 96 ++----------------- 5 files changed, 139 insertions(+), 89 deletions(-) create mode 100644 templates/flutter/base/api.twig create mode 100644 templates/flutter/base/file.twig create mode 100644 templates/flutter/base/macros.twig create mode 100644 templates/flutter/base/oauth.twig diff --git a/templates/flutter/base/api.twig b/templates/flutter/base/api.twig new file mode 100644 index 0000000000..ee5e88246b --- /dev/null +++ b/templates/flutter/base/api.twig @@ -0,0 +1,34 @@ +{% import "flutter/base/macros.twig" as macros %} + + final Map params = { +{% for parameter in method.parameters.query %} + {{ macros.map_parameter(parameter) }} +{% endfor %} +{% for parameter in method.parameters.body %} + {{ macros.map_parameter(parameter) }} +{% endfor %} +{% if method.type == 'location' %} +{% if method.security|length > 0 %} +{% for node in method.security %} +{% for key,header in node|keys %} + '{{header|caseLower}}': client.config['{{header|caseLower}}'], +{% endfor %} +{% endfor %} +{% endif %} +{% endif %} + }; + +{% if method.type == 'location' %} + final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, responseType: ResponseType.bytes); + return res.data; +{% else %} + final Map headers = { +{% for key, header in method.headers %} + '{{ key }}': '{{ header }}', +{% endfor %} + }; + + final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); + + return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst}}.fromMap(res.data){% else %} res.data{% endif %}; +{% endif %} \ No newline at end of file diff --git a/templates/flutter/base/file.twig b/templates/flutter/base/file.twig new file mode 100644 index 0000000000..d1fdb3817d --- /dev/null +++ b/templates/flutter/base/file.twig @@ -0,0 +1,49 @@ +{% import "flutter/base/macros.twig" as macros %} + + final Map params = { +{% for parameter in method.parameters.query %} + {{ macros.map_parameter(parameter) }} +{% endfor %} +{% for parameter in method.parameters.body %} + {{ macros.map_parameter(parameter) }} +{% endfor %} + }; + + final Map headers = { +{% for key, header in method.headers %} + '{{ key }}': '{{ header }}', +{% endfor %} + }; + +{% if 'multipart/form-data' in method.consumes %} + dynamic res; + if(kIsWeb) { +{% for parameter in method.parameters.all %} +{% if parameter.type == 'file' %} + params['{{ parameter.name }}'] = {{ parameter.name }}.file; +{% endif %} +{% endfor %} + res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); + } else { + String idParamName = ''; +{% for parameter in method.parameters.all %} +{% if parameter.type == 'file' %} + final paramName = '{{ parameter.name }}'; +{% endif %} +{% if parameter.isUploadID %} + idParamName = '{{ parameter.name }}'; +{% endif %} +{% endfor %} + res = await chunkedUpload( + client: client, + path: path, + params: params, + paramName: paramName, + idParamName: idParamName, + headers: headers, + onProgress: onProgress, + ); + } + + return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst}}.fromMap(res.data){% else %} res.data{% endif %}; +{% endif %} diff --git a/templates/flutter/base/macros.twig b/templates/flutter/base/macros.twig new file mode 100644 index 0000000000..45e95820c5 --- /dev/null +++ b/templates/flutter/base/macros.twig @@ -0,0 +1,5 @@ +{% macro parameter(parameter) %}{% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | escapeKeyword }}{% endmacro %} +{% macro method_parameters(parameters, consumes) %} +{% if parameters.all|length > 0 %}{{ '{' }}{% for parameter in parameters.all %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} +{% endmacro %} +{% macro map_parameter(parameter) %}'{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }},{% endmacro %} \ No newline at end of file diff --git a/templates/flutter/base/oauth.twig b/templates/flutter/base/oauth.twig new file mode 100644 index 0000000000..369131e8eb --- /dev/null +++ b/templates/flutter/base/oauth.twig @@ -0,0 +1,44 @@ +{% import "flutter/base/macros.twig" as macros %} + + final Map params = { +{% for parameter in method.parameters.query %} + {{ macros.map_parameter(parameter) }} +{% endfor %} +{% for parameter in method.parameters.body %} + {{ macros.map_parameter(parameter) }} +{% endfor %} +{% if method.type == 'webAuth' %} +{% if method.security|length > 0 %} +{% for node in method.security %} +{% for key,header in node|keys %} + '{{header|caseLower}}': client.config['{{header|caseLower}}'], +{% endfor %} +{% endfor %} +{% endif %} +{% endif %} + }; + +{% if method.type == 'webAuth' %} + + final List query = []; + + params.forEach((key, value) { + if (value is List) { + for (var item in value) { + query.add(Uri.encodeComponent(key + '[]') + '=' + Uri.encodeComponent(item)); + } + } else if(value != null) { + query.add(Uri.encodeComponent(key) + '=' + Uri.encodeComponent(value)); + } + }); + + Uri endpoint = Uri.parse(client.endPoint); + Uri url = Uri(scheme: endpoint.scheme, + host: endpoint.host, + port: endpoint.port, + path: endpoint.path + path, + query: query.join('&') + ); + + return client.webAuth(url); +{% endif %} \ No newline at end of file diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index 23cc10289a..7e99b15f38 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -1,10 +1,6 @@ part of {{ language.params.packageName }}; -{% macro parameter(parameter) %}{% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | escapeKeyword }}{% endmacro %} -{% macro method_parameters(parameters, consumes) %} -{% if parameters.all|length > 0 %}{{ '{' }}{% for parameter in parameters.all %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} -{% endmacro %} -{% macro map_parameter(parameter) %}'{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }},{% endmacro %} +{% import "flutter/base/macros.twig" as macros %} {%if service.description %} {{ service.description|dartComment}} @@ -19,95 +15,17 @@ class {{ service.name | caseUcfirst }} extends Service { {{ method.description|dartComment }} /// {% endif %} - {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters, method.consumes) }}) async { + {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ macros.method_parameters(method.parameters, method.consumes) }}) async { {% if method.parameters.path | length > 0 %}final{% else %}const{% endif %} String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; - final Map params = { -{% for parameter in method.parameters.query %} - {{ _self.map_parameter(parameter) }} -{% endfor %} -{% for parameter in method.parameters.body %} - {{ _self.map_parameter(parameter) }} -{% endfor %} -{% if method.type == 'webAuth' or method.type == 'location' %} -{% if method.security|length > 0 %} -{% for node in method.security %} -{% for key,header in node|keys %} - '{{header|caseLower}}': client.config['{{header|caseLower}}'], -{% endfor %} -{% endfor %} -{% endif %} -{% endif %} - }; - -{% if method.type == 'webAuth' %} - - final List query = []; - - params.forEach((key, value) { - if (value is List) { - for (var item in value) { - query.add(Uri.encodeComponent(key + '[]') + '=' + Uri.encodeComponent(item)); - } - } else if(value != null) { - query.add(Uri.encodeComponent(key) + '=' + Uri.encodeComponent(value)); - } - }); - - Uri endpoint = Uri.parse(client.endPoint); - Uri url = Uri(scheme: endpoint.scheme, - host: endpoint.host, - port: endpoint.port, - path: endpoint.path + path, - query: query.join('&') - ); - - return client.webAuth(url); - -{% elseif method.type == 'location' %} - final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, responseType: ResponseType.bytes); - return res.data; -{% else %} - final Map headers = { -{% for key, header in method.headers %} - '{{ key }}': '{{ header }}', -{% endfor %} - }; - {% if 'multipart/form-data' in method.consumes %} - dynamic res; - if(kIsWeb) { -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - params['{{ parameter.name }}'] = {{ parameter.name }}.file; -{% endif %} -{% endfor %} - res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); - } else { - String idParamName = ''; -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - final paramName = '{{ parameter.name }}'; -{% endif %} -{% if parameter.isUploadID %} - idParamName = '{{ parameter.name }}'; -{% endif %} -{% endfor %} - res = await chunkedUpload( - client: client, - path: path, - params: params, - paramName: paramName, - idParamName: idParamName, - headers: headers, - onProgress: onProgress, - ); - } +{{ include('flutter/base/file.twig') }} +{% elseif method.type == 'webAuth' %} +{{ include('flutter/base/oauth.twig') }} {% else %} - final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); -{% endif %} - return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst}}.fromMap(res.data){% else %} res.data{% endif %}; +{{ include('flutter/base/api.twig') }} {% endif %} + } {% endfor %} } \ No newline at end of file From 9c1892da96311075fda2d3ee7045aec7f37bb17f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 13 Jun 2022 05:18:32 +0000 Subject: [PATCH 052/555] location method template separated --- templates/flutter/base/api.twig | 14 ------------- templates/flutter/base/location.twig | 20 +++++++++++++++++++ .../flutter/lib/services/service.dart.twig | 2 ++ 3 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 templates/flutter/base/location.twig diff --git a/templates/flutter/base/api.twig b/templates/flutter/base/api.twig index ee5e88246b..68ceb9a7ca 100644 --- a/templates/flutter/base/api.twig +++ b/templates/flutter/base/api.twig @@ -7,21 +7,8 @@ {% for parameter in method.parameters.body %} {{ macros.map_parameter(parameter) }} {% endfor %} -{% if method.type == 'location' %} -{% if method.security|length > 0 %} -{% for node in method.security %} -{% for key,header in node|keys %} - '{{header|caseLower}}': client.config['{{header|caseLower}}'], -{% endfor %} -{% endfor %} -{% endif %} -{% endif %} }; -{% if method.type == 'location' %} - final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, responseType: ResponseType.bytes); - return res.data; -{% else %} final Map headers = { {% for key, header in method.headers %} '{{ key }}': '{{ header }}', @@ -31,4 +18,3 @@ final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst}}.fromMap(res.data){% else %} res.data{% endif %}; -{% endif %} \ No newline at end of file diff --git a/templates/flutter/base/location.twig b/templates/flutter/base/location.twig new file mode 100644 index 0000000000..6ed854ee4e --- /dev/null +++ b/templates/flutter/base/location.twig @@ -0,0 +1,20 @@ +{% import "flutter/base/macros.twig" as macros %} + + final Map params = { +{% for parameter in method.parameters.query %} + {{ macros.map_parameter(parameter) }} +{% endfor %} +{% for parameter in method.parameters.body %} + {{ macros.map_parameter(parameter) }} +{% endfor %} +{% if method.security|length > 0 %} +{% for node in method.security %} +{% for key,header in node|keys %} + '{{header|caseLower}}': client.config['{{header|caseLower}}'], +{% endfor %} +{% endfor %} +{% endif %} + }; + + final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, responseType: ResponseType.bytes); + return res.data; \ No newline at end of file diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index 7e99b15f38..1c9d183b60 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -22,6 +22,8 @@ class {{ service.name | caseUcfirst }} extends Service { {{ include('flutter/base/file.twig') }} {% elseif method.type == 'webAuth' %} {{ include('flutter/base/oauth.twig') }} +{% elseif method.type == 'location' %} +{{ include('flutter/base/location.twig') }} {% else %} {{ include('flutter/base/api.twig') }} {% endif %} From 9d39a4319bd794fcaf10046f98474e92bdd7dfd4 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 14 Jun 2022 01:33:09 +0000 Subject: [PATCH 053/555] more refactor --- templates/flutter/base/macros.twig | 5 ----- templates/flutter/base/{ => requests}/api.twig | 6 ++---- templates/flutter/base/{ => requests}/file.twig | 8 +++----- .../flutter/base/{ => requests}/location.twig | 6 ++---- templates/flutter/base/{ => requests}/oauth.twig | 6 ++---- templates/flutter/lib/services/service.dart.twig | 16 +++++++++------- 6 files changed, 18 insertions(+), 29 deletions(-) delete mode 100644 templates/flutter/base/macros.twig rename templates/flutter/base/{ => requests}/api.twig (78%) rename templates/flutter/base/{ => requests}/file.twig (86%) rename templates/flutter/base/{ => requests}/location.twig (76%) rename templates/flutter/base/{ => requests}/oauth.twig (87%) diff --git a/templates/flutter/base/macros.twig b/templates/flutter/base/macros.twig deleted file mode 100644 index 45e95820c5..0000000000 --- a/templates/flutter/base/macros.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% macro parameter(parameter) %}{% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | escapeKeyword }}{% endmacro %} -{% macro method_parameters(parameters, consumes) %} -{% if parameters.all|length > 0 %}{{ '{' }}{% for parameter in parameters.all %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} -{% endmacro %} -{% macro map_parameter(parameter) %}'{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }},{% endmacro %} \ No newline at end of file diff --git a/templates/flutter/base/api.twig b/templates/flutter/base/requests/api.twig similarity index 78% rename from templates/flutter/base/api.twig rename to templates/flutter/base/requests/api.twig index 68ceb9a7ca..fdd9e24481 100644 --- a/templates/flutter/base/api.twig +++ b/templates/flutter/base/requests/api.twig @@ -1,11 +1,9 @@ -{% import "flutter/base/macros.twig" as macros %} - final Map params = { {% for parameter in method.parameters.query %} - {{ macros.map_parameter(parameter) }} + '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, {% endfor %} {% for parameter in method.parameters.body %} - {{ macros.map_parameter(parameter) }} + '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, {% endfor %} }; diff --git a/templates/flutter/base/file.twig b/templates/flutter/base/requests/file.twig similarity index 86% rename from templates/flutter/base/file.twig rename to templates/flutter/base/requests/file.twig index d1fdb3817d..6e859099e3 100644 --- a/templates/flutter/base/file.twig +++ b/templates/flutter/base/requests/file.twig @@ -1,11 +1,9 @@ -{% import "flutter/base/macros.twig" as macros %} - - final Map params = { + final Map params = { {% for parameter in method.parameters.query %} - {{ macros.map_parameter(parameter) }} + '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, {% endfor %} {% for parameter in method.parameters.body %} - {{ macros.map_parameter(parameter) }} + '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, {% endfor %} }; diff --git a/templates/flutter/base/location.twig b/templates/flutter/base/requests/location.twig similarity index 76% rename from templates/flutter/base/location.twig rename to templates/flutter/base/requests/location.twig index 6ed854ee4e..38a81eae05 100644 --- a/templates/flutter/base/location.twig +++ b/templates/flutter/base/requests/location.twig @@ -1,11 +1,9 @@ -{% import "flutter/base/macros.twig" as macros %} - final Map params = { {% for parameter in method.parameters.query %} - {{ macros.map_parameter(parameter) }} + '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, {% endfor %} {% for parameter in method.parameters.body %} - {{ macros.map_parameter(parameter) }} + '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, {% endfor %} {% if method.security|length > 0 %} {% for node in method.security %} diff --git a/templates/flutter/base/oauth.twig b/templates/flutter/base/requests/oauth.twig similarity index 87% rename from templates/flutter/base/oauth.twig rename to templates/flutter/base/requests/oauth.twig index 369131e8eb..bf0989ec71 100644 --- a/templates/flutter/base/oauth.twig +++ b/templates/flutter/base/requests/oauth.twig @@ -1,11 +1,9 @@ -{% import "flutter/base/macros.twig" as macros %} - final Map params = { {% for parameter in method.parameters.query %} - {{ macros.map_parameter(parameter) }} + '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, {% endfor %} {% for parameter in method.parameters.body %} - {{ macros.map_parameter(parameter) }} + '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, {% endfor %} {% if method.type == 'webAuth' %} {% if method.security|length > 0 %} diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index 1c9d183b60..e253f1cfbd 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -1,6 +1,8 @@ part of {{ language.params.packageName }}; - -{% import "flutter/base/macros.twig" as macros %} +{% macro parameter(parameter) %}{% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | escapeKeyword }}{% endmacro %} +{% macro method_parameters(parameters, consumes) %} +{% if parameters.all|length > 0 %}{{ '{' }}{% for parameter in parameters.all %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} +{% endmacro %} {%if service.description %} {{ service.description|dartComment}} @@ -15,17 +17,17 @@ class {{ service.name | caseUcfirst }} extends Service { {{ method.description|dartComment }} /// {% endif %} - {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ macros.method_parameters(method.parameters, method.consumes) }}) async { + {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters, method.consumes) }}) async { {% if method.parameters.path | length > 0 %}final{% else %}const{% endif %} String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; {% if 'multipart/form-data' in method.consumes %} -{{ include('flutter/base/file.twig') }} +{{ include('flutter/base/requests/file.twig') }} {% elseif method.type == 'webAuth' %} -{{ include('flutter/base/oauth.twig') }} +{{ include('flutter/base/requests/oauth.twig') }} {% elseif method.type == 'location' %} -{{ include('flutter/base/location.twig') }} +{{ include('flutter/base/requests/location.twig') }} {% else %} -{{ include('flutter/base/api.twig') }} +{{ include('flutter/base/requests/api.twig') }} {% endif %} } From 1648b3c269935bfebd3e0925c2b4db73e60867de Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 14 Jun 2022 01:46:27 +0000 Subject: [PATCH 054/555] more cleaning up --- templates/flutter/base/requests/api.twig | 13 ++++--------- templates/flutter/base/requests/file.twig | 15 +++++---------- templates/flutter/base/requests/location.twig | 12 ++++-------- templates/flutter/base/requests/oauth.twig | 16 ++++------------ templates/flutter/base/utils.twig | 11 +++++++++++ 5 files changed, 28 insertions(+), 39 deletions(-) create mode 100644 templates/flutter/base/utils.twig diff --git a/templates/flutter/base/requests/api.twig b/templates/flutter/base/requests/api.twig index fdd9e24481..b3e5dd8190 100644 --- a/templates/flutter/base/requests/api.twig +++ b/templates/flutter/base/requests/api.twig @@ -1,16 +1,11 @@ +{% import 'flutter/base/utils.twig' as utils %} final Map params = { -{% for parameter in method.parameters.query %} - '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for parameter in method.parameters.body %} - '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} + {{ utils.map_parameter(method.parameters.query) }} + {{ utils.map_parameter(method.parameters.body) }} }; final Map headers = { -{% for key, header in method.headers %} - '{{ key }}': '{{ header }}', -{% endfor %} + {{ utils.map_headers(method.headers) }} }; final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); diff --git a/templates/flutter/base/requests/file.twig b/templates/flutter/base/requests/file.twig index 6e859099e3..e2e80cbad7 100644 --- a/templates/flutter/base/requests/file.twig +++ b/templates/flutter/base/requests/file.twig @@ -1,16 +1,11 @@ - final Map params = { -{% for parameter in method.parameters.query %} - '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for parameter in method.parameters.body %} - '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} + {% import 'flutter/base/utils.twig' as utils %} + final Map params = { + {{ utils.map_parameter(method.parameters.query) }} + {{ utils.map_parameter(method.parameters.body) }} }; final Map headers = { -{% for key, header in method.headers %} - '{{ key }}': '{{ header }}', -{% endfor %} + {{ utils.map_headers(method.headers) }} }; {% if 'multipart/form-data' in method.consumes %} diff --git a/templates/flutter/base/requests/location.twig b/templates/flutter/base/requests/location.twig index 38a81eae05..47731d778b 100644 --- a/templates/flutter/base/requests/location.twig +++ b/templates/flutter/base/requests/location.twig @@ -1,12 +1,8 @@ +{% import 'flutter/base/utils.twig' as utils %} final Map params = { -{% for parameter in method.parameters.query %} - '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for parameter in method.parameters.body %} - '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% if method.security|length > 0 %} -{% for node in method.security %} + {{ utils.map_parameter(method.parameters.query) }} + {{ utils.map_parameter(method.parameters.body) }} +{% if method.security|length > 0 %}{% for node in method.security %} {% for key,header in node|keys %} '{{header|caseLower}}': client.config['{{header|caseLower}}'], {% endfor %} diff --git a/templates/flutter/base/requests/oauth.twig b/templates/flutter/base/requests/oauth.twig index bf0989ec71..4a19160be8 100644 --- a/templates/flutter/base/requests/oauth.twig +++ b/templates/flutter/base/requests/oauth.twig @@ -1,23 +1,16 @@ +{% import 'flutter/base/utils.twig' as utils %} final Map params = { -{% for parameter in method.parameters.query %} - '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for parameter in method.parameters.body %} - '{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% if method.type == 'webAuth' %} + {{ utils.map_parameter(method.parameters.query) }} + {{ utils.map_parameter(method.parameters.body) }} {% if method.security|length > 0 %} {% for node in method.security %} {% for key,header in node|keys %} '{{header|caseLower}}': client.config['{{header|caseLower}}'], {% endfor %} {% endfor %} -{% endif %} {% endif %} }; -{% if method.type == 'webAuth' %} - final List query = []; params.forEach((key, value) { @@ -38,5 +31,4 @@ query: query.join('&') ); - return client.webAuth(url); -{% endif %} \ No newline at end of file + return client.webAuth(url); \ No newline at end of file diff --git a/templates/flutter/base/utils.twig b/templates/flutter/base/utils.twig new file mode 100644 index 0000000000..331cc931f6 --- /dev/null +++ b/templates/flutter/base/utils.twig @@ -0,0 +1,11 @@ +{% macro map_parameter(parameters) %} +{% for parameter in parameters %} +'{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, +{% endfor %} +{% endmacro %} + +{% macro map_headers(headers) %} +{% for key, header in headers %} + '{{ key }}': '{{ header }}', +{% endfor %} +{% endmacro %} \ No newline at end of file From 5763521184e6466601e58c37af677cea3ac8eb39 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 14 Jun 2022 02:01:14 +0000 Subject: [PATCH 055/555] refactor dart templates --- templates/dart/base/requests/api.twig | 13 ++++ templates/dart/base/requests/file.twig | 42 ++++++++++++ templates/dart/base/requests/location.twig | 14 ++++ templates/dart/base/requests/oauth.twig | 34 ++++++++++ templates/dart/base/utils.twig | 11 +++ templates/dart/lib/services/service.dart.twig | 68 ++----------------- 6 files changed, 120 insertions(+), 62 deletions(-) create mode 100644 templates/dart/base/requests/api.twig create mode 100644 templates/dart/base/requests/file.twig create mode 100644 templates/dart/base/requests/location.twig create mode 100644 templates/dart/base/requests/oauth.twig create mode 100644 templates/dart/base/utils.twig diff --git a/templates/dart/base/requests/api.twig b/templates/dart/base/requests/api.twig new file mode 100644 index 0000000000..b3e5dd8190 --- /dev/null +++ b/templates/dart/base/requests/api.twig @@ -0,0 +1,13 @@ +{% import 'flutter/base/utils.twig' as utils %} + final Map params = { + {{ utils.map_parameter(method.parameters.query) }} + {{ utils.map_parameter(method.parameters.body) }} + }; + + final Map headers = { + {{ utils.map_headers(method.headers) }} + }; + + final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); + + return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst}}.fromMap(res.data){% else %} res.data{% endif %}; diff --git a/templates/dart/base/requests/file.twig b/templates/dart/base/requests/file.twig new file mode 100644 index 0000000000..53b166375c --- /dev/null +++ b/templates/dart/base/requests/file.twig @@ -0,0 +1,42 @@ + {% import 'flutter/base/utils.twig' as utils %} + final Map params = { + {{ utils.map_parameter(method.parameters.query) }} + {{ utils.map_parameter(method.parameters.body) }} + }; + + final Map headers = { + {{ utils.map_headers(method.headers) }} + }; + +{% if 'multipart/form-data' in method.consumes %} + dynamic res; + if(identical(0, 0.0)) { +{% for parameter in method.parameters.all %} +{% if parameter.type == 'file' %} + params['{{ parameter.name }}'] = {{ parameter.name }}.file; +{% endif %} +{% endfor %} + res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); + } else { + String idParamName = ''; +{% for parameter in method.parameters.all %} +{% if parameter.type == 'file' %} + final paramName = '{{ parameter.name }}'; +{% endif %} +{% if parameter.isUploadID %} + idParamName = '{{ parameter.name }}'; +{% endif %} +{% endfor %} + res = await chunkedUpload( + client: client, + path: path, + params: params, + paramName: paramName, + idParamName: idParamName, + headers: headers, + onProgress: onProgress, + ); + } + + return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst}}.fromMap(res.data){% else %} res.data{% endif %}; +{% endif %} diff --git a/templates/dart/base/requests/location.twig b/templates/dart/base/requests/location.twig new file mode 100644 index 0000000000..47731d778b --- /dev/null +++ b/templates/dart/base/requests/location.twig @@ -0,0 +1,14 @@ +{% import 'flutter/base/utils.twig' as utils %} + final Map params = { + {{ utils.map_parameter(method.parameters.query) }} + {{ utils.map_parameter(method.parameters.body) }} +{% if method.security|length > 0 %}{% for node in method.security %} +{% for key,header in node|keys %} + '{{header|caseLower}}': client.config['{{header|caseLower}}'], +{% endfor %} +{% endfor %} +{% endif %} + }; + + final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, responseType: ResponseType.bytes); + return res.data; \ No newline at end of file diff --git a/templates/dart/base/requests/oauth.twig b/templates/dart/base/requests/oauth.twig new file mode 100644 index 0000000000..4a19160be8 --- /dev/null +++ b/templates/dart/base/requests/oauth.twig @@ -0,0 +1,34 @@ +{% import 'flutter/base/utils.twig' as utils %} + final Map params = { + {{ utils.map_parameter(method.parameters.query) }} + {{ utils.map_parameter(method.parameters.body) }} +{% if method.security|length > 0 %} +{% for node in method.security %} +{% for key,header in node|keys %} + '{{header|caseLower}}': client.config['{{header|caseLower}}'], +{% endfor %} +{% endfor %} +{% endif %} + }; + + final List query = []; + + params.forEach((key, value) { + if (value is List) { + for (var item in value) { + query.add(Uri.encodeComponent(key + '[]') + '=' + Uri.encodeComponent(item)); + } + } else if(value != null) { + query.add(Uri.encodeComponent(key) + '=' + Uri.encodeComponent(value)); + } + }); + + Uri endpoint = Uri.parse(client.endPoint); + Uri url = Uri(scheme: endpoint.scheme, + host: endpoint.host, + port: endpoint.port, + path: endpoint.path + path, + query: query.join('&') + ); + + return client.webAuth(url); \ No newline at end of file diff --git a/templates/dart/base/utils.twig b/templates/dart/base/utils.twig new file mode 100644 index 0000000000..2a23dbd98e --- /dev/null +++ b/templates/dart/base/utils.twig @@ -0,0 +1,11 @@ +{% macro map_parameter(parameters) %} +{% for parameter in parameters %} +'{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, +{% endfor %} +{% endmacro %} + +{% macro map_headers(headers) %} +{% for key, header in headers %} +'{{ key }}': '{{ header }}', +{% endfor %} +{% endmacro %} \ No newline at end of file diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index 1a5390b2af..fa43fb491a 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -4,7 +4,6 @@ part of {{ language.params.packageName }}; {% macro method_parameters(parameters, consumes) %} {% if parameters.all|length > 0 %}{{ '{' }}{% for parameter in parameters.all %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} {% endmacro %} -{% macro map_parameter(parameter) %}'{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }},{% endmacro %} {%if service.description %} {{ service.description|dartComment}} @@ -19,72 +18,17 @@ class {{ service.name | caseUcfirst }} extends Service { {{ method.description | dartComment }} /// {% endif %} - {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters, method.consumes) }}) async { + {% if method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters, method.consumes) }}) async { final String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; - final Map params = { -{% for parameter in method.parameters.query %} - {{ _self.map_parameter(parameter) }} -{% endfor %} -{% for parameter in method.parameters.body %} - {{ _self.map_parameter(parameter) }} -{% endfor %} -{% if method.type == 'location' %} -{% if method.security|length > 0 %} -{% for node in method.security %} -{% for key,header in node|keys %} - '{{header|caseLower}}': client.config['{{header|caseLower}}'], -{% endfor %} -{% endfor %} -{% endif %} -{% endif %} - }; - -{% if method.type == 'location' %} - final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, responseType: ResponseType.bytes); - return res.data; -{% else %} - final Map headers = { -{% for key, header in method.headers %} - '{{ key }}': '{{ header }}', -{% endfor %} - }; - - {% if 'multipart/form-data' in method.consumes %} - dynamic res; - if(identical(0, 0.0)) { -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - params['{{ parameter.name }}'] = {{ parameter.name }}.file; -{% endif %} -{% endfor %} - res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); - } else { - String idParamName = ''; -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - final paramName = '{{ parameter.name }}'; -{% endif %} -{% if parameter.isUploadID %} - idParamName = '{{ parameter.name }}'; -{% endif %} -{% endfor %} - res = await chunkedUpload( - client: client, - path: path, - params: params, - paramName: paramName, - idParamName: idParamName, - headers: headers, - onProgress: onProgress, - ); - } +{{ include('dart/base/requests/file.twig') }} +{% elseif method.type == 'location' %} +{{ include('dart/base/requests/location.twig') }} {% else %} - final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); -{% endif %} - return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst | overrideIdentifier}}.fromMap(res.data){% else %} res.data{% endif %}; +{{ include('dart/base/requests/api.twig') }} {% endif %} + } {% endfor %} } \ No newline at end of file From 4804025c6dee48df4492e3b0ed93567196cac7bc Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 14 Jun 2022 02:30:08 +0000 Subject: [PATCH 056/555] refactor specific filters --- src/SDK/Language.php | 7 +++++ src/SDK/Language/Dart.php | 14 +++++++++ src/SDK/Language/DotNet.php | 14 +++++++++ src/SDK/Language/Go.php | 14 +++++++++ src/SDK/Language/Ruby.php | 14 +++++++++ src/SDK/Language/Swift.php | 14 +++++++++ src/SDK/Language/Web.php | 22 +++++++++++++ src/SDK/SDK.php | 62 +++---------------------------------- 8 files changed, 104 insertions(+), 57 deletions(-) diff --git a/src/SDK/Language.php b/src/SDK/Language.php index 9d902357f1..f7b18bcf60 100644 --- a/src/SDK/Language.php +++ b/src/SDK/Language.php @@ -74,4 +74,11 @@ public function getParams() { return $this->params; } + + /** + * @return array + */ + public function getTwigFilters(){ + return []; + } } \ No newline at end of file diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index 5f78f3a7c2..9234147232 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -3,6 +3,7 @@ namespace Appwrite\SDK\Language; use Appwrite\SDK\Language; +use Twig\TwigFilter; class Dart extends Language { @@ -434,4 +435,17 @@ public function getFiles() ], ]; } + + public function getTwigFilters() + { + return [ + new TwigFilter('dartComment', function ($value) { + $value = explode("\n", $value); + foreach ($value as $key => $line) { + $value[$key] = " /// " . wordwrap($value[$key], 75, "\n /// "); + } + return implode("\n", $value); + }, ['is_safe' => ['html']]), + ]; + } } diff --git a/src/SDK/Language/DotNet.php b/src/SDK/Language/DotNet.php index 609e025638..b41861a927 100644 --- a/src/SDK/Language/DotNet.php +++ b/src/SDK/Language/DotNet.php @@ -3,6 +3,7 @@ namespace Appwrite\SDK\Language; use Appwrite\SDK\Language; +use Twig\TwigFilter; class DotNet extends Language { @@ -376,5 +377,18 @@ public function getFiles() ] ]; } + + public function getTwigFilters() + { + return [ + new TwigFilter('dotnetComment', function ($value) { + $value = explode("\n", $value); + foreach ($value as $key => $line) { + $value[$key] = " /// " . wordwrap($value[$key], 75, "\n /// "); + } + return implode("\n", $value); + }, ['is_safe' => ['html']]) + ]; + } } diff --git a/src/SDK/Language/Go.php b/src/SDK/Language/Go.php index 97c023c22b..dbf4a4eee4 100644 --- a/src/SDK/Language/Go.php +++ b/src/SDK/Language/Go.php @@ -3,6 +3,7 @@ namespace Appwrite\SDK\Language; use Appwrite\SDK\Language; +use Twig\TwigFilter; class Go extends Language { @@ -246,4 +247,17 @@ public function getParamExample(array $param) return $output; } + + public function getTwigFilters() + { + return [ + new TwigFilter('godocComment', function ($value) { + $value = explode("\n", $value); + foreach ($value as $key => $line) { + $value[$key] = "// " . wordwrap($value[$key], 75, "\n// "); + } + return implode("\n", $value); + }, ['is_safe' => ['html']]) + ]; + } } diff --git a/src/SDK/Language/Ruby.php b/src/SDK/Language/Ruby.php index c8b5eea41d..949e7b5961 100644 --- a/src/SDK/Language/Ruby.php +++ b/src/SDK/Language/Ruby.php @@ -3,6 +3,7 @@ namespace Appwrite\SDK\Language; use Appwrite\SDK\Language; +use Twig\TwigFilter; class Ruby extends Language { @@ -327,4 +328,17 @@ protected function jsonToHash(array $data):string return $output; } + + public function getTwigFilters() + { + return [ + new TwigFilter('rubyComment', function ($value) { + $value = explode("\n", $value); + foreach ($value as $key => $line) { + $value[$key] = " # " . wordwrap($line, 75, "\n # "); + } + return implode("\n", $value); + }, ['is_safe' => ['html']]) + ]; + } } diff --git a/src/SDK/Language/Swift.php b/src/SDK/Language/Swift.php index 089bccae25..1a8fea8a3c 100644 --- a/src/SDK/Language/Swift.php +++ b/src/SDK/Language/Swift.php @@ -3,6 +3,7 @@ namespace Appwrite\SDK\Language; use Appwrite\SDK\Language; +use Twig\TwigFilter; class Swift extends Language { @@ -432,4 +433,17 @@ public function getParamExample(array $param) return $output; } + + public function getTwigFilters() + { + return [ + new TwigFilter('swiftComment', function ($value) { + $value = explode("\n", $value); + foreach ($value as $key => $line) { + $value[$key] = " /// " . wordwrap($value[$key], 75, "\n /// "); + } + return implode("\n", $value); + }, ['is_safe' => ['html']]) + ]; + } } diff --git a/src/SDK/Language/Web.php b/src/SDK/Language/Web.php index 32f75d592a..f22ae73b2f 100644 --- a/src/SDK/Language/Web.php +++ b/src/SDK/Language/Web.php @@ -2,6 +2,8 @@ namespace Appwrite\SDK\Language; +use Twig\TwigFilter; + class Web extends JS { /** @@ -141,4 +143,24 @@ public function getParamExample(array $param) return $output; } + + public function getTwigFilters() + { + return [ + new TwigFilter('comment2', function ($value) { + $value = explode("\n", $value); + foreach ($value as $key => $line) { + $value[$key] = " * " . wordwrap($value[$key], 75, "\n * "); + } + return implode("\n", $value); + }, ['is_safe' => ['html']]), + new TwigFilter('comment3', function ($value) { + $value = explode("\n", $value); + foreach ($value as $key => $line) { + $value[$key] = " * " . wordwrap($value[$key], 75, "\n * "); + } + return implode("\n", $value); + }, ['is_safe' => ['html']]), + ]; + } } diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index 9c555d4e95..3f57d7a934 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -133,48 +133,6 @@ public function __construct(Language $language, Spec $spec) } return implode("\n", $value); }, ['is_safe' => ['html']])); - $this->twig->addFilter(new TwigFilter('comment2', function ($value) { - $value = explode("\n", $value); - foreach ($value as $key => $line) { - $value[$key] = " * " . wordwrap($value[$key], 75, "\n * "); - } - return implode("\n", $value); - }, ['is_safe' => ['html']])); - $this->twig->addFilter(new TwigFilter('comment3', function ($value) { - $value = explode("\n", $value); - foreach ($value as $key => $line) { - $value[$key] = " * " . wordwrap($value[$key], 75, "\n * "); - } - return implode("\n", $value); - }, ['is_safe' => ['html']])); - $this->twig->addFilter(new TwigFilter('dartComment', function ($value) { - $value = explode("\n", $value); - foreach ($value as $key => $line) { - $value[$key] = " /// " . wordwrap($value[$key], 75, "\n /// "); - } - return implode("\n", $value); - }, ['is_safe' => ['html']])); - $this->twig->addFilter(new TwigFilter('dotnetComment', function ($value) { - $value = explode("\n", $value); - foreach ($value as $key => $line) { - $value[$key] = " /// " . wordwrap($value[$key], 75, "\n /// "); - } - return implode("\n", $value); - }, ['is_safe' => ['html']])); - $this->twig->addFilter(new TwigFilter('swiftComment', function ($value) { - $value = explode("\n", $value); - foreach ($value as $key => $line) { - $value[$key] = " /// " . wordwrap($value[$key], 75, "\n /// "); - } - return implode("\n", $value); - }, ['is_safe' => ['html']])); - $this->twig->addFilter(new TwigFilter('rubyComment', function ($value) { - $value = explode("\n", $value); - foreach ($value as $key => $line) { - $value[$key] = " # " . wordwrap($line, 75, "\n # "); - } - return implode("\n", $value); - }, ['is_safe' => ['html']])); $this->twig->addFilter(new TwigFilter('escapeDollarSign', function ($value) { return str_replace('$', '\$', $value); }, ['is_safe'=>['html']])); @@ -191,13 +149,6 @@ public function __construct(Language $language, Spec $spec) $this->twig->addFilter(new TwigFilter('html', function ($value) { return $value; }, ['is_safe' => ['html']])); - $this->twig->addFilter(new TwigFilter('godocComment', function ($value) { - $value = explode("\n", $value); - foreach ($value as $key => $line) { - $value[$key] = "// " . wordwrap($value[$key], 75, "\n// "); - } - return implode("\n", $value); - }, ['is_safe' => ['html']])); $this->twig->addFilter(new TwigFilter('escapeKeyword', function ($value) use ($language) { if(in_array($value, $language->getKeywords())) { return 'x' . $value; @@ -205,14 +156,6 @@ public function __construct(Language $language, Spec $spec) return $value; }, ['is_safe' => ['html']])); - $this->twig->addFilter(new TwigFilter('ucFirstAndEscape', function ($value) use ($language) { - $value = ucfirst((string)$this->helperCamelCase($value)); - if(in_array($value, $language->getKeywords())) { - $value = 'x' . $value; - } - - return ucfirst((string)$this->helperCamelCase($value)); - }, ['is_safe' => ['html']])); $this->twig->addFilter(new TwigFilter('caseHTML', function ($value) { return $value; }, ['is_safe' => ['html']])); @@ -228,6 +171,11 @@ public function __construct(Language $language, Spec $spec) } return $value; })); + + // Language specific filters + foreach($language->getTwigFilters() as $filter) { + $this->twig->addFilter($filter); + } } /** From 6b370af9cb4711fe3352647ba0d3913532546bb6 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 14 Jun 2022 11:01:31 +0000 Subject: [PATCH 057/555] fixes after merge for updated file support --- templates/dart/base/requests/file.twig | 20 +++++--------------- templates/flutter/base/requests/file.twig | 18 ++++-------------- 2 files changed, 9 insertions(+), 29 deletions(-) diff --git a/templates/dart/base/requests/file.twig b/templates/dart/base/requests/file.twig index 53b166375c..a639cf7b76 100644 --- a/templates/dart/base/requests/file.twig +++ b/templates/dart/base/requests/file.twig @@ -9,25 +9,16 @@ }; {% if 'multipart/form-data' in method.consumes %} - dynamic res; - if(identical(0, 0.0)) { + String idParamName = ''; {% for parameter in method.parameters.all %} {% if parameter.type == 'file' %} - params['{{ parameter.name }}'] = {{ parameter.name }}.file; -{% endif %} -{% endfor %} - res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); - } else { - String idParamName = ''; -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - final paramName = '{{ parameter.name }}'; + final paramName = '{{ parameter.name }}'; {% endif %} {% if parameter.isUploadID %} - idParamName = '{{ parameter.name }}'; + idParamName = '{{ parameter.name }}'; {% endif %} {% endfor %} - res = await chunkedUpload( + final res = await chunkedUpload( client: client, path: path, params: params, @@ -35,8 +26,7 @@ idParamName: idParamName, headers: headers, onProgress: onProgress, - ); - } + ); return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst}}.fromMap(res.data){% else %} res.data{% endif %}; {% endif %} diff --git a/templates/flutter/base/requests/file.twig b/templates/flutter/base/requests/file.twig index e2e80cbad7..780800f5ae 100644 --- a/templates/flutter/base/requests/file.twig +++ b/templates/flutter/base/requests/file.twig @@ -9,25 +9,16 @@ }; {% if 'multipart/form-data' in method.consumes %} - dynamic res; - if(kIsWeb) { + String idParamName = ''; {% for parameter in method.parameters.all %} {% if parameter.type == 'file' %} - params['{{ parameter.name }}'] = {{ parameter.name }}.file; -{% endif %} -{% endfor %} - res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); - } else { - String idParamName = ''; -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - final paramName = '{{ parameter.name }}'; + final paramName = '{{ parameter.name }}'; {% endif %} {% if parameter.isUploadID %} - idParamName = '{{ parameter.name }}'; + idParamName = '{{ parameter.name }}'; {% endif %} {% endfor %} - res = await chunkedUpload( + final res = await chunkedUpload( client: client, path: path, params: params, @@ -36,7 +27,6 @@ headers: headers, onProgress: onProgress, ); - } return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst}}.fromMap(res.data){% else %} res.data{% endif %}; {% endif %} From 5f405cd2c2e58702c3fa96c293295ca6e8853c4a Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 14 Jun 2022 11:25:37 +0000 Subject: [PATCH 058/555] more refactor to flutter templates --- src/SDK/Language/Flutter.php | 18 --- templates/flutter/base/requests/file.twig | 3 +- templates/flutter/lib/package.dart.twig | 3 - .../lib/src/chunked_upload_browser.dart.twig | 75 ------------- .../lib/src/chunked_upload_io.dart.twig | 105 ------------------ .../lib/src/chunked_upload_stub.dart.twig | 14 --- templates/flutter/lib/src/client.dart.twig | 10 ++ .../flutter/lib/src/client_browser.dart.twig | 72 +++++++++++- templates/flutter/lib/src/client_io.dart.twig | 100 +++++++++++++++++ 9 files changed, 182 insertions(+), 218 deletions(-) delete mode 100644 templates/flutter/lib/src/chunked_upload_browser.dart.twig delete mode 100644 templates/flutter/lib/src/chunked_upload_io.dart.twig delete mode 100644 templates/flutter/lib/src/chunked_upload_stub.dart.twig diff --git a/src/SDK/Language/Flutter.php b/src/SDK/Language/Flutter.php index 08afd70de3..b7cd93fdcc 100644 --- a/src/SDK/Language/Flutter.php +++ b/src/SDK/Language/Flutter.php @@ -277,24 +277,6 @@ public function getFiles() 'template' => 'flutter/lib/src/input_file.dart.twig', 'minify' => false, ], - [ - 'scope' => 'default', - 'destination' => 'lib/src/chunked_upload_io.dart', - 'template' => 'flutter/lib/src/chunked_upload_io.dart.twig', - 'minify' => false, - ], - [ - 'scope' => 'default', - 'destination' => 'lib/src/chunked_upload_browser.dart', - 'template' => 'flutter/lib/src/chunked_upload_browser.dart.twig', - 'minify' => false, - ], - [ - 'scope' => 'default', - 'destination' => 'lib/src/chunked_upload_stub.dart', - 'template' => 'flutter/lib/src/chunked_upload_stub.dart.twig', - 'minify' => false, - ], ]; } } diff --git a/templates/flutter/base/requests/file.twig b/templates/flutter/base/requests/file.twig index 780800f5ae..6afe2d056e 100644 --- a/templates/flutter/base/requests/file.twig +++ b/templates/flutter/base/requests/file.twig @@ -18,8 +18,7 @@ idParamName = '{{ parameter.name }}'; {% endif %} {% endfor %} - final res = await chunkedUpload( - client: client, + final res = await client.chunkedUpload( path: path, params: params, paramName: paramName, diff --git a/templates/flutter/lib/package.dart.twig b/templates/flutter/lib/package.dart.twig index dacd631851..5c08f82eee 100644 --- a/templates/flutter/lib/package.dart.twig +++ b/templates/flutter/lib/package.dart.twig @@ -4,9 +4,6 @@ import 'dart:async'; import 'dart:typed_data'; import 'package:flutter/foundation.dart'; import 'package:http/http.dart' show MultipartFile; -import 'src/chunked_upload_stub.dart' - if (dart.library.html) 'src/chunked_upload_browser.dart' - if (dart.library.io) 'src/chunked_upload_io.dart'; import 'src/enums.dart'; import 'src/client.dart'; import 'src/service.dart'; diff --git a/templates/flutter/lib/src/chunked_upload_browser.dart.twig b/templates/flutter/lib/src/chunked_upload_browser.dart.twig deleted file mode 100644 index 16a074508d..0000000000 --- a/templates/flutter/lib/src/chunked_upload_browser.dart.twig +++ /dev/null @@ -1,75 +0,0 @@ -import 'client.dart'; -import 'enums.dart'; -import 'package:http/http.dart' as http; -import 'response.dart'; -import 'dart:math'; -import 'input_file.dart'; -import 'exception.dart'; -import 'upload_progress.dart'; - -Future chunkedUpload({ - required Client client, - required String path, - required Map params, - required String paramName, - required String idParamName, - required Map headers, - Function(UploadProgress)? onProgress, -}) async { - InputFile file = params[paramName]; - if (file.bytes == null) { - throw {{spec.title | caseUcfirst}}Exception("File bytes must be provided for Flutter web"); - } - - int size = file.bytes!.length; - - late Response res; - if (size <= Client.CHUNK_SIZE) { - params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!, filename: file.filename); - return client.call( - HttpMethod.post, - path: path, - params: params, - headers: headers, - ); - } - - var offset = 0; - if (idParamName.isNotEmpty && params[idParamName] != 'unique()') { - //make a request to check if a file already exists - try { - res = await client.call( - HttpMethod.get, - path: path + '/' + params[idParamName], - headers: headers, - ); - final int chunksUploaded = res.data['chunksUploaded'] as int; - offset = min(size, chunksUploaded * Client.CHUNK_SIZE); - } on {{spec.title | caseUcfirst}}Exception catch (_) {} - } - - while (offset < size) { - var chunk; - final end = min(offset + Client.CHUNK_SIZE-1, size-1); - chunk = file.bytes!.getRange(offset, end).toList(); - params[paramName] = - http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); - headers['content-range'] = - 'bytes $offset-${min(((offset + Client.CHUNK_SIZE) - 1), size)}/$size'; - res = await client.call(HttpMethod.post, - path: path, headers: headers, params: params); - offset += Client.CHUNK_SIZE; - if (offset < size) { - headers['x-{{spec.title | caseLower }}-id'] = res.data['\$id']; - } - final progress = UploadProgress( - $id: res.data['\$id'] ?? '', - progress: min(offset - 1, size) / size * 100, - sizeUploaded: min(offset - 1, size), - chunksTotal: res.data['chunksTotal'] ?? 0, - chunksUploaded: res.data['chunksUploaded'] ?? 0, - ); - onProgress?.call(progress); - } - return res; -} diff --git a/templates/flutter/lib/src/chunked_upload_io.dart.twig b/templates/flutter/lib/src/chunked_upload_io.dart.twig deleted file mode 100644 index 92289669b1..0000000000 --- a/templates/flutter/lib/src/chunked_upload_io.dart.twig +++ /dev/null @@ -1,105 +0,0 @@ -import 'client.dart'; -import 'dart:io' as io; -import 'enums.dart'; -import 'package:http/http.dart' as http; -import 'response.dart'; -import 'dart:math'; -import 'input_file.dart'; -import 'exception.dart'; -import 'upload_progress.dart'; - -Future chunkedUpload({ - required Client client, - required String path, - required Map params, - required String paramName, - required String idParamName, - required Map headers, - Function(UploadProgress)? onProgress, -}) async { - InputFile file = params[paramName]; - if (file.path == null && file.bytes == null) { - throw {{spec.title | caseUcfirst}}Exception("File path or bytes must be provided"); - } - - int size = 0; - if (file.bytes != null) { - size = file.bytes!.length; - } - - io.File? iofile; - - if (file.path != null) { - iofile = io.File(file.path!); - size = await iofile.length(); - } - - late Response res; - if (size <= Client.CHUNK_SIZE) { - if (file.path != null) { - params[paramName] = await http.MultipartFile.fromPath( - paramName, file.path!, - filename: file.filename); - } else { - params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!, - filename: file.filename); - } - return client.call( - HttpMethod.post, - path: path, - params: params, - headers: headers, - ); - } - - var offset = 0; - if (idParamName.isNotEmpty && params[idParamName] != 'unique()') { - //make a request to check if a file already exists - try { - res = await client.call( - HttpMethod.get, - path: path + '/' + params[idParamName], - headers: headers, - ); - final int chunksUploaded = res.data['chunksUploaded'] as int; - offset = min(size, chunksUploaded * Client.CHUNK_SIZE); - } on {{spec.title | caseUcfirst}}Exception catch (_) {} - } - - io.RandomAccessFile? raf; - // read chunk and upload each chunk - if (iofile != null) { - raf = await iofile.open(mode: io.FileMode.read); - } - - while (offset < size) { - var chunk; - if (file.bytes != null) { - final end = min(offset + Client.CHUNK_SIZE-1, size-1); - chunk = file.bytes!.getRange(offset, end).toList(); - } else { - raf!.setPositionSync(offset); - chunk = raf.readSync(Client.CHUNK_SIZE); - } - params[paramName] = - http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); - headers['content-range'] = - 'bytes $offset-${min(((offset + Client.CHUNK_SIZE) - 1), size)}/$size'; - res = await client.call(HttpMethod.post, - path: path, headers: headers, params: params); - offset += Client.CHUNK_SIZE; - if (offset < size) { - headers['x-{{spec.title | caseLower }}-id'] = res.data['\$id']; - } - final progress = UploadProgress( - $id: res.data['\$id'] ?? '', - progress: min(offset - 1, size) / size * 100, - sizeUploaded: min(offset - 1, size), - chunksTotal: res.data['chunksTotal'] ?? 0, - chunksUploaded: res.data['chunksUploaded'] ?? 0, - ); - onProgress?.call(progress); - } - raf?.close(); - return res; -} diff --git a/templates/flutter/lib/src/chunked_upload_stub.dart.twig b/templates/flutter/lib/src/chunked_upload_stub.dart.twig deleted file mode 100644 index 79ff481edb..0000000000 --- a/templates/flutter/lib/src/chunked_upload_stub.dart.twig +++ /dev/null @@ -1,14 +0,0 @@ -import 'response.dart'; -import 'client.dart'; -import 'upload_progress.dart'; - -Future chunkedUpload({ - required Client client, - required String path, - required Map params, - required String paramName, - required String idParamName, - required Map headers, - Function(UploadProgress)? onProgress, -}) => - throw UnsupportedError('Cannot redirect to url without dart:html'); diff --git a/templates/flutter/lib/src/client.dart.twig b/templates/flutter/lib/src/client.dart.twig index 75bbfbcfc0..f4eb901b69 100644 --- a/templates/flutter/lib/src/client.dart.twig +++ b/templates/flutter/lib/src/client.dart.twig @@ -3,6 +3,7 @@ import 'client_stub.dart' if (dart.library.html) 'client_browser.dart' if (dart.library.io) 'client_io.dart'; import 'response.dart'; +import 'upload_progress.dart'; abstract class Client { static const int CHUNK_SIZE = 5*1024*1024; @@ -20,6 +21,15 @@ abstract class Client { Future webAuth(Uri url); + Future chunkedUpload({ + required String path, + required Map params, + required String paramName, + required String idParamName, + required Map headers, + Function(UploadProgress)? onProgress, + }); + Client setSelfSigned({bool status = true}); Client setEndpoint(String endPoint); diff --git a/templates/flutter/lib/src/client_browser.dart.twig b/templates/flutter/lib/src/client_browser.dart.twig index 91f3ae1303..2d7cedba0d 100644 --- a/templates/flutter/lib/src/client_browser.dart.twig +++ b/templates/flutter/lib/src/client_browser.dart.twig @@ -1,4 +1,5 @@ import 'dart:html' as html; +import 'dart:math'; import 'package:flutter/foundation.dart'; import 'package:flutter_web_auth/flutter_web_auth.dart'; import 'package:http/http.dart' as http; @@ -7,7 +8,8 @@ import 'client_mixin.dart'; import 'enums.dart'; import 'exception.dart'; import 'client_base.dart'; - +import 'input_file.dart'; +import 'upload_progress.dart'; import 'response.dart'; ClientBase createClient({ @@ -17,6 +19,7 @@ ClientBase createClient({ ClientBrowser(endPoint: endPoint, selfSigned: selfSigned); class ClientBrowser extends ClientBase with ClientMixin { + static const int CHUNK_SIZE = 5*1024*1024; String _endPoint; Map? _headers; @override @@ -100,6 +103,73 @@ class ClientBrowser extends ClientBase with ClientMixin { _httpClient.withCredentials = true; } + @override + Future chunkedUpload({ + required String path, + required Map params, + required String paramName, + required String idParamName, + required Map headers, + Function(UploadProgress)? onProgress, + }) async { + InputFile file = params[paramName]; + if (file.bytes == null) { + throw {{spec.title | caseUcfirst}}Exception("File bytes must be provided for Flutter web"); + } + + int size = file.bytes!.length; + + late Response res; + if (size <= CHUNK_SIZE) { + params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!, filename: file.filename); + return call( + HttpMethod.post, + path: path, + params: params, + headers: headers, + ); + } + + var offset = 0; + if (idParamName.isNotEmpty && params[idParamName] != 'unique()') { + //make a request to check if a file already exists + try { + res = await call( + HttpMethod.get, + path: path + '/' + params[idParamName], + headers: headers, + ); + final int chunksUploaded = res.data['chunksUploaded'] as int; + offset = min(size, chunksUploaded * CHUNK_SIZE); + } on {{spec.title | caseUcfirst}}Exception catch (_) {} + } + + while (offset < size) { + var chunk; + final end = min(offset + CHUNK_SIZE-1, size-1); + chunk = file.bytes!.getRange(offset, end).toList(); + params[paramName] = + http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); + headers['content-range'] = + 'bytes $offset-${min(((offset + CHUNK_SIZE) - 1), size)}/$size'; + res = await call(HttpMethod.post, + path: path, headers: headers, params: params); + offset += CHUNK_SIZE; + if (offset < size) { + headers['x-{{spec.title | caseLower }}-id'] = res.data['\$id']; + } + final progress = UploadProgress( + $id: res.data['\$id'] ?? '', + progress: min(offset - 1, size) / size * 100, + sizeUploaded: min(offset - 1, size), + chunksTotal: res.data['chunksTotal'] ?? 0, + chunksUploaded: res.data['chunksUploaded'] ?? 0, + ); + onProgress?.call(progress); + } + return res; + } + @override Future call( HttpMethod method, { diff --git a/templates/flutter/lib/src/client_io.dart.twig b/templates/flutter/lib/src/client_io.dart.twig index 78496d5e1f..e6659b1467 100644 --- a/templates/flutter/lib/src/client_io.dart.twig +++ b/templates/flutter/lib/src/client_io.dart.twig @@ -1,4 +1,5 @@ import 'dart:io'; +import 'dart:math'; import 'package:cookie_jar/cookie_jar.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:http/http.dart' as http; @@ -14,6 +15,8 @@ import 'exception.dart'; import 'interceptor.dart'; import 'response.dart'; import 'package:flutter/foundation.dart'; +import 'input_file.dart'; +import 'upload_progress.dart'; ClientBase createClient({ required String endPoint, @@ -25,6 +28,7 @@ ClientBase createClient({ ); class ClientIO extends ClientBase with ClientMixin { + static const int CHUNK_SIZE = 5*1024*1024; String _endPoint; Map? _headers; @override @@ -195,6 +199,102 @@ class ClientIO extends ClientBase with ClientMixin { return response; } + @override + Future chunkedUpload({ + required String path, + required Map params, + required String paramName, + required String idParamName, + required Map headers, + Function(UploadProgress)? onProgress, + }) async { + InputFile file = params[paramName]; + if (file.path == null && file.bytes == null) { + throw {{spec.title | caseUcfirst}}Exception("File path or bytes must be provided"); + } + + int size = 0; + if (file.bytes != null) { + size = file.bytes!.length; + } + + File? iofile; + + if (file.path != null) { + iofile = File(file.path!); + size = await iofile.length(); + } + + late Response res; + if (size <= CHUNK_SIZE) { + if (file.path != null) { + params[paramName] = await http.MultipartFile.fromPath( + paramName, file.path!, + filename: file.filename); + } else { + params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!, + filename: file.filename); + } + return call( + HttpMethod.post, + path: path, + params: params, + headers: headers, + ); + } + + var offset = 0; + if (idParamName.isNotEmpty && params[idParamName] != 'unique()') { + //make a request to check if a file already exists + try { + res = await call( + HttpMethod.get, + path: path + '/' + params[idParamName], + headers: headers, + ); + final int chunksUploaded = res.data['chunksUploaded'] as int; + offset = min(size, chunksUploaded * CHUNK_SIZE); + } on {{spec.title | caseUcfirst}}Exception catch (_) {} + } + + RandomAccessFile? raf; + // read chunk and upload each chunk + if (iofile != null) { + raf = await iofile.open(mode: FileMode.read); + } + + while (offset < size) { + var chunk; + if (file.bytes != null) { + final end = min(offset + CHUNK_SIZE-1, size-1); + chunk = file.bytes!.getRange(offset, end).toList(); + } else { + raf!.setPositionSync(offset); + chunk = raf.readSync(CHUNK_SIZE); + } + params[paramName] = + http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); + headers['content-range'] = + 'bytes $offset-${min(((offset + CHUNK_SIZE) - 1), size)}/$size'; + res = await call(HttpMethod.post, + path: path, headers: headers, params: params); + offset += CHUNK_SIZE; + if (offset < size) { + headers['x-{{spec.title | caseLower }}-id'] = res.data['\$id']; + } + final progress = UploadProgress( + $id: res.data['\$id'] ?? '', + progress: min(offset - 1, size) / size * 100, + sizeUploaded: min(offset - 1, size), + chunksTotal: res.data['chunksTotal'] ?? 0, + chunksUploaded: res.data['chunksUploaded'] ?? 0, + ); + onProgress?.call(progress); + } + raf?.close(); + return res; + } + @override Future webAuth(Uri url) { return FlutterWebAuth.authenticate( From 9509ea708abc35ebc090ac2d0df443e23555020a Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 15 Jun 2022 01:44:42 +0000 Subject: [PATCH 059/555] refactor dart SDK templates --- src/SDK/Language/Dart.php | 18 --- templates/dart/base/requests/file.twig | 3 +- templates/dart/lib/package.dart.twig | 3 - .../lib/src/chunked_upload_browser.dart.twig | 75 ------------- .../dart/lib/src/chunked_upload_io.dart.twig | 105 ------------------ .../lib/src/chunked_upload_stub.dart.twig | 14 --- templates/dart/lib/src/client.dart.twig | 11 ++ .../dart/lib/src/client_browser.dart.twig | 71 ++++++++++++ templates/dart/lib/src/client_io.dart.twig | 100 +++++++++++++++++ 9 files changed, 183 insertions(+), 217 deletions(-) delete mode 100644 templates/dart/lib/src/chunked_upload_browser.dart.twig delete mode 100644 templates/dart/lib/src/chunked_upload_io.dart.twig delete mode 100644 templates/dart/lib/src/chunked_upload_stub.dart.twig diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index f00fa9468c..b79237b481 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -420,24 +420,6 @@ public function getFiles() 'template' => 'dart/lib/src/input_file.dart.twig', 'minify' => false, ], - [ - 'scope' => 'default', - 'destination' => 'lib/src/chunked_upload_io.dart', - 'template' => 'dart/lib/src/chunked_upload_io.dart.twig', - 'minify' => false, - ], - [ - 'scope' => 'default', - 'destination' => 'lib/src/chunked_upload_browser.dart', - 'template' => 'dart/lib/src/chunked_upload_browser.dart.twig', - 'minify' => false, - ], - [ - 'scope' => 'default', - 'destination' => 'lib/src/chunked_upload_stub.dart', - 'template' => 'dart/lib/src/chunked_upload_stub.dart.twig', - 'minify' => false, - ], ]; } } diff --git a/templates/dart/base/requests/file.twig b/templates/dart/base/requests/file.twig index a639cf7b76..b469b48319 100644 --- a/templates/dart/base/requests/file.twig +++ b/templates/dart/base/requests/file.twig @@ -18,8 +18,7 @@ idParamName = '{{ parameter.name }}'; {% endif %} {% endfor %} - final res = await chunkedUpload( - client: client, + final res = await client.chunkedUpload( path: path, params: params, paramName: paramName, diff --git a/templates/dart/lib/package.dart.twig b/templates/dart/lib/package.dart.twig index 2b3f629a58..669717f72a 100644 --- a/templates/dart/lib/package.dart.twig +++ b/templates/dart/lib/package.dart.twig @@ -3,9 +3,6 @@ library {{ language.params.packageName }}; import 'dart:async'; import 'dart:typed_data'; import 'package:http/http.dart' show MultipartFile; -import 'src/chunked_upload_stub.dart' - if (dart.library.html) 'src/chunked_upload_browser.dart' - if (dart.library.io) 'src/chunked_upload_io.dart'; import 'src/enums.dart'; import 'src/client.dart'; import 'src/service.dart'; diff --git a/templates/dart/lib/src/chunked_upload_browser.dart.twig b/templates/dart/lib/src/chunked_upload_browser.dart.twig deleted file mode 100644 index b06a5acd19..0000000000 --- a/templates/dart/lib/src/chunked_upload_browser.dart.twig +++ /dev/null @@ -1,75 +0,0 @@ -import 'client.dart'; -import 'enums.dart'; -import 'package:http/http.dart' as http; -import 'response.dart'; -import 'dart:math'; -import 'input_file.dart'; -import 'exception.dart'; -import 'upload_progress.dart'; - -Future chunkedUpload({ - required Client client, - required String path, - required Map params, - required String paramName, - required String idParamName, - required Map headers, - Function(UploadProgress)? onProgress, -}) async { - InputFile file = params[paramName]; - if (file.bytes == null) { - throw {{spec.title | caseUcfirst}}Exception("File bytes must be provided"); - } - - int size = file.bytes!.length; - - late Response res; - if (size <= Client.CHUNK_SIZE) { - params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!, filename: file.filename); - return client.call( - HttpMethod.post, - path: path, - params: params, - headers: headers, - ); - } - - var offset = 0; - if (idParamName.isNotEmpty && params[idParamName] != 'unique()') { - //make a request to check if a file already exists - try { - res = await client.call( - HttpMethod.get, - path: path + '/' + params[idParamName], - headers: headers, - ); - final int chunksUploaded = res.data['chunksUploaded'] as int; - offset = min(size, chunksUploaded * Client.CHUNK_SIZE); - } on {{spec.title | caseUcfirst}}Exception catch (_) {} - } - - while (offset < size) { - var chunk; - final end = min(offset + Client.CHUNK_SIZE-1, size-1); - chunk = file.bytes!.getRange(offset, end).toList(); - params[paramName] = - http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); - headers['content-range'] = - 'bytes $offset-${min(((offset + Client.CHUNK_SIZE) - 1), size)}/$size'; - res = await client.call(HttpMethod.post, - path: path, headers: headers, params: params); - offset += Client.CHUNK_SIZE; - if (offset < size) { - headers['x-{{spec.title | caseLower }}-id'] = res.data['\$id']; - } - final progress = UploadProgress( - $id: res.data['\$id'] ?? '', - progress: min(offset - 1, size) / size * 100, - sizeUploaded: min(offset - 1, size), - chunksTotal: res.data['chunksTotal'] ?? 0, - chunksUploaded: res.data['chunksUploaded'] ?? 0, - ); - onProgress?.call(progress); - } - return res; -} diff --git a/templates/dart/lib/src/chunked_upload_io.dart.twig b/templates/dart/lib/src/chunked_upload_io.dart.twig deleted file mode 100644 index 02aa19d267..0000000000 --- a/templates/dart/lib/src/chunked_upload_io.dart.twig +++ /dev/null @@ -1,105 +0,0 @@ -import 'client.dart'; -import 'dart:io' as io; -import 'enums.dart'; -import 'package:http/http.dart' as http; -import 'response.dart'; -import 'dart:math'; -import 'input_file.dart'; -import 'exception.dart'; -import 'upload_progress.dart'; - -Future chunkedUpload({ - required Client client, - required String path, - required Map params, - required String paramName, - required String idParamName, - required Map headers, - Function(UploadProgress)? onProgress, -}) async { - InputFile file = params[paramName]; - if (file.path == null && file.bytes == null) { - throw {{spec.title | caseUcfirst}}Exception("File path or bytes must be provided"); - } - - int size = 0; - if (file.bytes != null) { - size = file.bytes!.length; - } - - io.File? iofile; - - if (file.path != null) { - iofile = io.File(file.path!); - size = await iofile.length(); - } - - late Response res; - if (size <= Client.CHUNK_SIZE) { - if (file.path != null) { - params[paramName] = await http.MultipartFile.fromPath( - paramName, file.path!, - filename: file.filename); - } else { - params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!, - filename: file.filename); - } - return client.call( - HttpMethod.post, - path: path, - params: params, - headers: headers, - ); - } - - var offset = 0; - if (idParamName.isNotEmpty && params[idParamName] != 'unique()') { - //make a request to check if a file already exists - try { - res = await client.call( - HttpMethod.get, - path: path + '/' + params[idParamName], - headers: headers, - ); - final int chunksUploaded = res.data['chunksUploaded'] as int; - offset = min(size, chunksUploaded * Client.CHUNK_SIZE); - } on {{spec.title | caseUcfirst}}Exception catch (_) {} - } - - io.RandomAccessFile? raf; - // read chunk and upload each chunk - if (iofile != null) { - raf = await iofile.open(mode: io.FileMode.read); - } - - while (offset < size) { - var chunk; - if (file.bytes != null) { - final end = min(offset + Client.CHUNK_SIZE-1, size-1); - chunk = file.bytes!.getRange(offset, end).toList(); - } else { - raf!.setPositionSync(offset); - chunk = raf.readSync(Client.CHUNK_SIZE); - } - params[paramName] = - http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); - headers['content-range'] = - 'bytes $offset-${min(((offset + Client.CHUNK_SIZE) - 1), size)}/$size'; - res = await client.call(HttpMethod.post, - path: path, headers: headers, params: params); - offset += Client.CHUNK_SIZE; - if (offset < size) { - headers['x-{{spec.title | caseLower }}-id'] = res.data['\$id']; - } - final progress = UploadProgress( - $id: res.data['\$id'] ?? '', - progress: min(offset - 1, size) / size * 100, - sizeUploaded: min(offset - 1, size), - chunksTotal: res.data['chunksTotal'] ?? 0, - chunksUploaded: res.data['chunksUploaded'] ?? 0, - ); - onProgress?.call(progress); - } - raf?.close(); - return res; -} diff --git a/templates/dart/lib/src/chunked_upload_stub.dart.twig b/templates/dart/lib/src/chunked_upload_stub.dart.twig deleted file mode 100644 index 46129af35e..0000000000 --- a/templates/dart/lib/src/chunked_upload_stub.dart.twig +++ /dev/null @@ -1,14 +0,0 @@ -import 'response.dart'; -import 'client.dart'; -import 'upload_progress.dart'; - -Future chunkedUpload({ - required Client client, - required String path, - required Map params, - required String paramName, - required String idParamName, - required Map headers, - Function(UploadProgress)? onProgress -}) => - throw UnsupportedError('Chunked upload not yet supported in this platform'); diff --git a/templates/dart/lib/src/client.dart.twig b/templates/dart/lib/src/client.dart.twig index 231e80fdc4..774335f20b 100644 --- a/templates/dart/lib/src/client.dart.twig +++ b/templates/dart/lib/src/client.dart.twig @@ -3,6 +3,8 @@ import 'client_stub.dart' if (dart.library.html) 'client_browser.dart' if (dart.library.io) 'client_io.dart'; import 'response.dart'; +import 'input_file.dart'; +import 'upload_progress.dart'; abstract class Client { static const int CHUNK_SIZE = 5*1024*1024; @@ -29,6 +31,15 @@ abstract class Client { Client addHeader(String key, String value); + Future chunkedUpload({ + required String path, + required Map params, + required String paramName, + required String idParamName, + required Map headers, + Function(UploadProgress)? onProgress, + }); + Future call(HttpMethod method, { String path = '', Map headers = const {}, diff --git a/templates/dart/lib/src/client_browser.dart.twig b/templates/dart/lib/src/client_browser.dart.twig index 5590d0c204..69e34fc9ee 100644 --- a/templates/dart/lib/src/client_browser.dart.twig +++ b/templates/dart/lib/src/client_browser.dart.twig @@ -1,3 +1,4 @@ +import 'dart:math'; import 'package:http/http.dart' as http; import 'package:http/browser_client.dart'; import 'client_mixin.dart'; @@ -5,6 +6,8 @@ import 'enums.dart'; import 'exception.dart'; import 'client_base.dart'; import 'response.dart'; +import 'input_file.dart'; +import 'upload_progress.dart'; ClientBase createClient({ required String endPoint, @@ -13,6 +16,7 @@ ClientBase createClient({ ClientBrowser(endPoint: endPoint, selfSigned: selfSigned); class ClientBrowser extends ClientBase with ClientMixin { + static const int CHUNK_SIZE = 5*1024*1024; String _endPoint; Map? _headers; @override @@ -70,6 +74,73 @@ class ClientBrowser extends ClientBase with ClientMixin { return this; } + @override + Future chunkedUpload({ + required String path, + required Map params, + required String paramName, + required String idParamName, + required Map headers, + Function(UploadProgress)? onProgress, + }) async { + InputFile file = params[paramName]; + if (file.bytes == null) { + throw {{spec.title | caseUcfirst}}Exception("File bytes must be provided for Flutter web"); + } + + int size = file.bytes!.length; + + late Response res; + if (size <= CHUNK_SIZE) { + params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!, filename: file.filename); + return call( + HttpMethod.post, + path: path, + params: params, + headers: headers, + ); + } + + var offset = 0; + if (idParamName.isNotEmpty && params[idParamName] != 'unique()') { + //make a request to check if a file already exists + try { + res = await call( + HttpMethod.get, + path: path + '/' + params[idParamName], + headers: headers, + ); + final int chunksUploaded = res.data['chunksUploaded'] as int; + offset = min(size, chunksUploaded * CHUNK_SIZE); + } on {{spec.title | caseUcfirst}}Exception catch (_) {} + } + + while (offset < size) { + var chunk; + final end = min(offset + CHUNK_SIZE-1, size-1); + chunk = file.bytes!.getRange(offset, end).toList(); + params[paramName] = + http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); + headers['content-range'] = + 'bytes $offset-${min(((offset + CHUNK_SIZE) - 1), size)}/$size'; + res = await call(HttpMethod.post, + path: path, headers: headers, params: params); + offset += CHUNK_SIZE; + if (offset < size) { + headers['x-{{spec.title | caseLower }}-id'] = res.data['\$id']; + } + final progress = UploadProgress( + $id: res.data['\$id'] ?? '', + progress: min(offset - 1, size) / size * 100, + sizeUploaded: min(offset - 1, size), + chunksTotal: res.data['chunksTotal'] ?? 0, + chunksUploaded: res.data['chunksUploaded'] ?? 0, + ); + onProgress?.call(progress); + } + return res; + } + @override Future call( HttpMethod method, { diff --git a/templates/dart/lib/src/client_io.dart.twig b/templates/dart/lib/src/client_io.dart.twig index 47ef2c9605..1e9d4da38a 100644 --- a/templates/dart/lib/src/client_io.dart.twig +++ b/templates/dart/lib/src/client_io.dart.twig @@ -1,4 +1,5 @@ import 'dart:io'; +import 'dart:math'; import 'package:http/http.dart' as http; import 'package:http/io_client.dart'; import 'client_mixin.dart'; @@ -6,6 +7,8 @@ import 'client_base.dart'; import 'enums.dart'; import 'exception.dart'; import 'response.dart'; +import 'input_file.dart'; +import 'upload_progress.dart'; ClientBase createClient({ required String endPoint, @@ -17,6 +20,7 @@ ClientBase createClient({ ); class ClientIO extends ClientBase with ClientMixin { + static const int CHUNK_SIZE = 5*1024*1024; String _endPoint; Map? _headers; @override @@ -81,6 +85,102 @@ class ClientIO extends ClientBase with ClientMixin { return this; } + @override + Future chunkedUpload({ + required String path, + required Map params, + required String paramName, + required String idParamName, + required Map headers, + Function(UploadProgress)? onProgress, + }) async { + InputFile file = params[paramName]; + if (file.path == null && file.bytes == null) { + throw {{spec.title | caseUcfirst}}Exception("File path or bytes must be provided"); + } + + int size = 0; + if (file.bytes != null) { + size = file.bytes!.length; + } + + File? iofile; + + if (file.path != null) { + iofile = File(file.path!); + size = await iofile.length(); + } + + late Response res; + if (size <= CHUNK_SIZE) { + if (file.path != null) { + params[paramName] = await http.MultipartFile.fromPath( + paramName, file.path!, + filename: file.filename); + } else { + params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!, + filename: file.filename); + } + return call( + HttpMethod.post, + path: path, + params: params, + headers: headers, + ); + } + + var offset = 0; + if (idParamName.isNotEmpty && params[idParamName] != 'unique()') { + //make a request to check if a file already exists + try { + res = await call( + HttpMethod.get, + path: path + '/' + params[idParamName], + headers: headers, + ); + final int chunksUploaded = res.data['chunksUploaded'] as int; + offset = min(size, chunksUploaded * CHUNK_SIZE); + } on {{spec.title | caseUcfirst}}Exception catch (_) {} + } + + RandomAccessFile? raf; + // read chunk and upload each chunk + if (iofile != null) { + raf = await iofile.open(mode: FileMode.read); + } + + while (offset < size) { + var chunk; + if (file.bytes != null) { + final end = min(offset + CHUNK_SIZE-1, size-1); + chunk = file.bytes!.getRange(offset, end).toList(); + } else { + raf!.setPositionSync(offset); + chunk = raf.readSync(CHUNK_SIZE); + } + params[paramName] = + http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); + headers['content-range'] = + 'bytes $offset-${min(((offset + CHUNK_SIZE) - 1), size)}/$size'; + res = await call(HttpMethod.post, + path: path, headers: headers, params: params); + offset += CHUNK_SIZE; + if (offset < size) { + headers['x-{{spec.title | caseLower }}-id'] = res.data['\$id']; + } + final progress = UploadProgress( + $id: res.data['\$id'] ?? '', + progress: min(offset - 1, size) / size * 100, + sizeUploaded: min(offset - 1, size), + chunksTotal: res.data['chunksTotal'] ?? 0, + chunksUploaded: res.data['chunksUploaded'] ?? 0, + ); + onProgress?.call(progress); + } + raf?.close(); + return res; + } + @override Future call( HttpMethod method, { From 4975b2bd8ea785dc6a4f49a3fdb4961dfc8f93f2 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 16 Jun 2022 01:54:04 +0000 Subject: [PATCH 060/555] fix method names --- src/SDK/Language/Dart.php | 2 +- src/SDK/Language/DotNet.php | 2 +- src/SDK/Language/Go.php | 2 +- src/SDK/Language/Ruby.php | 2 +- src/SDK/Language/Swift.php | 2 +- src/SDK/Language/Web.php | 14 ++++++++++++++ 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index 9234147232..f822261fd3 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -436,7 +436,7 @@ public function getFiles() ]; } - public function getTwigFilters() + public function getFilters(): array { return [ new TwigFilter('dartComment', function ($value) { diff --git a/src/SDK/Language/DotNet.php b/src/SDK/Language/DotNet.php index b41861a927..374e9f373c 100644 --- a/src/SDK/Language/DotNet.php +++ b/src/SDK/Language/DotNet.php @@ -378,7 +378,7 @@ public function getFiles() ]; } - public function getTwigFilters() + public function getFilters(): array { return [ new TwigFilter('dotnetComment', function ($value) { diff --git a/src/SDK/Language/Go.php b/src/SDK/Language/Go.php index dbf4a4eee4..d480a3122a 100644 --- a/src/SDK/Language/Go.php +++ b/src/SDK/Language/Go.php @@ -248,7 +248,7 @@ public function getParamExample(array $param) return $output; } - public function getTwigFilters() + public function getFilters(): array { return [ new TwigFilter('godocComment', function ($value) { diff --git a/src/SDK/Language/Ruby.php b/src/SDK/Language/Ruby.php index 949e7b5961..9d13aa6848 100644 --- a/src/SDK/Language/Ruby.php +++ b/src/SDK/Language/Ruby.php @@ -329,7 +329,7 @@ protected function jsonToHash(array $data):string return $output; } - public function getTwigFilters() + public function getFilters(): array { return [ new TwigFilter('rubyComment', function ($value) { diff --git a/src/SDK/Language/Swift.php b/src/SDK/Language/Swift.php index 1a8fea8a3c..cc2b0aa31a 100644 --- a/src/SDK/Language/Swift.php +++ b/src/SDK/Language/Swift.php @@ -434,7 +434,7 @@ public function getParamExample(array $param) return $output; } - public function getTwigFilters() + public function getFilters(): array { return [ new TwigFilter('swiftComment', function ($value) { diff --git a/src/SDK/Language/Web.php b/src/SDK/Language/Web.php index f1556c7c4b..4484147782 100644 --- a/src/SDK/Language/Web.php +++ b/src/SDK/Language/Web.php @@ -338,6 +338,20 @@ public function getFilters(): array new TwigFilter('getReturn', function (array $method, array $spec) { return $this->getReturn($method, $spec); }), + new TwigFilter('comment2', function ($value) { + $value = explode("\n", $value); + foreach ($value as $key => $line) { + $value[$key] = " * " . wordwrap($value[$key], 75, "\n * "); + } + return implode("\n", $value); + }, ['is_safe' => ['html']]), + new TwigFilter('comment3', function ($value) { + $value = explode("\n", $value); + foreach ($value as $key => $line) { + $value[$key] = " * " . wordwrap($value[$key], 75, "\n * "); + } + return implode("\n", $value); + }, ['is_safe' => ['html']]), ]; } } From 525d3d970ed3d911b0346931b1abc6913935fb26 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 16 Jun 2022 01:57:05 +0000 Subject: [PATCH 061/555] fix sdk --- src/SDK/SDK.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index e0b1095b72..4eae44775f 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -179,11 +179,6 @@ public function __construct(Language $language, Spec $spec) } return $value; })); - - // Language specific filters - foreach($language->getTwigFilters() as $filter) { - $this->twig->addFilter($filter); - } } /** From 9105b07aaa51c4889d079525dc89765f8b190d19 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 20 Jun 2022 06:54:45 +0000 Subject: [PATCH 062/555] empty response check --- src/SDK/Language/PHP.php | 18 ++++++++++++++++++ src/Spec/Swagger2.php | 5 +++++ templates/php/src/Services/Service.php.twig | 4 ++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index a5d789d232..2f46390b5f 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -3,6 +3,7 @@ namespace Appwrite\SDK\Language; use Appwrite\SDK\Language; +use Twig\TwigFilter; class PHP extends Language { @@ -356,4 +357,21 @@ protected function jsonToAssoc(array $data):string return $output; } + + protected function getReturn(array $method): string + { + if(($method['emptyResponse'] ?? true) || $method['type'] === 'location') { + return 'string'; + } + + return 'array'; + } + + public function getFilters(): array { + return [ + new TwigFilter('getReturn', function($value) { + return $this->getReturn($value); + }) + ]; + } } diff --git a/src/Spec/Swagger2.php b/src/Spec/Swagger2.php index 542fa4e179..9450d65c14 100644 --- a/src/Spec/Swagger2.php +++ b/src/Spec/Swagger2.php @@ -149,7 +149,11 @@ public function getMethods($service) $responses = $method['responses']; $responseModel = ''; + $emptyResponse = true; foreach($responses as $code => $desc) { + if($code != '204') { + $emptyResponse = false; + } if(isset($desc['schema']) && isset($desc['schema']['$ref'])) { $responseModel = $desc['schema']['$ref']; if(!empty($responseModel)) { @@ -178,6 +182,7 @@ public function getMethods($service) 'query' => [], 'body' => [], ], + 'emptyResponse' => $emptyResponse, 'responseModel' => $responseModel, ]; diff --git a/templates/php/src/Services/Service.php.twig b/templates/php/src/Services/Service.php.twig index 7e4d6ee022..e75d8e45f8 100644 --- a/templates/php/src/Services/Service.php.twig +++ b/templates/php/src/Services/Service.php.twig @@ -20,10 +20,10 @@ class {{ service.name | caseUcfirst }} extends Service * @param {{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{spec.title | caseUcfirst}}Exception - * @return {% if (method.type == 'location') %}string{% else %}array{% endif %} + * @return {{ method | getReturn }} */ - public function {{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, callable $onProgress = null{% endif %}): {% if (method.type == 'location') %}string{% else %}array{% endif %} + public function {{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, callable $onProgress = null{% endif %}): {{ method | getReturn }} { {% for parameter in method.parameters.all %} From c0b79acebe2da49654bfebb51b7f6722a8cbe87f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 20 Jun 2022 07:26:14 +0000 Subject: [PATCH 063/555] php template refactor --- templates/php/base/requests/api.twig | 8 ++ templates/php/base/requests/file.twig | 65 +++++++++++++ templates/php/base/requests/params.twig | 25 +++++ templates/php/src/Services/Service.php.twig | 100 +------------------- 4 files changed, 101 insertions(+), 97 deletions(-) create mode 100644 templates/php/base/requests/api.twig create mode 100644 templates/php/base/requests/file.twig create mode 100644 templates/php/base/requests/params.twig diff --git a/templates/php/base/requests/api.twig b/templates/php/base/requests/api.twig new file mode 100644 index 0000000000..72aee3648a --- /dev/null +++ b/templates/php/base/requests/api.twig @@ -0,0 +1,8 @@ + return $this->client->call(Client::METHOD_{{ method.method | caseUpper }}, $path, [ +{% for parameter in method.parameters.header %} + '{{ parameter.name }}' => ${{ parameter.name | caseCamel | escapeKeyword }}, +{% endfor %} +{% for key, header in method.headers %} + '{{ key }}' => '{{ header }}', +{% endfor %} + ], $params); \ No newline at end of file diff --git a/templates/php/base/requests/file.twig b/templates/php/base/requests/file.twig new file mode 100644 index 0000000000..6083a3de67 --- /dev/null +++ b/templates/php/base/requests/file.twig @@ -0,0 +1,65 @@ +{% if 'multipart/form-data' in method.consumes %} +{% for parameter in method.parameters.all %} +{% if parameter.type == 'file' %} + $size = filesize(${{ parameter.name | caseCamel }}); + $mimeType = mime_content_type(${{ parameter.name | caseCamel }}); + $postedName = basename(${{ parameter.name | caseCamel }}); + //send single file if size is less than or equal to 5MB + if ($size <= Client::CHUNK_SIZE) { + $params['{{ parameter.name }}'] = new \CURLFile(${{ parameter.name | caseCamel }}, $mimeType, $postedName); + return $this->client->call(Client::METHOD_{{ method.method | caseUpper }}, $path, [ +{% for param in method.parameters.header %} + '{{ param.name }}' => ${{ param.name | caseCamel }}, +{% endfor %} +{% for key, header in method.headers %} + '{{ key }}' => '{{ header }}', +{% endfor %} + ], $params); + } + + $id = ''; + $counter = 0; + +{% for parameter in method.parameters.all %} +{% if parameter.isUploadID %} + if(${{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { + try { + $response = $this->client->call(Client::METHOD_GET, new URL($path . '/' . {{ parameter.name }}), headers); + $counter = $response['chunksUploaded'] ?? 0; + } catch(\Exception $e) { + } + } +{% endif %} +{% endfor %} + + $headers = ['content-type' => 'multipart/form-data']; + $handle = @fopen(${{ parameter.name | caseCamel }}, "rb"); + $start = $counter * Client::CHUNK_SIZE; + while ($start < $size) { + fseek($handle, $start); + $params['{{ parameter.name }}'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode(@fread($handle, Client::CHUNK_SIZE)), $mimeType, $postedName); + $headers['content-range'] = 'bytes ' . ($counter * Client::CHUNK_SIZE) . '-' . min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size) . '/' . $size; + if(!empty($id)) { + $headers['x-{{spec.title | caseLower }}-id'] = $id; + } + $response = $this->client->call(Client::METHOD_POST, $path, $headers, $params); + $counter++; + $start += Client::CHUNK_SIZE; + if(empty($id)) { + $id = $response['$id']; + } + if($onProgress !== null) { + $onProgress([ + '$id' => $response['$id'], + 'progress' => min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size) / $size * 100, + 'sizeUploaded' => min($counter * Client::CHUNK_SIZE), + 'chunksTotal' => $response['chunksTotal'], + 'chunksUploaded' => $response['chunksUploaded'], + ]); + } + } + @fclose($handle); + return $response; +{% endif %} +{% endfor %} +{% endif %} \ No newline at end of file diff --git a/templates/php/base/requests/params.twig b/templates/php/base/requests/params.twig new file mode 100644 index 0000000000..c310f45f53 --- /dev/null +++ b/templates/php/base/requests/params.twig @@ -0,0 +1,25 @@ +{% for parameter in method.parameters.all %} +{% if parameter.required %} + if (!isset(${{ parameter.name | caseCamel | escapeKeyword }})) { + throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); + } +{% endif %} +{% endfor %} + +{% for parameter in method.parameters.query %} + if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { + $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; + } + +{% endfor %} +{% for parameter in method.parameters.body %} + if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { + $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; + } + +{% endfor %} +{% for parameter in method.parameters.formData %} + if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { + $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; + } +{% endfor %} \ No newline at end of file diff --git a/templates/php/src/Services/Service.php.twig b/templates/php/src/Services/Service.php.twig index e75d8e45f8..03d01f52d7 100644 --- a/templates/php/src/Services/Service.php.twig +++ b/templates/php/src/Services/Service.php.twig @@ -24,110 +24,16 @@ class {{ service.name | caseUcfirst }} extends Service */ public function {{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, callable $onProgress = null{% endif %}): {{ method | getReturn }} - { -{% for parameter in method.parameters.all %} -{% if parameter.required %} - if (!isset(${{ parameter.name | caseCamel | escapeKeyword }})) { - throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); - } - -{% endif %} -{% endfor %} $path = str_replace([{% for parameter in method.parameters.path %}'{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}'{% if not loop.last %}, {% endif %}{% endfor %}], [{% for parameter in method.parameters.path %}${{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}], '{{ method.path }}'); $params = []; -{% for parameter in method.parameters.query %} - if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { - $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; - } - -{% endfor %} -{% for parameter in method.parameters.body %} - if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { - $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; - } - -{% endfor %} -{% for parameter in method.parameters.formData %} - if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { - $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; - } +{{ include('php/base/requests/params.twig') }} -{% endfor %} {% if 'multipart/form-data' in method.consumes %} -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - $size = filesize(${{ parameter.name | caseCamel }}); - $mimeType = mime_content_type(${{ parameter.name | caseCamel }}); - $postedName = basename(${{ parameter.name | caseCamel }}); - //send single file if size is less than or equal to 5MB - if ($size <= Client::CHUNK_SIZE) { - $params['{{ parameter.name }}'] = new \CURLFile(${{ parameter.name | caseCamel }}, $mimeType, $postedName); - return $this->client->call(Client::METHOD_{{ method.method | caseUpper }}, $path, [ -{% for param in method.parameters.header %} - '{{ param.name }}' => ${{ param.name | caseCamel }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}' => '{{ header }}', -{% endfor %} - ], $params); - } - - $id = ''; - $counter = 0; - -{% for parameter in method.parameters.all %} -{% if parameter.isUploadID %} - if(${{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { - try { - $response = $this->client->call(Client::METHOD_GET, new URL($path . '/' . {{ parameter.name }}), headers); - $counter = $response['chunksUploaded'] ?? 0; - } catch(\Exception $e) { - } - } -{% endif %} -{% endfor %} - - $headers = ['content-type' => 'multipart/form-data']; - $handle = @fopen(${{ parameter.name | caseCamel }}, "rb"); - $start = $counter * Client::CHUNK_SIZE; - while ($start < $size) { - fseek($handle, $start); - $params['{{ parameter.name }}'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode(@fread($handle, Client::CHUNK_SIZE)), $mimeType, $postedName); - $headers['content-range'] = 'bytes ' . ($counter * Client::CHUNK_SIZE) . '-' . min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size) . '/' . $size; - if(!empty($id)) { - $headers['x-{{spec.title | caseLower }}-id'] = $id; - } - $response = $this->client->call(Client::METHOD_POST, $path, $headers, $params); - $counter++; - $start += Client::CHUNK_SIZE; - if(empty($id)) { - $id = $response['$id']; - } - if($onProgress !== null) { - $onProgress([ - '$id' => $response['$id'], - 'progress' => min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size) / $size * 100, - 'sizeUploaded' => min($counter * Client::CHUNK_SIZE), - 'chunksTotal' => $response['chunksTotal'], - 'chunksUploaded' => $response['chunksUploaded'], - ]); - } - } - @fclose($handle); - return $response; -{% endif %} -{% endfor %} +{{ include('php/base/requests/file.twig') }} {% else %} - return $this->client->call(Client::METHOD_{{ method.method | caseUpper }}, $path, [ -{% for parameter in method.parameters.header %} - '{{ parameter.name }}' => ${{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}' => '{{ header }}', -{% endfor %} - ], $params); +{{ include('php/base/requests/api.twig') }} {% endif %} } {% if not loop.last %} From 341d6542f6b8843b77ed0dc70c146ce2e7fa623d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 20 Jun 2022 07:37:33 +0000 Subject: [PATCH 064/555] spacing fixes --- templates/php/base/requests/params.twig | 6 ++++-- templates/php/src/Services/Service.php.twig | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/php/base/requests/params.twig b/templates/php/base/requests/params.twig index c310f45f53..04813d936f 100644 --- a/templates/php/base/requests/params.twig +++ b/templates/php/base/requests/params.twig @@ -1,3 +1,5 @@ + $params = []; +{% if method.parameters.all | length %} {% for parameter in method.parameters.all %} {% if parameter.required %} if (!isset(${{ parameter.name | caseCamel | escapeKeyword }})) { @@ -5,7 +7,6 @@ } {% endif %} {% endfor %} - {% for parameter in method.parameters.query %} if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; @@ -22,4 +23,5 @@ if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; } -{% endfor %} \ No newline at end of file +{% endfor %} +{% endif %} \ No newline at end of file diff --git a/templates/php/src/Services/Service.php.twig b/templates/php/src/Services/Service.php.twig index 03d01f52d7..e9eb665308 100644 --- a/templates/php/src/Services/Service.php.twig +++ b/templates/php/src/Services/Service.php.twig @@ -26,10 +26,8 @@ class {{ service.name | caseUcfirst }} extends Service public function {{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, callable $onProgress = null{% endif %}): {{ method | getReturn }} { $path = str_replace([{% for parameter in method.parameters.path %}'{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}'{% if not loop.last %}, {% endif %}{% endfor %}], [{% for parameter in method.parameters.path %}${{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}], '{{ method.path }}'); - $params = []; {{ include('php/base/requests/params.twig') }} - {% if 'multipart/form-data' in method.consumes %} {{ include('php/base/requests/file.twig') }} {% else %} From d78d1e50a5136cd320d9df290c75baf9b38605fa Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 21 Jun 2022 08:01:33 +0000 Subject: [PATCH 065/555] remove extra comma --- templates/php/src/Services/Service.php.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/php/src/Services/Service.php.twig b/templates/php/src/Services/Service.php.twig index 6fbea7e8dd..58fbd9b42e 100644 --- a/templates/php/src/Services/Service.php.twig +++ b/templates/php/src/Services/Service.php.twig @@ -102,7 +102,7 @@ class {{ service.name | caseUcfirst }} extends Service {% if parameter.isUploadID %} if(${{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { try { - $response = $this->client->call(Client::METHOD_GET, $path . '/' . ${{ parameter.name }},); + $response = $this->client->call(Client::METHOD_GET, $path . '/' . ${{ parameter.name }}); $counter = $response['chunksUploaded'] ?? 0; } catch(\Exception $e) { } From e7ef9bbf4b3862bbbaec9c3f616b6c5ea430a1ae Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 21 Jun 2022 08:33:33 +0000 Subject: [PATCH 066/555] fix --- templates/php/base/requests/file.twig | 85 ++++++++++++++++++--------- 1 file changed, 58 insertions(+), 27 deletions(-) diff --git a/templates/php/base/requests/file.twig b/templates/php/base/requests/file.twig index 6083a3de67..a68adae016 100644 --- a/templates/php/base/requests/file.twig +++ b/templates/php/base/requests/file.twig @@ -1,20 +1,39 @@ -{% if 'multipart/form-data' in method.consumes %} {% for parameter in method.parameters.all %} {% if parameter.type == 'file' %} - $size = filesize(${{ parameter.name | caseCamel }}); - $mimeType = mime_content_type(${{ parameter.name | caseCamel }}); - $postedName = basename(${{ parameter.name | caseCamel }}); - //send single file if size is less than or equal to 5MB - if ($size <= Client::CHUNK_SIZE) { - $params['{{ parameter.name }}'] = new \CURLFile(${{ parameter.name | caseCamel }}, $mimeType, $postedName); - return $this->client->call(Client::METHOD_{{ method.method | caseUpper }}, $path, [ -{% for param in method.parameters.header %} - '{{ param.name }}' => ${{ param.name | caseCamel }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}' => '{{ header }}', -{% endfor %} - ], $params); + $size = 0; + $mimeType = null; + $postedName = null; + if(empty(${{ parameter.name | caseCamel }}->getPath())) { + $size = strlen(${{ parameter.name | caseCamel }}->getData()); + $mimeType = ${{ parameter.name | caseCamel }}->getMimeType(); + $postedName = ${{ parameter.name | caseCamel }}->getFilename(); + if ($size <= Client::CHUNK_SIZE) { + $params['{{ parameter.name | caseCamel }}'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode(${{ parameter.name | caseCamel }}->getData()), $mimeType, $postedName); + return $this->client->call(Client::METHOD_POST, $path, [ + {% for param in method.parameters.header %} + '{{ param.name }}' => ${{ param.name | caseCamel }}, + {% endfor %} + {% for key, header in method.headers %} + '{{ key }}' => '{{ header }}', + {% endfor %} + ], $params); + } + } else { + $size = filesize(${{ parameter.name | caseCamel }}->getPath()); + $mimeType = ${{ parameter.name | caseCamel }}->getMimeType() ?? mime_content_type(${{ parameter.name | caseCamel }}->getPath()); + $postedName = ${{ parameter.name | caseCamel }}->getFilename() ?? basename(${{ parameter.name | caseCamel }}->getPath()); + //send single file if size is less than or equal to 5MB + if ($size <= Client::CHUNK_SIZE) { + $params['{{ parameter.name }}'] = new \CURLFile(${{ parameter.name | caseCamel }}->getPath(), $mimeType, $postedName); + return $this->client->call(Client::METHOD_{{ method.method | caseUpper }}, $path, [ + {% for param in method.parameters.header %} + '{{ param.name }}' => ${{ param.name | caseCamel }}, + {% endfor %} + {% for key, header in method.headers %} + '{{ key }}' => '{{ header }}', + {% endfor %} + ], $params); + } } $id = ''; @@ -22,22 +41,33 @@ {% for parameter in method.parameters.all %} {% if parameter.isUploadID %} - if(${{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { - try { - $response = $this->client->call(Client::METHOD_GET, new URL($path . '/' . {{ parameter.name }}), headers); - $counter = $response['chunksUploaded'] ?? 0; - } catch(\Exception $e) { - } + if(${{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { + try { + $response = $this->client->call(Client::METHOD_GET, $path . '/' . ${{ parameter.name }}); + $counter = $response['chunksUploaded'] ?? 0; + } catch(\Exception $e) { } + } {% endif %} {% endfor %} $headers = ['content-type' => 'multipart/form-data']; - $handle = @fopen(${{ parameter.name | caseCamel }}, "rb"); + $handle = null; + + if(!empty(${{parameter.name}}->getPath())) { + $handle = @fopen(${{parameter.name}}->getPath(), "rb"); + } + $start = $counter * Client::CHUNK_SIZE; while ($start < $size) { - fseek($handle, $start); - $params['{{ parameter.name }}'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode(@fread($handle, Client::CHUNK_SIZE)), $mimeType, $postedName); + $chunk = ''; + if(!empty($handle)) { + fseek($handle, $start); + $chunk = @fread($handle, Client::CHUNK_SIZE); + } else { + $chunk = substr($file->getData(), $start, Client::CHUNK_SIZE); + } + $params['{{ parameter.name }}'] = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode($chunk), $mimeType, $postedName); $headers['content-range'] = 'bytes ' . ($counter * Client::CHUNK_SIZE) . '-' . min(((($counter * Client::CHUNK_SIZE) + Client::CHUNK_SIZE) - 1), $size) . '/' . $size; if(!empty($id)) { $headers['x-{{spec.title | caseLower }}-id'] = $id; @@ -58,8 +88,9 @@ ]); } } - @fclose($handle); + if(!empty($handle)) { + @fclose($handle); + } return $response; {% endif %} -{% endfor %} -{% endif %} \ No newline at end of file +{% endfor %} \ No newline at end of file From ba1781fe3edc7e77cfbae6bec799ea0a90900a49 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 21 Jun 2022 08:48:15 +0000 Subject: [PATCH 067/555] extra tests with data --- templates/php/base/requests/file.twig | 2 +- templates/php/src/InputFile.php.twig | 2 ++ tests/PHP74Test.php | 2 ++ tests/PHP80Test.php | 2 ++ tests/languages/php/test.php | 8 ++++++++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/templates/php/base/requests/file.twig b/templates/php/base/requests/file.twig index a68adae016..7f9b2d5dce 100644 --- a/templates/php/base/requests/file.twig +++ b/templates/php/base/requests/file.twig @@ -3,7 +3,7 @@ $size = 0; $mimeType = null; $postedName = null; - if(empty(${{ parameter.name | caseCamel }}->getPath())) { + if(empty(${{ parameter.name | caseCamel }}->getPath() ?? null)) { $size = strlen(${{ parameter.name | caseCamel }}->getData()); $mimeType = ${{ parameter.name | caseCamel }}->getMimeType(); $postedName = ${{ parameter.name | caseCamel }}->getFilename(); diff --git a/templates/php/src/InputFile.php.twig b/templates/php/src/InputFile.php.twig index 29f85b4f98..a7822196b1 100644 --- a/templates/php/src/InputFile.php.twig +++ b/templates/php/src/InputFile.php.twig @@ -33,6 +33,7 @@ class InputFile { { $instance = new InputFile(); $instance->path = $path; + $instance->data = null; $instance->mimeType = $mimeType; $instance->filename = $filename; return $instance; @@ -41,6 +42,7 @@ class InputFile { public static function withData(string $data, ?string $mimeType = null, ?string $filename = null) { $instance = new InputFile(); + $instance->path = null; $instance->data = $data; $instance->mimeType = $mimeType; $instance->filename = $filename; diff --git a/tests/PHP74Test.php b/tests/PHP74Test.php index 9b1946f650..22f3ef6645 100644 --- a/tests/PHP74Test.php +++ b/tests/PHP74Test.php @@ -15,6 +15,8 @@ class PHP74Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ]; } diff --git a/tests/PHP80Test.php b/tests/PHP80Test.php index bbdf09e4e6..d44a29af7d 100644 --- a/tests/PHP80Test.php +++ b/tests/PHP80Test.php @@ -15,6 +15,8 @@ class PHP80Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ]; } diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index 614a3a5e58..5667b27a2c 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -61,6 +61,14 @@ $response = $general->redirect(); echo "{$response['result']}\n"; +$data = file_get_contents(__DIR__ . '/../../resources/file.png'); +$response = $general->upload('string', 123, ['string in array'], InputFile::withData($data, 'image/png', 'file.png')); +echo "{$response['result']}\n"; + +$data = file_get_contents(__DIR__ . '/../../resources/large_file.mp4'); +$response = $general->upload('string', 123, ['string in array'], InputFile::withData($data, 'video/mp4', 'large_file.mp4')); +echo "{$response['result']}\n"; + $response = $general->upload('string', 123, ['string in array'], InputFile::withPath(__DIR__ .'/../../resources/file.png')); echo "{$response['result']}\n"; From 20cca39b4da57804b4d0be10be7c098af09d69e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 21 Jun 2022 14:52:33 +0000 Subject: [PATCH 068/555] Update web SDK example --- templates/web/README.md.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/web/README.md.twig b/templates/web/README.md.twig index 6d22ebaa23..667e4df7b5 100644 --- a/templates/web/README.md.twig +++ b/templates/web/README.md.twig @@ -33,7 +33,7 @@ npm install {{ language.params.npmPackage }} --save If you're using a bundler (like [Rollup](https://rollupjs.org/) or [webpack](https://webpack.js.org/)), you can import the {{ spec.title }} module when you need it: ```js -import {{ '{' }} {{ language.params.npmPackage|caseUcfirst }} {{ '}' }} from "{{ language.params.npmPackage }}"; +import {{ '{' }} Client, Account {{ '}' }} from "{{ language.params.npmPackage }}"; ``` ### CDN From d2f2f07cb98563a2c4256c38027589684ec96809 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 22 Jun 2022 19:27:44 +1200 Subject: [PATCH 069/555] Update ruby input file --- src/SDK/Language/Ruby.php | 8 ++--- templates/ruby/lib/container/file.rb.twig | 17 ----------- .../ruby/lib/container/input_file.rb.twig | 30 +++++++++++++++++++ 3 files changed, 34 insertions(+), 21 deletions(-) delete mode 100644 templates/ruby/lib/container/file.rb.twig create mode 100644 templates/ruby/lib/container/input_file.rb.twig diff --git a/src/SDK/Language/Ruby.php b/src/SDK/Language/Ruby.php index 9d13aa6848..84ed7f6bc1 100644 --- a/src/SDK/Language/Ruby.php +++ b/src/SDK/Language/Ruby.php @@ -147,8 +147,8 @@ public function getFiles() ], [ 'scope' => 'default', - 'destination' => 'lib/{{ spec.title | caseDash }}/file.rb', - 'template' => 'ruby/lib/container/file.rb.twig', + 'destination' => 'lib/{{ spec.title | caseDash }}/input_file.rb', + 'template' => 'ruby/lib/container/input_file.rb.twig', 'minify' => false, ], [ @@ -281,7 +281,7 @@ public function getParamExample(array $param) $output .= '{}'; break; case self::TYPE_FILE: - $output .= "'dir/file.png'"; + $output .= "InputFile.fromPath('dir/file.png')"; break; } } @@ -302,7 +302,7 @@ public function getParamExample(array $param) $output .= "'{$example}'"; break; case self::TYPE_FILE: - $output .= "'file.png'"; + $output .= "InputFile.fromPath('dir/file.png')"; break; } } diff --git a/templates/ruby/lib/container/file.rb.twig b/templates/ruby/lib/container/file.rb.twig deleted file mode 100644 index 1ad7d2fa1d..0000000000 --- a/templates/ruby/lib/container/file.rb.twig +++ /dev/null @@ -1,17 +0,0 @@ -require 'mime/types' - -module {{spec.title | caseUcfirst}} - class File - attr_reader :path - attr_reader :name - attr_reader :content - attr_reader :mime_type - - def initialize(path, content) - @path = path - @content = content - @name = ::File.basename(path) - @mime_type = MIME::Types.type_for(path) - end - end -end \ No newline at end of file diff --git a/templates/ruby/lib/container/input_file.rb.twig b/templates/ruby/lib/container/input_file.rb.twig new file mode 100644 index 0000000000..db5ceaa13b --- /dev/null +++ b/templates/ruby/lib/container/input_file.rb.twig @@ -0,0 +1,30 @@ +require 'mime/types' + +module {{spec.title | caseUcfirst}} + class InputFile + attr_accessor :path + attr_accessor :filename + attr_accessor :mime_type + attr_accessor :source_type + + attr_accessor :data + + def self.fromPath(path) + instance = InputFile.new + instance.path = path + instance.filename = ::File.basename(path) + instance.mime_type = MIME::Types.type_for(path) + instance.source_type = 'path' + instance + end + + def self.fromBytes(bytes, filename: nil, mime_type: nil) + instance = InputFile.new + instance.data = bytes + instance.filename = filename + instance.mime_type = mime_type + instance.source_type = 'bytes' + instance + end + end +end \ No newline at end of file From 436655d59e9919f036da308bc64ed8cef6184e64 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 22 Jun 2022 19:28:07 +1200 Subject: [PATCH 070/555] Update ruby input file handling --- templates/ruby/docs/example.md.twig | 2 +- templates/ruby/lib/container/client.rb.twig | 34 +++++++++++++++------ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/templates/ruby/docs/example.md.twig b/templates/ruby/docs/example.md.twig index 3faecfa6f9..c412d7d6aa 100644 --- a/templates/ruby/docs/example.md.twig +++ b/templates/ruby/docs/example.md.twig @@ -12,6 +12,6 @@ client {{ service.name | caseSnake }} = {{spec.title | caseUcfirst}}::{{ service.name | caseUcfirst }}.new(client) -response = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{parameter.name|caseSnake}}: {% if parameter | paramExample == "File.new" %}{{spec.title | caseUcfirst}}::{{ parameter | paramExample }}{% else %}{{ parameter | paramExample }}{% endif %}{% endif %}{% endfor %}) +response = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{parameter.name|caseSnake}}: {% if parameter | paramExample == "InputFile.new" %}{{spec.title | caseUcfirst}}::{{ parameter | paramExample }}{% else %}{{ parameter | paramExample }}{% endif %}{% endif %}{% endfor %}) puts response.inspect \ No newline at end of file diff --git a/templates/ruby/lib/container/client.rb.twig b/templates/ruby/lib/container/client.rb.twig index a2de462b74..e76792df38 100644 --- a/templates/ruby/lib/container/client.rb.twig +++ b/templates/ruby/lib/container/client.rb.twig @@ -104,12 +104,20 @@ module {{ spec.title | caseUcfirst }} on_progress: nil, response_type: nil ) - file_path = params[param_name.to_sym] - size = ::File.size(file_path) + input_file = params[param_name.to_sym] + + case input_file.source_type + when 'path' + size = ::File.size(input_file.path) + when 'bytes' + size = input_file.data.bytesize + end if size < @chunk_size - slice = ::File.read(file_path) - params[param_name] = File.new(file_path, slice) + if input_file.source_type == 'path' + input_file.data = IO.read(input_file.path) + end + params[param_name] = input_file return call( method: 'POST', path: path, @@ -133,10 +141,16 @@ module {{ spec.title | caseUcfirst }} offset = [size, (chunks_uploaded * @chunk_size)].min end - while offset < size - slice = IO.read(file_path, @chunk_size, offset) + cached_input = input_file - params[param_name] = File.new(file_path, slice) + while offset < size + case input_file.source_type + when 'path' + input_file.data = IO.read(input_file.path, @chunk_size, offset) + when 'bytes' + input_file.data = cached_input.data.slice(offset, @chunk_size) + end + params[param_name] = input_file headers['content-range'] = "bytes #{offset}-#{[offset + @chunk_size - 1, size].min}/#{size}" result = call( @@ -250,10 +264,10 @@ module {{ spec.title | caseUcfirst }} '' else post_body = [] - if value.instance_of? File - post_body << "Content-Disposition: form-data; name=\"#{key}\"; filename=\"#{value.name}\"\r\n" + if value.instance_of? InputFile + post_body << "Content-Disposition: form-data; name=\"#{key}\"; filename=\"#{value.filename}\"\r\n" post_body << "Content-Type: #{value.mime_type}\r\n\r\n" - post_body << value.content + post_body << value.data post_body << "\r\n--#{@boundary}--\r\n" else post_body << "Content-Disposition: form-data; name=\"#{key}\"\r\n\r\n" From 03ba1ed73fd0eb395a6c7a1b0cd3f88dff15bf28 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 22 Jun 2022 19:28:21 +1200 Subject: [PATCH 071/555] Fix ruby relative reference --- templates/ruby/lib/container.rb.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/ruby/lib/container.rb.twig b/templates/ruby/lib/container.rb.twig index 34433f3024..cbdef7b1ca 100644 --- a/templates/ruby/lib/container.rb.twig +++ b/templates/ruby/lib/container.rb.twig @@ -6,7 +6,7 @@ require 'mime/types' require_relative '{{ spec.title | caseSnake }}/client' require_relative '{{ spec.title | caseSnake }}/service' require_relative '{{ spec.title | caseSnake }}/exception' -require_relative '{{ spec.title | caseSnake }}/file' +require_relative '{{ spec.title | caseSnake }}/input_file' {% for defintion in spec.definitions %} require_relative '{{ spec.title | caseSnake }}/models/{{ defintion.name | caseSnake }}' From f92f712b018bf2e22d3b83d3da76adc3b03e6375 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 22 Jun 2022 19:29:32 +1200 Subject: [PATCH 072/555] Update ruby upload tests for input file --- composer.lock | 15 +++++++-------- tests/Ruby30Test.php | 3 +++ tests/languages/ruby/tests.rb | 12 ++++++++++-- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/composer.lock b/composer.lock index 4e905a1387..63f45efc6f 100644 --- a/composer.lock +++ b/composer.lock @@ -1303,16 +1303,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.20", + "version": "9.5.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba" + "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/12bc8879fb65aef2138b26fc633cb1e3620cffba", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1", + "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1", "shasum": "" }, "require": { @@ -1346,7 +1346,6 @@ "sebastian/version": "^3.0.2" }, "require-dev": { - "ext-pdo": "*", "phpspec/prophecy-phpunit": "^2.0.1" }, "suggest": { @@ -1390,7 +1389,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.20" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21" }, "funding": [ { @@ -1402,7 +1401,7 @@ "type": "github" } ], - "time": "2022-04-01T12:37:26+00:00" + "time": "2022-06-19T12:14:25+00:00" }, { "name": "psr/container", @@ -3101,5 +3100,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/tests/Ruby30Test.php b/tests/Ruby30Test.php index bb0c6eb8f7..c589d1d012 100644 --- a/tests/Ruby30Test.php +++ b/tests/Ruby30Test.php @@ -17,6 +17,9 @@ class Ruby30Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES ]; } diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index 4ce61537c7..003c1bd281 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -49,10 +49,18 @@ response = general.redirect() puts response["result"] -response = general.upload(x: 'string', y: 123, z:['string in array'], file: './tests/resources/file.png') +response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.fromPath('./tests/resources/file.png')) puts response.result -response = general.upload(x: 'string', y: 123, z:['string in array'], file: './tests/resources/large_file.mp4') +response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.fromPath('./tests/resources/large_file.mp4')) +puts response.result + +data = IO.read('./tests/resources/file.png') +response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.fromBytes(data, filename:'file.png', mime_type: 'image/png')) +puts response.result + +data = IO.read('./tests/resources/large_file.mp4') +response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.fromBytes(data, filename:'large_file.mp4', mime_type: 'video/mp4')) puts response.result begin From bea3ff6dd37ce9900bb27f95851c4435efee418a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 22 Jun 2022 08:02:24 +0000 Subject: [PATCH 073/555] Update lockfile after merge --- composer.lock | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/composer.lock b/composer.lock index 4e905a1387..63f45efc6f 100644 --- a/composer.lock +++ b/composer.lock @@ -1303,16 +1303,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.20", + "version": "9.5.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba" + "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/12bc8879fb65aef2138b26fc633cb1e3620cffba", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1", + "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1", "shasum": "" }, "require": { @@ -1346,7 +1346,6 @@ "sebastian/version": "^3.0.2" }, "require-dev": { - "ext-pdo": "*", "phpspec/prophecy-phpunit": "^2.0.1" }, "suggest": { @@ -1390,7 +1389,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.20" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21" }, "funding": [ { @@ -1402,7 +1401,7 @@ "type": "github" } ], - "time": "2022-04-01T12:37:26+00:00" + "time": "2022-06-19T12:14:25+00:00" }, { "name": "psr/container", @@ -3101,5 +3100,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } From f3de22254548a2939c58c7da656d6cd4441060d2 Mon Sep 17 00:00:00 2001 From: Matej Baco Date: Wed, 22 Jun 2022 10:29:42 +0200 Subject: [PATCH 074/555] PR review changes --- templates/node/docs/example.md.twig | 6 +++--- templates/web/docs/example.md.twig | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/templates/node/docs/example.md.twig b/templates/node/docs/example.md.twig index 495517ac2f..e2604d6b7b 100644 --- a/templates/node/docs/example.md.twig +++ b/templates/node/docs/example.md.twig @@ -4,9 +4,9 @@ const fs = require('fs'); {% endif %} // Init SDK -let client = new sdk.Client(); +const client = new sdk.Client(); -let {{ service.name | caseCamel }} = new sdk.{{service.name | caseUcfirst}}(client); +const {{ service.name | caseCamel }} = new sdk.{{service.name | caseUcfirst}}(client); {% if method.security|length > 0 %} client @@ -18,7 +18,7 @@ client {% endfor %}; {% endif %} -let promise = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); +const promise = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); promise.then(function (response) { console.log(response); diff --git a/templates/web/docs/example.md.twig b/templates/web/docs/example.md.twig index 89be198c1b..4ab63302d3 100644 --- a/templates/web/docs/example.md.twig +++ b/templates/web/docs/example.md.twig @@ -1,7 +1,11 @@ -const sdk = new {{ spec.title | caseUcfirst }}(); +import {{ '{' }} Client, {{service.name | caseUcfirst}} {{ '}' }} from "{{ language.params.npmPackage }}"; + +let client = new Client(); + +const {{ service.name | caseCamel }} = new {{service.name | caseUcfirst}}(client); {% if method.security|length > 0 %} -sdk +client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint {% for node in method.security %} {% for key,header in node|keys %} @@ -12,7 +16,7 @@ sdk {% endif %} {% if method.type == 'webAuth' %}// Go to OAuth provider login page {% endif %} -{% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}let result = {% else %}let promise = {% endif %}sdk.{{ service.name | caseLower }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); +{% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}let result = {% else %}let promise = {% endif %}{{ service.name | caseCamel }}.{{ service.name | caseLower }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); {% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}console.log(result); // Resource URL{% else %}promise.then(function (response) { console.log(response); // Success From bdd94da6292d94336fb03735675d34c3b429ceb7 Mon Sep 17 00:00:00 2001 From: Matej Baco Date: Wed, 22 Jun 2022 10:38:11 +0200 Subject: [PATCH 075/555] Fix after QA --- templates/web/docs/example.md.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/web/docs/example.md.twig b/templates/web/docs/example.md.twig index 4ab63302d3..215e9d4c74 100644 --- a/templates/web/docs/example.md.twig +++ b/templates/web/docs/example.md.twig @@ -1,6 +1,6 @@ import {{ '{' }} Client, {{service.name | caseUcfirst}} {{ '}' }} from "{{ language.params.npmPackage }}"; -let client = new Client(); +const client = new Client(); const {{ service.name | caseCamel }} = new {{service.name | caseUcfirst}}(client); @@ -16,7 +16,7 @@ client {% endif %} {% if method.type == 'webAuth' %}// Go to OAuth provider login page {% endif %} -{% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}let result = {% else %}let promise = {% endif %}{{ service.name | caseCamel }}.{{ service.name | caseLower }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); +{% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}const result = {% else %}const promise = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); {% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}console.log(result); // Resource URL{% else %}promise.then(function (response) { console.log(response); // Success From e5f46cb218584a8edb0fab29210b307c9227b849 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 13:02:00 +1200 Subject: [PATCH 076/555] Update python input file --- src/SDK/Language/Python.php | 4 ++-- templates/python/package/input_file.py.twig | 24 +++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/SDK/Language/Python.php b/src/SDK/Language/Python.php index a49940fb2f..969aaed88d 100644 --- a/src/SDK/Language/Python.php +++ b/src/SDK/Language/Python.php @@ -302,7 +302,7 @@ public function getParamExample(array $param) $output .= '{}'; break; case self::TYPE_FILE: - $output .= "'file.png'"; + $output .= "InputFile.from_path('file.png')"; break; } } @@ -321,7 +321,7 @@ public function getParamExample(array $param) $output .= "'{$example}'"; break; case self::TYPE_FILE: - $output .= "'file.png'"; + $output .= "InputFile.from_path('file.png')"; break; } } diff --git a/templates/python/package/input_file.py.twig b/templates/python/package/input_file.py.twig index 4351d071a6..9f11b0c2a8 100644 --- a/templates/python/package/input_file.py.twig +++ b/templates/python/package/input_file.py.twig @@ -1,5 +1,21 @@ +import os +import mimetypes + class InputFile: - def __init__(self, path, name, file): - self.path = path - self.name = name - self.file = file \ No newline at end of file + @classmethod + def from_path(cls, path): + instance = cls() + instance.path = path + instance.filename = os.path.basename(path) + instance.mime_type = mimetypes.guess_type(path) + instance.source_type = 'path' + return instance + + @classmethod + def from_bytes(cls, bytes, filename = None, mime_type = None): + instance = cls() + instance.data = bytes + instance.filename = filename + instance.mime_type = mime_type + instance.source_type = 'bytes' + return instance \ No newline at end of file From ce1e2c833e3785113c2d1d6cb15701eac38ff73b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 13:02:13 +1200 Subject: [PATCH 077/555] Update python input file handling --- templates/python/package/client.py.twig | 31 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/templates/python/package/client.py.twig b/templates/python/package/client.py.twig index 181f3dca22..5590b9a95c 100644 --- a/templates/python/package/client.py.twig +++ b/templates/python/package/client.py.twig @@ -66,7 +66,7 @@ class Client: stringify = True for key in data.copy(): if isinstance(data[key], InputFile): - files[key] = (data[key].name, data[key].file) + files[key] = (data[key].filename, data[key].data) del data[key] response = None try: @@ -108,13 +108,20 @@ class Client: on_progress = None, upload_id = '' ): - file_path = str(params[param_name]) - file_name = os.path.basename(file_path) - size = os.stat(file_path).st_size + input_file = params[param_name] + + if input_file.source_type == 'path': + size = os.stat(input_file.path).st_size + input = open(input_file.path, 'rb') + elif input_file.source_type == 'bytes': + size = len(input_file.data) + input = input_file.data if size < self._chunk_size: - slice = open(file_path, 'rb').read() - params[param_name] = InputFile(file_path, file_name, slice) + if input_file.source_type == 'path': + input_file.data = input.read() + + params[param_name] = input_file return self.call( 'post', path, @@ -122,7 +129,6 @@ class Client: params ) - input = open(file_path, 'rb') offset = 0 counter = 0 @@ -138,9 +144,16 @@ class Client: input.seek(offset) while offset < size: - slice = input.read(self._chunk_size) or input.read(size - offset) + if input_file.source_type == 'path': + input_file.data = input.read(self._chunk_size) or input.read(size - offset) + elif input_file.source_type == 'bytes': + if offset + self._chunk_size < size: + end = offset + self._chunk_size + else: + end = size - offset + input_file.data = input[offset:end] - params[param_name] = InputFile(file_path, file_name, slice) + params[param_name] = input_file headers["content-range"] = f'bytes {offset}-{min((offset + self._chunk_size) - 1, size)}/{size}' result = self.call( From a7ddcc826e7879cff5b1cc0ed7175dcc045ede44 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 13:02:49 +1200 Subject: [PATCH 078/555] Upload python upload tests for input files --- tests/Python310Test.php | 2 ++ tests/Python38Test.php | 2 ++ tests/Python39Test.php | 2 ++ tests/languages/python/tests.py | 13 +++++++++++-- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/Python310Test.php b/tests/Python310Test.php index e0dd6f4388..7f8b587b62 100644 --- a/tests/Python310Test.php +++ b/tests/Python310Test.php @@ -19,6 +19,8 @@ class Python310Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ]; } diff --git a/tests/Python38Test.php b/tests/Python38Test.php index 65a1ba1260..4ea1004c7d 100644 --- a/tests/Python38Test.php +++ b/tests/Python38Test.php @@ -19,6 +19,8 @@ class Python38Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ]; } diff --git a/tests/Python39Test.php b/tests/Python39Test.php index 7cf520b05d..5011dfdb4f 100644 --- a/tests/Python39Test.php +++ b/tests/Python39Test.php @@ -19,6 +19,8 @@ class Python39Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ]; } diff --git a/tests/languages/python/tests.py b/tests/languages/python/tests.py index d42a9f2f61..8d4e16bd2d 100644 --- a/tests/languages/python/tests.py +++ b/tests/languages/python/tests.py @@ -3,6 +3,7 @@ from appwrite.services.bar import Bar from appwrite.services.general import General from appwrite.exception import AppwriteException +from appwrite.input_file import InputFile import os.path @@ -55,10 +56,18 @@ response = general.redirect() print(response['result']) -response = general.upload('string', 123, ['string in array'], './tests/resources/file.png') +response = general.upload('string', 123, ['string in array'], InputFile.from_path('./tests/resources/file.png')) print(response['result']) -response = general.upload('string', 123, ['string in array'], './tests/resources/large_file.mp4') +response = general.upload('string', 123, ['string in array'], InputFile.from_path('./tests/resources/large_file.mp4')) +print(response['result']) + +data = open('./tests/resources/file.png', 'rb').read() +response = general.upload('string', 123, ['string in array'], InputFile.from_bytes(data, 'file.png', 'image/png')) +print(response['result']) + +data = open('./tests/resources/large_file.mp4', 'rb').read() +response = general.upload('string', 123, ['string in array'], InputFile.from_bytes(data, 'large_file.mp4','video/mp4')) print(response['result']) try: From 8bb0e25ee601a44a30a6fa194f27535e564db770 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 16:22:22 +1200 Subject: [PATCH 079/555] Add android input file --- src/SDK/Language/Android.php | 5 +++ .../java/io/appwrite/models/InputFile.kt.twig | 38 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 templates/android/library/src/main/java/io/appwrite/models/InputFile.kt.twig diff --git a/src/SDK/Language/Android.php b/src/SDK/Language/Android.php index 06b67681a0..7c289c1e44 100644 --- a/src/SDK/Language/Android.php +++ b/src/SDK/Language/Android.php @@ -131,6 +131,11 @@ public function getFiles() 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/json/PreciseNumberAdapter.kt', 'template' => '/android/library/src/main/java/io/appwrite/json/PreciseNumberAdapter.kt.twig', ], + [ + 'scope' => 'default', + 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/models/InputFile.kt', + 'template' => '/android/library/src/main/java/io/appwrite/models/InputFile.kt.twig', + ], [ 'scope' => 'default', 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/models/RealtimeModels.kt', diff --git a/templates/android/library/src/main/java/io/appwrite/models/InputFile.kt.twig b/templates/android/library/src/main/java/io/appwrite/models/InputFile.kt.twig new file mode 100644 index 0000000000..3af5bbd305 --- /dev/null +++ b/templates/android/library/src/main/java/io/appwrite/models/InputFile.kt.twig @@ -0,0 +1,38 @@ +package {{ sdk.namespace | caseDot }}.models + +import java.io.File +import java.net.URLConnection +import java.nio.file.Files +import java.nio.file.Paths +import javax.activation.MimetypesFileTypeMap + +class InputFile private constructor() { + + lateinit var path: String + lateinit var filename: String + lateinit var mimeType: String + lateinit var sourceType: String + lateinit var data: Any + + companion object { + fun fromFile(file: File) = InputFile().apply { + path = file.canonicalPath + filename = file.name + mimeType = Files.probeContentType(Paths.get(file.canonicalPath)) + ?: URLConnection.guessContentTypeFromName(filename) + ?: MimetypesFileTypeMap.getDefaultFileTypeMap().getContentType(file) + sourceType = "file" + } + + fun fromPath(path: String): InputFile = fromFile(File(path)).apply { + sourceType = "path" + } + + fun fromBytes(bytes: ByteArray, filename: String = "", mimeType: String = "") = InputFile().apply { + this.filename = filename + this.mimeType = mimeType + data = bytes + sourceType = "bytes" + } + } +} \ No newline at end of file From ec238b044458fc5f7bcdfa427d32248545d7a052 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 16:22:43 +1200 Subject: [PATCH 080/555] Add kotlin input file --- src/SDK/Language/Kotlin.php | 10 ++++- .../io/appwrite/models/InputFile.kt.twig | 38 +++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 templates/kotlin/src/main/kotlin/io/appwrite/models/InputFile.kt.twig diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index c5d75be898..d00cc30184 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -111,7 +111,7 @@ public function getTypeName($type) case self::TYPE_STRING: return 'String'; case self::TYPE_FILE: - return 'File'; + return 'InputFile'; case self::TYPE_BOOLEAN: return 'Boolean'; case self::TYPE_ARRAY: @@ -197,7 +197,7 @@ public function getParamExample(array $param) if(empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_FILE: - $output .= 'File("file.png")'; + $output .= 'InputFile.fromPath("file.png")'; break; case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -390,6 +390,12 @@ public function getFiles() 'template' => '/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/models/InputFile.kt', + 'template' => '/kotlin/src/main/kotlin/io/appwrite/models/InputFile.kt.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/models/UploadProgress.kt', diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/models/InputFile.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/models/InputFile.kt.twig new file mode 100644 index 0000000000..3af5bbd305 --- /dev/null +++ b/templates/kotlin/src/main/kotlin/io/appwrite/models/InputFile.kt.twig @@ -0,0 +1,38 @@ +package {{ sdk.namespace | caseDot }}.models + +import java.io.File +import java.net.URLConnection +import java.nio.file.Files +import java.nio.file.Paths +import javax.activation.MimetypesFileTypeMap + +class InputFile private constructor() { + + lateinit var path: String + lateinit var filename: String + lateinit var mimeType: String + lateinit var sourceType: String + lateinit var data: Any + + companion object { + fun fromFile(file: File) = InputFile().apply { + path = file.canonicalPath + filename = file.name + mimeType = Files.probeContentType(Paths.get(file.canonicalPath)) + ?: URLConnection.guessContentTypeFromName(filename) + ?: MimetypesFileTypeMap.getDefaultFileTypeMap().getContentType(file) + sourceType = "file" + } + + fun fromPath(path: String): InputFile = fromFile(File(path)).apply { + sourceType = "path" + } + + fun fromBytes(bytes: ByteArray, filename: String = "", mimeType: String = "") = InputFile().apply { + this.filename = filename + this.mimeType = mimeType + data = bytes + sourceType = "bytes" + } + } +} \ No newline at end of file From f24a7e22b6fe5693e70d7acd4cfa4f1f2eb75ed6 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 16:23:18 +1200 Subject: [PATCH 081/555] Update android input file handling --- .../src/main/java/io/appwrite/Client.kt.twig | 48 +++++++++++++++---- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig index d681e0653e..5c7ecaef5d 100644 --- a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig @@ -9,6 +9,7 @@ import {{ sdk.namespace | caseDot }}.cookies.stores.SharedPreferencesCookieStore import {{ sdk.namespace | caseDot }}.exceptions.{{ spec.title | caseUcfirst }}Exception import {{ sdk.namespace | caseDot }}.extensions.fromJson import {{ sdk.namespace | caseDot }}.json.PreciseNumberAdapter +import {{ sdk.namespace | caseDot }}.models.InputFile import {{ sdk.namespace | caseDot }}.models.UploadProgress import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -322,14 +323,29 @@ class Client @JvmOverloads constructor( idParamName: String? = null, onProgress: ((UploadProgress) -> Unit)? = null, ): T { - val file = params[paramName] as File - val size = file.length() + var file: RandomAccessFile? = null + val input = params[paramName] as InputFile + val size: Long = when(input.sourceType) { + "path", "file" -> { + file = RandomAccessFile(input.path, "r") + file.length() + } + "bytes" -> { + (input.data as ByteArray).size.toLong() + } + else -> throw UnsupportedOperationException() + } if (size < CHUNK_SIZE) { + val data = when(input.sourceType) { + "file", "path" -> File(input.path).asRequestBody() + "bytes" -> (input.data as ByteArray).toRequestBody(input.mimeType.toMediaType()) + else -> throw UnsupportedOperationException() + } params[paramName] = MultipartBody.Part.createFormData( paramName, - file.name, - file.asRequestBody() + input.filename, + data ) return call( method = "POST", @@ -341,7 +357,6 @@ class Client @JvmOverloads constructor( ) } - val input = RandomAccessFile(file, "r") val buffer = ByteArray(CHUNK_SIZE) var offset = 0L var result: Map<*, *>? = null @@ -360,12 +375,29 @@ class Client @JvmOverloads constructor( } while (offset < size) { - input.seek(offset) - input.read(buffer) + when(input.sourceType) { + "file", "path" -> { + file!!.seek(offset) + file!!.read(buffer) + } + "bytes" -> { + val end = if (offset + CHUNK_SIZE < size) { + offset + CHUNK_SIZE + } else { + size - 1 + } + (input.data as ByteArray).copyInto( + buffer, + startIndex = offset.toInt(), + endIndex = end.toInt() + ) + } + else -> throw UnsupportedOperationException() + } params[paramName] = MultipartBody.Part.createFormData( paramName, - file.name, + input.filename, buffer.toRequestBody() ) From d894ee7228dd9232220270e3877cc5cd0dcb3633 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 16:23:27 +1200 Subject: [PATCH 082/555] Update kotlin input file handling --- .../main/kotlin/io/appwrite/Client.kt.twig | 48 +++++++++++++++---- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index 672ac26d01..de3a8bff99 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -5,6 +5,7 @@ import com.google.gson.reflect.TypeToken import {{ sdk.namespace | caseDot }}.exceptions.{{ spec.title | caseUcfirst }}Exception import {{ sdk.namespace | caseDot }}.extensions.fromJson import {{ sdk.namespace | caseDot }}.json.PreciseNumberAdapter +import {{ sdk.namespace | caseDot }}.models.InputFile import {{ sdk.namespace | caseDot }}.models.UploadProgress import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -281,14 +282,29 @@ class Client @JvmOverloads constructor( idParamName: String? = null, onProgress: ((UploadProgress) -> Unit)? = null, ): T { - val file = params[paramName] as File - val size = file.length() + var file: RandomAccessFile? = null + val input = params[paramName] as InputFile + val size: Long = when(input.sourceType) { + "path", "file" -> { + file = RandomAccessFile(input.path, "r") + file.length() + } + "bytes" -> { + (input.data as ByteArray).size.toLong() + } + else -> throw UnsupportedOperationException() + } if (size < CHUNK_SIZE) { + val data = when(input.sourceType) { + "file", "path" -> File(input.path).asRequestBody() + "bytes" -> (input.data as ByteArray).toRequestBody(input.mimeType.toMediaType()) + else -> throw UnsupportedOperationException() + } params[paramName] = MultipartBody.Part.createFormData( paramName, - file.name, - file.asRequestBody() + input.filename, + data ) return call( method = "POST", @@ -300,7 +316,6 @@ class Client @JvmOverloads constructor( ) } - val input = RandomAccessFile(file, "r") val buffer = ByteArray(CHUNK_SIZE) var offset = 0L var result: Map<*, *>? = null @@ -319,12 +334,29 @@ class Client @JvmOverloads constructor( } while (offset < size) { - input.seek(offset) - input.read(buffer) + when(input.sourceType) { + "file", "path" -> { + file!!.seek(offset) + file!!.read(buffer) + } + "bytes" -> { + val end = if (offset + CHUNK_SIZE < size) { + offset + CHUNK_SIZE + } else { + size - 1 + } + (input.data as ByteArray).copyInto( + buffer, + startIndex = offset.toInt(), + endIndex = end.toInt() + ) + } + else -> throw UnsupportedOperationException() + } params[paramName] = MultipartBody.Part.createFormData( paramName, - file.name, + input.filename, buffer.toRequestBody() ) From 8346c7e5f55d9dcee2b3216d74ac34de2486d2d1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 16:26:55 +1200 Subject: [PATCH 083/555] Update android upload tests for input files --- tests/Android11Java11Test.php | 2 ++ tests/Android11Java8Test.php | 2 ++ tests/Android12Java11Test.php | 2 ++ tests/Android12Java8Test.php | 2 ++ tests/Android5Java11Test.php | 2 ++ tests/Android5Java8Test.php | 2 ++ tests/languages/android/ServiceTest.kt | 34 +++++++++++++++++++++----- 7 files changed, 40 insertions(+), 6 deletions(-) diff --git a/tests/Android11Java11Test.php b/tests/Android11Java11Test.php index 467bea95f5..73aa5b13bb 100644 --- a/tests/Android11Java11Test.php +++ b/tests/Android11Java11Test.php @@ -19,6 +19,8 @@ class Android11Java11Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, diff --git a/tests/Android11Java8Test.php b/tests/Android11Java8Test.php index f11a605d83..f20f51ff39 100644 --- a/tests/Android11Java8Test.php +++ b/tests/Android11Java8Test.php @@ -19,6 +19,8 @@ class Android11Java8Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, diff --git a/tests/Android12Java11Test.php b/tests/Android12Java11Test.php index 6a98a1ba9d..b8899cb975 100644 --- a/tests/Android12Java11Test.php +++ b/tests/Android12Java11Test.php @@ -19,6 +19,8 @@ class Android12Java11Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, diff --git a/tests/Android12Java8Test.php b/tests/Android12Java8Test.php index c701349e7a..afb2bfd88f 100644 --- a/tests/Android12Java8Test.php +++ b/tests/Android12Java8Test.php @@ -19,6 +19,8 @@ class Android12Java8Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, diff --git a/tests/Android5Java11Test.php b/tests/Android5Java11Test.php index e717558e00..8f7fb68698 100644 --- a/tests/Android5Java11Test.php +++ b/tests/Android5Java11Test.php @@ -19,6 +19,8 @@ class Android5Java11Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, diff --git a/tests/Android5Java8Test.php b/tests/Android5Java8Test.php index beda628792..48a1736971 100644 --- a/tests/Android5Java8Test.php +++ b/tests/Android5Java8Test.php @@ -19,6 +19,8 @@ class Android5Java8Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, diff --git a/tests/languages/android/ServiceTest.kt b/tests/languages/android/ServiceTest.kt index 505f9fe3d2..3993e5eda7 100644 --- a/tests/languages/android/ServiceTest.kt +++ b/tests/languages/android/ServiceTest.kt @@ -6,8 +6,9 @@ import com.google.gson.Gson import io.appwrite.exceptions.AppwriteException import io.appwrite.extensions.fromJson import io.appwrite.extensions.toJson -import io.appwrite.models.Mock import io.appwrite.models.Error +import io.appwrite.models.InputFile +import io.appwrite.models.Mock import io.appwrite.services.Bar import io.appwrite.services.Foo import io.appwrite.services.General @@ -99,11 +100,32 @@ class ServiceTest { val result = general.redirect() writeToFile((result as Map)["result"] as String) - mock = general.upload("string", 123, listOf("string in array"), File("../../../resources/file.png")) - writeToFile(mock.result) - - mock = general.upload("string", 123, listOf("string in array"), File("../../../resources/large_file.mp4")) - writeToFile(mock.result) + try { + mock = general.upload("string", 123, listOf("string in array"), InputFile.fromPath("../../../resources/file.png")) + writeToFile(mock.result) + } catch (ex: Exception) { + writeToFile(ex.toString()) + } + try { + mock = general.upload("string", 123, listOf("string in array"), InputFile.fromPath("../../../resources/large_file.mp4")) + writeToFile(mock.result) + } catch (ex: Exception) { + writeToFile(ex.toString()) + } + try { + var bytes = File("../../../resources/file.png").readBytes() + mock = general.upload("string", 123, listOf("string in array"), InputFile.fromBytes(bytes, "file.png", "image/png")) + writeToFile(mock.result) + } catch (ex: Exception) { + writeToFile(ex.toString()) + } + try { + var bytes = File("../../../resources/large_file.mp4").readBytes() + mock = general.upload("string", 123, listOf("string in array"), InputFile.fromBytes(bytes, "large_file.mp4", "video/mp4")) + writeToFile(mock.result) + } catch (ex: Exception) { + writeToFile(ex.toString()) + } try { general.error400() From a3bdf4be9074da0ef2265b822d79750d43b43472 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 16:27:02 +1200 Subject: [PATCH 084/555] Update kotlin upload tests for input files --- tests/KotlinJava11Test.php | 2 ++ tests/KotlinJava17Test.php | 2 ++ tests/KotlinJava8Test.php | 2 ++ tests/languages/kotlin/ServiceTest.kt | 34 ++++++++++++++++++++++----- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/tests/KotlinJava11Test.php b/tests/KotlinJava11Test.php index 04e9347b6a..f49a72acfc 100644 --- a/tests/KotlinJava11Test.php +++ b/tests/KotlinJava11Test.php @@ -19,6 +19,8 @@ class KotlinJava11Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES ]; } diff --git a/tests/KotlinJava17Test.php b/tests/KotlinJava17Test.php index 332d6068b9..fd3efffd8d 100644 --- a/tests/KotlinJava17Test.php +++ b/tests/KotlinJava17Test.php @@ -19,6 +19,8 @@ class KotlinJava17Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES ]; } diff --git a/tests/KotlinJava8Test.php b/tests/KotlinJava8Test.php index 7379fd01cc..acf898b7af 100644 --- a/tests/KotlinJava8Test.php +++ b/tests/KotlinJava8Test.php @@ -19,6 +19,8 @@ class KotlinJava8Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES ]; } diff --git a/tests/languages/kotlin/ServiceTest.kt b/tests/languages/kotlin/ServiceTest.kt index dd39b397fa..38e55996f2 100644 --- a/tests/languages/kotlin/ServiceTest.kt +++ b/tests/languages/kotlin/ServiceTest.kt @@ -4,8 +4,9 @@ import com.google.gson.Gson import io.appwrite.exceptions.AppwriteException import io.appwrite.extensions.fromJson import io.appwrite.extensions.toJson -import io.appwrite.models.Mock import io.appwrite.models.Error +import io.appwrite.models.InputFile +import io.appwrite.models.Mock import io.appwrite.services.Bar import io.appwrite.services.Foo import io.appwrite.services.General @@ -68,11 +69,32 @@ class ServiceTest { val result = general.redirect() writeToFile((result as Map)["result"] as String) - mock = general.upload("string", 123, listOf("string in array"), File("../../resources/file.png")) - writeToFile(mock.result) - - mock = general.upload("string", 123, listOf("string in array"), File("../../resources/large_file.mp4")) - writeToFile(mock.result) + try { + mock = general.upload("string", 123, listOf("string in array"), InputFile.fromPath("../../resources/file.png")) + writeToFile(mock.result) + } catch (ex: Exception) { + writeToFile(ex.toString()) + } + try { + mock = general.upload("string", 123, listOf("string in array"), InputFile.fromPath("../../resources/large_file.mp4")) + writeToFile(mock.result) + } catch (ex: Exception) { + writeToFile(ex.toString()) + } + try { + var bytes = File("../../resources/file.png").readBytes() + mock = general.upload("string", 123, listOf("string in array"), InputFile.fromBytes(bytes, "file.png", "image/png")) + writeToFile(mock.result) + } catch (ex: Exception) { + writeToFile(ex.toString()) + } + try { + var bytes = File("../../resources/large_file.mp4").readBytes() + mock = general.upload("string", 123, listOf("string in array"), InputFile.fromBytes(bytes, "large_file.mp4", "video/mp4")) + writeToFile(mock.result) + } catch (ex: Exception) { + writeToFile(ex.toString()) + } try { general.error400() From aebc2dbe8b73a892040965fd859c02f47c555033 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 17:17:34 +1200 Subject: [PATCH 085/555] Fix removed package use for Java 8+ --- .../library/src/main/java/io/appwrite/models/InputFile.kt.twig | 3 +-- .../src/main/kotlin/io/appwrite/models/InputFile.kt.twig | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/models/InputFile.kt.twig b/templates/android/library/src/main/java/io/appwrite/models/InputFile.kt.twig index 3af5bbd305..382267a0d0 100644 --- a/templates/android/library/src/main/java/io/appwrite/models/InputFile.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/models/InputFile.kt.twig @@ -4,7 +4,6 @@ import java.io.File import java.net.URLConnection import java.nio.file.Files import java.nio.file.Paths -import javax.activation.MimetypesFileTypeMap class InputFile private constructor() { @@ -20,7 +19,7 @@ class InputFile private constructor() { filename = file.name mimeType = Files.probeContentType(Paths.get(file.canonicalPath)) ?: URLConnection.guessContentTypeFromName(filename) - ?: MimetypesFileTypeMap.getDefaultFileTypeMap().getContentType(file) + ?: "" sourceType = "file" } diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/models/InputFile.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/models/InputFile.kt.twig index 3af5bbd305..382267a0d0 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/models/InputFile.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/models/InputFile.kt.twig @@ -4,7 +4,6 @@ import java.io.File import java.net.URLConnection import java.nio.file.Files import java.nio.file.Paths -import javax.activation.MimetypesFileTypeMap class InputFile private constructor() { @@ -20,7 +19,7 @@ class InputFile private constructor() { filename = file.name mimeType = Files.probeContentType(Paths.get(file.canonicalPath)) ?: URLConnection.guessContentTypeFromName(filename) - ?: MimetypesFileTypeMap.getDefaultFileTypeMap().getContentType(file) + ?: "" sourceType = "file" } From 0c5d08098a6df2ce7c10a5bf6cc1190b94fa8508 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 20:33:47 +1200 Subject: [PATCH 086/555] Update swift input file --- src/SDK/Language/Swift.php | 12 ++++-- .../swift/Sources/Models/File.swift.twig | 13 ------ .../swift/Sources/Models/InputFile.swift.twig | 41 +++++++++++++++++++ 3 files changed, 50 insertions(+), 16 deletions(-) delete mode 100644 templates/swift/Sources/Models/File.swift.twig create mode 100644 templates/swift/Sources/Models/InputFile.swift.twig diff --git a/src/SDK/Language/Swift.php b/src/SDK/Language/Swift.php index cc2b0aa31a..398adc62ff 100644 --- a/src/SDK/Language/Swift.php +++ b/src/SDK/Language/Swift.php @@ -155,7 +155,7 @@ public function getFiles() [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Models/File.swift', - 'template' => 'swift/Sources/Models/File.swift.twig', + 'template' => 'swift/Sources/Models/InputFile.swift.twig', 'minify' => false, ], [ @@ -188,6 +188,12 @@ public function getFiles() 'template' => 'swift/Sources/Extensions/HTTPClientRequest+Cookies.swift.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Extensions/String+MimeTypes.swift', + 'template' => 'swift/Sources/Extensions/String+MimeTypes.swift.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/StreamingDelegate.swift', @@ -301,7 +307,7 @@ public function getTypeName($type) case self::TYPE_STRING: return 'String'; case self::TYPE_FILE: - return 'File'; + return 'InputFile'; case self::TYPE_BOOLEAN: return 'Bool'; case self::TYPE_ARRAY: @@ -390,7 +396,7 @@ public function getParamExample(array $param) if(empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_FILE: - $output .= 'File(name: "image.jpg", buffer: yourByteBuffer)'; + $output .= 'InputFile.fromPath("file.png")'; break; case self::TYPE_NUMBER: case self::TYPE_INTEGER: diff --git a/templates/swift/Sources/Models/File.swift.twig b/templates/swift/Sources/Models/File.swift.twig deleted file mode 100644 index 46c355d1d0..0000000000 --- a/templates/swift/Sources/Models/File.swift.twig +++ /dev/null @@ -1,13 +0,0 @@ -import Foundation -import NIO - -open class File { - - public let name: String - public var buffer: ByteBuffer - - public init(name: String, buffer: ByteBuffer) { - self.name = name - self.buffer = buffer - } -} diff --git a/templates/swift/Sources/Models/InputFile.swift.twig b/templates/swift/Sources/Models/InputFile.swift.twig new file mode 100644 index 0000000000..cb9a491c9c --- /dev/null +++ b/templates/swift/Sources/Models/InputFile.swift.twig @@ -0,0 +1,41 @@ +import Foundation +import NIO + +open class InputFile { + + public var path: String = "" + public var filename: String = "" + public var mimeType: String = "" + public var sourceType: String = "" + public var data: Any? = nil + + internal init() { + } + + public static func fromPath(_ path: String) -> InputFile { + let instance = InputFile() + instance.path = path + instance.filename = URL(fileURLWithPath: path, isDirectory: false).lastPathComponent + instance.mimeType = path.mimeType() + instance.sourceType = "path" + return instance + } + + public static func fromData(_ data: Data, filename: String, mimeType: String) -> InputFile { + let instance = InputFile() + instance.filename = filename + instance.mimeType = mimeType + instance.sourceType = "data" + instance.data = data + return instance + } + + public static func fromBuffer(_ buffer: ByteBuffer, filename: String, mimeType: String) -> InputFile { + let instance = InputFile() + instance.filename = filename + instance.mimeType = mimeType + instance.sourceType = "buffer" + instance.data = buffer + return instance + } +} From 115f500e848a103c84b4042070ecd55fdba6c993 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 20:34:00 +1200 Subject: [PATCH 087/555] Add swift mimetype extensions --- .../Extensions/String+MimeTypes.swift.twig | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 templates/swift/Sources/Extensions/String+MimeTypes.swift.twig diff --git a/templates/swift/Sources/Extensions/String+MimeTypes.swift.twig b/templates/swift/Sources/Extensions/String+MimeTypes.swift.twig new file mode 100644 index 0000000000..4cd2811d9b --- /dev/null +++ b/templates/swift/Sources/Extensions/String+MimeTypes.swift.twig @@ -0,0 +1,130 @@ +import Foundation + +fileprivate let DEFAULT_MIME_TYPE = "application/octet-stream" + +fileprivate let mimeTypes = [ + "md": "text/markdown", + "html": "text/html", + "htm": "text/html", + "shtml": "text/html", + "css": "text/css", + "xml": "text/xml", + "gif": "image/gif", + "jpeg": "image/jpeg", + "jpg": "image/jpeg", + "js": "application/javascript", + "atom": "application/atom+xml", + "rss": "application/rss+xml", + "mml": "text/mathml", + "txt": "text/plain", + "jad": "text/vnd.sun.j2me.app-descriptor", + "wml": "text/vnd.wap.wml", + "htc": "text/x-component", + "png": "image/png", + "tif": "image/tiff", + "tiff": "image/tiff", + "wbmp": "image/vnd.wap.wbmp", + "ico": "image/x-icon", + "jng": "image/x-jng", + "bmp": "image/x-ms-bmp", + "svg": "image/svg+xml", + "svgz": "image/svg+xml", + "webp": "image/webp", + "woff": "application/font-woff", + "jar": "application/java-archive", + "war": "application/java-archive", + "ear": "application/java-archive", + "json": "application/json", + "hqx": "application/mac-binhex40", + "doc": "application/msword", + "pdf": "application/pdf", + "ps": "application/postscript", + "eps": "application/postscript", + "ai": "application/postscript", + "rtf": "application/rtf", + "m3u8": "application/vnd.apple.mpegurl", + "xls": "application/vnd.ms-excel", + "eot": "application/vnd.ms-fontobject", + "ppt": "application/vnd.ms-powerpoint", + "wmlc": "application/vnd.wap.wmlc", + "kml": "application/vnd.google-earth.kml+xml", + "kmz": "application/vnd.google-earth.kmz", + "7z": "application/x-7z-compressed", + "cco": "application/x-cocoa", + "jardiff": "application/x-java-archive-diff", + "jnlp": "application/x-java-jnlp-file", + "run": "application/x-makeself", + "pl": "application/x-perl", + "pm": "application/x-perl", + "prc": "application/x-pilot", + "pdb": "application/x-pilot", + "rar": "application/x-rar-compressed", + "rpm": "application/x-redhat-package-manager", + "sea": "application/x-sea", + "swf": "application/x-shockwave-flash", + "sit": "application/x-stuffit", + "tcl": "application/x-tcl", + "tk": "application/x-tcl", + "der": "application/x-x509-ca-cert", + "pem": "application/x-x509-ca-cert", + "crt": "application/x-x509-ca-cert", + "xpi": "application/x-xpinstall", + "xhtml": "application/xhtml+xml", + "xspf": "application/xspf+xml", + "zip": "application/zip", + "bin": "application/octet-stream", + "exe": "application/octet-stream", + "dll": "application/octet-stream", + "deb": "application/octet-stream", + "dmg": "application/octet-stream", + "iso": "application/octet-stream", + "img": "application/octet-stream", + "msi": "application/octet-stream", + "msp": "application/octet-stream", + "msm": "application/octet-stream", + "docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation", + "mid": "audio/midi", + "midi": "audio/midi", + "kar": "audio/midi", + "mp3": "audio/mpeg", + "ogg": "audio/ogg", + "m4a": "audio/x-m4a", + "ra": "audio/x-realaudio", + "3gpp": "video/3gpp", + "3gp": "video/3gpp", + "ts": "video/mp2t", + "mp4": "video/mp4", + "mpeg": "video/mpeg", + "mpg": "video/mpeg", + "mov": "video/quicktime", + "webm": "video/webm", + "flv": "video/x-flv", + "m4v": "video/x-m4v", + "mng": "video/x-mng", + "asx": "video/x-ms-asf", + "asf": "video/x-ms-asf", + "wmv": "video/x-ms-wmv", + "avi": "video/x-msvideo" +] + +fileprivate func mimeFromExt(ext: String?) -> String { + let lower: String = ext!.lowercased() + if ext != nil && mimeTypes.contains(where: { $0.0 == lower }) { + return mimeTypes[lower]! + } + return DEFAULT_MIME_TYPE +} + +extension NSString { + public func mimeType() -> String { + return mimeFromExt(ext: self.pathExtension) + } +} + +extension String { + public func mimeType() -> String { + return (self as NSString).mimeType() + } +} \ No newline at end of file From 96e5cb285372c1270806108ba1ce814fbc0c8d70 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 20:34:48 +1200 Subject: [PATCH 088/555] Update swift input file handling --- templates/swift/Sources/Client.swift.twig | 36 +++++++++++++++-------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index e1263a5125..77a7555c1b 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -338,8 +338,18 @@ open class Client { converter: (([String: Any]) -> T)? = nil, onProgress: ((UploadProgress) -> Void)? = nil ) async throws -> T { - let file = params[paramName] as! File - let size = file.buffer.readableBytes + let input = params[paramName] as! InputFile + + switch(input.sourceType) { + case "path": + input.data = ByteBuffer(data: try! Data(contentsOf: URL(fileURLWithPath: FileManager.default.currentDirectoryPath + input.path))) + case "data": + input.data = ByteBuffer(data: input.data as! Data) + default: + break + } + + let size = (input.data as! ByteBuffer).readableBytes if size < Client.chunkSize { return try await call( @@ -351,7 +361,6 @@ open class Client { ) } - let input = file.buffer var offset = 0 var result = [String:Any]() @@ -368,15 +377,13 @@ open class Client { offset = min(size, (chunksUploaded * Client.chunkSize)) } + let cachedInput = input + while offset < size { - let slice = input.getSlice(at: offset, length: Client.chunkSize) - ?? input.getSlice(at: offset, length: Int(size - offset)) + input.data = (cachedInput.data as! ByteBuffer).getSlice(at: offset, length: Client.chunkSize) + ?? (cachedInput.data as! ByteBuffer).getSlice(at: offset, length: Int(size - offset)) - params[paramName] = File( - name: file.name, - buffer: slice! - ) - + params[paramName] = input headers["content-range"] = "bytes \(offset)-\(min((offset + Client.chunkSize) - 1, size))/\(size)" result = try await call( @@ -429,12 +436,15 @@ open class Client { bodyBuffer.writeString(CRLF) bodyBuffer.writeString("Content-Disposition: form-data; name=\"\(name)\"") - if let file = value as? File { - bodyBuffer.writeString("; filename=\"\(file.name)\"") + if let file = value as? InputFile { + bodyBuffer.writeString("; filename=\"\(file.filename)\"") bodyBuffer.writeString(CRLF) bodyBuffer.writeString("Content-Length: \(bodyBuffer.readableBytes)") bodyBuffer.writeString(CRLF+CRLF) - bodyBuffer.writeBuffer(&file.buffer) + + var buffer = file.data! as! ByteBuffer + + bodyBuffer.writeBuffer(&buffer) bodyBuffer.writeString(CRLF) return } From 9351df4d8804652d366ac0f0d9fc6cfbd1b1b9e8 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 23 Jun 2022 20:35:10 +1200 Subject: [PATCH 089/555] WIP update swift input file tests --- tests/SwiftServer55Test.php | 2 + tests/languages/swift-server/Tests.swift | 75 +++++++++++++++--------- 2 files changed, 50 insertions(+), 27 deletions(-) diff --git a/tests/SwiftServer55Test.php b/tests/SwiftServer55Test.php index 1706734d96..d2c6ee952c 100644 --- a/tests/SwiftServer55Test.php +++ b/tests/SwiftServer55Test.php @@ -18,6 +18,8 @@ class SwiftServer55Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ]; } diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index 4b03b95ec6..231a84504e 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -68,36 +68,57 @@ class Tests: XCTestCase { let result = try await general.redirect() print((result as! [String: Any])["result"] as! String) - var url = URL(fileURLWithPath: "\(FileManager.default.currentDirectoryPath)/../../resources/file.png") - var buffer = ByteBuffer(data: try! Data(contentsOf: url)) - var file = File(name: "file.png", buffer: buffer) - mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) - print(mock.result) - - url = URL(fileURLWithPath: "\(FileManager.default.currentDirectoryPath)/../../resources/large_file.mp4") - buffer = ByteBuffer(data: try! Data(contentsOf: url)) - file = File(name: "large_file.mp4", buffer: buffer) - mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) - print(mock.result) - do { - try await general.error400() + var file = InputFile.fromPath("\(FileManager.default.currentDirectoryPath)/../../resources/file.png") + mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) + print(mock.result) } catch let error as AppwriteError { print(error.message) } - - do { - try await general.error500() - } catch { - print(error.localizedDescription) - } - - do { - try await general.error502() - } catch { - print(String(describing: error)) - } - - try! await general.empty() +// do { +// var file = InputFile.fromPath("\(FileManager.default.currentDirectoryPath)/../../resources/large_file.mp4") +// mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) +// print(mock.result) +// } catch let error as AppwriteError { +// print(error.message) +// } +// do { +// var url = URL(fileURLWithPath: "\(FileManager.default.currentDirectoryPath)/../../resources/file.png") +// var buffer = ByteBuffer(data: try! Data(contentsOf: url)) +// var file = InputFile.fromBuffer(buffer, filename: "file.png", mimeType: "image/png") +// mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) +// print(mock.result) +// } catch let error as AppwriteError { +// print(error.message) +// } +// do { +// var url = URL(fileURLWithPath: "\(FileManager.default.currentDirectoryPath)/../../resources/large_file.mp4") +// var buffer = ByteBuffer(data: try! Data(contentsOf: url)) +// var file = InputFile.fromBuffer(buffer, filename: "large_file.mp4", mimeType: "video/mp4") +// mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) +// print(mock.result) +// } catch let error as AppwriteError { +// print(error.message) +// } +// +// do { +// try await general.error400() +// } catch let error as AppwriteError { +// print(error.message) +// } +// +// do { +// try await general.error500() +// } catch { +// print(error.localizedDescription) +// } +// +// do { +// try await general.error502() +// } catch { +// print(String(describing: error)) +// } +// +// try! await general.empty() } } From 786fbd1a024a004c6dde83b20fe7750ece4688ba Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 24 Jun 2022 04:44:17 +0000 Subject: [PATCH 090/555] update file type --- templates/dart/lib/src/input_file.dart.twig | 20 ++++++++----------- .../flutter/lib/src/input_file.dart.twig | 20 ++++++++----------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/templates/dart/lib/src/input_file.dart.twig b/templates/dart/lib/src/input_file.dart.twig index b27b10874d..5ad30aca93 100644 --- a/templates/dart/lib/src/input_file.dart.twig +++ b/templates/dart/lib/src/input_file.dart.twig @@ -1,3 +1,5 @@ +import 'package:flutter/foundation.dart'; + class InputFile { late final String? path; late final List? bytes; @@ -5,17 +7,11 @@ class InputFile { final String? contentType; /// Provide a file using path - InputFile({required this.path, this.filename, this.contentType}) { - bytes = null; - } - - InputFile._internal(this.bytes, {this.filename, this.contentType}) { - path = null; - } - - /// Provide a file using bytes - factory InputFile.fromBytes( - {required List bytes, String? filename, String? contentType}) { - return InputFile._internal(bytes, filename: filename, contentType: contentType); + InputFile({this.path, this.filename, this.contentType, this.bytes}) { + if (kIsWeb && bytes == null) { + throw {{ spec.title | caseUcfirs }}Exception('On web `bytes` is required'); + } else if(path == null) { + throw {{ spec.title | caseUcfirs }}Exception('On IO platforms `path is required`); + } } } diff --git a/templates/flutter/lib/src/input_file.dart.twig b/templates/flutter/lib/src/input_file.dart.twig index b27b10874d..5ad30aca93 100644 --- a/templates/flutter/lib/src/input_file.dart.twig +++ b/templates/flutter/lib/src/input_file.dart.twig @@ -1,3 +1,5 @@ +import 'package:flutter/foundation.dart'; + class InputFile { late final String? path; late final List? bytes; @@ -5,17 +7,11 @@ class InputFile { final String? contentType; /// Provide a file using path - InputFile({required this.path, this.filename, this.contentType}) { - bytes = null; - } - - InputFile._internal(this.bytes, {this.filename, this.contentType}) { - path = null; - } - - /// Provide a file using bytes - factory InputFile.fromBytes( - {required List bytes, String? filename, String? contentType}) { - return InputFile._internal(bytes, filename: filename, contentType: contentType); + InputFile({this.path, this.filename, this.contentType, this.bytes}) { + if (kIsWeb && bytes == null) { + throw {{ spec.title | caseUcfirs }}Exception('On web `bytes` is required'); + } else if(path == null) { + throw {{ spec.title | caseUcfirs }}Exception('On IO platforms `path is required`); + } } } From ebe3b5c29bef5ae1001c908ebc2ce00e3bd9bdf3 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 24 Jun 2022 04:48:42 +0000 Subject: [PATCH 091/555] update docs --- templates/dart/lib/src/input_file.dart.twig | 3 ++- templates/flutter/lib/src/input_file.dart.twig | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/dart/lib/src/input_file.dart.twig b/templates/dart/lib/src/input_file.dart.twig index 5ad30aca93..5691992e74 100644 --- a/templates/dart/lib/src/input_file.dart.twig +++ b/templates/dart/lib/src/input_file.dart.twig @@ -6,7 +6,8 @@ class InputFile { final String? filename; final String? contentType; - /// Provide a file using path + /// Provide a file, use `path` for IO platforms + /// and provide `bytes` for web platform InputFile({this.path, this.filename, this.contentType, this.bytes}) { if (kIsWeb && bytes == null) { throw {{ spec.title | caseUcfirs }}Exception('On web `bytes` is required'); diff --git a/templates/flutter/lib/src/input_file.dart.twig b/templates/flutter/lib/src/input_file.dart.twig index 5ad30aca93..5691992e74 100644 --- a/templates/flutter/lib/src/input_file.dart.twig +++ b/templates/flutter/lib/src/input_file.dart.twig @@ -6,7 +6,8 @@ class InputFile { final String? filename; final String? contentType; - /// Provide a file using path + /// Provide a file, use `path` for IO platforms + /// and provide `bytes` for web platform InputFile({this.path, this.filename, this.contentType, this.bytes}) { if (kIsWeb && bytes == null) { throw {{ spec.title | caseUcfirs }}Exception('On web `bytes` is required'); From cf64332bb6eebec6249c3db33049478ca4bc2d5f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 24 Jun 2022 11:10:43 +0545 Subject: [PATCH 092/555] fixes check --- templates/dart/lib/src/input_file.dart.twig | 4 ++-- templates/flutter/lib/src/input_file.dart.twig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/dart/lib/src/input_file.dart.twig b/templates/dart/lib/src/input_file.dart.twig index 5691992e74..71585513fc 100644 --- a/templates/dart/lib/src/input_file.dart.twig +++ b/templates/dart/lib/src/input_file.dart.twig @@ -11,8 +11,8 @@ class InputFile { InputFile({this.path, this.filename, this.contentType, this.bytes}) { if (kIsWeb && bytes == null) { throw {{ spec.title | caseUcfirs }}Exception('On web `bytes` is required'); - } else if(path == null) { - throw {{ spec.title | caseUcfirs }}Exception('On IO platforms `path is required`); + } else if(!kIsWeb && path == null && bytes == null) { + throw {{ spec.title | caseUcfirs }}Exception('On IO platforms one of `path` or `bytes` is required`); } } } diff --git a/templates/flutter/lib/src/input_file.dart.twig b/templates/flutter/lib/src/input_file.dart.twig index 5691992e74..71585513fc 100644 --- a/templates/flutter/lib/src/input_file.dart.twig +++ b/templates/flutter/lib/src/input_file.dart.twig @@ -11,8 +11,8 @@ class InputFile { InputFile({this.path, this.filename, this.contentType, this.bytes}) { if (kIsWeb && bytes == null) { throw {{ spec.title | caseUcfirs }}Exception('On web `bytes` is required'); - } else if(path == null) { - throw {{ spec.title | caseUcfirs }}Exception('On IO platforms `path is required`); + } else if(!kIsWeb && path == null && bytes == null) { + throw {{ spec.title | caseUcfirs }}Exception('On IO platforms one of `path` or `bytes` is required`); } } } From 4ad9f8d82ef2d46f0a6be20b7f53f6574bf943d5 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 24 Jun 2022 08:39:46 +0000 Subject: [PATCH 093/555] fix filter --- templates/dart/lib/src/input_file.dart.twig | 4 ++-- templates/flutter/lib/src/input_file.dart.twig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/dart/lib/src/input_file.dart.twig b/templates/dart/lib/src/input_file.dart.twig index 71585513fc..06fec6f31f 100644 --- a/templates/dart/lib/src/input_file.dart.twig +++ b/templates/dart/lib/src/input_file.dart.twig @@ -10,9 +10,9 @@ class InputFile { /// and provide `bytes` for web platform InputFile({this.path, this.filename, this.contentType, this.bytes}) { if (kIsWeb && bytes == null) { - throw {{ spec.title | caseUcfirs }}Exception('On web `bytes` is required'); + throw {{ spec.title | caseUcfirst }}Exception('On web `bytes` is required'); } else if(!kIsWeb && path == null && bytes == null) { - throw {{ spec.title | caseUcfirs }}Exception('On IO platforms one of `path` or `bytes` is required`); + throw {{ spec.title | caseUcfirst }}Exception('On IO platforms one of `path` or `bytes` is required`); } } } diff --git a/templates/flutter/lib/src/input_file.dart.twig b/templates/flutter/lib/src/input_file.dart.twig index 71585513fc..06fec6f31f 100644 --- a/templates/flutter/lib/src/input_file.dart.twig +++ b/templates/flutter/lib/src/input_file.dart.twig @@ -10,9 +10,9 @@ class InputFile { /// and provide `bytes` for web platform InputFile({this.path, this.filename, this.contentType, this.bytes}) { if (kIsWeb && bytes == null) { - throw {{ spec.title | caseUcfirs }}Exception('On web `bytes` is required'); + throw {{ spec.title | caseUcfirst }}Exception('On web `bytes` is required'); } else if(!kIsWeb && path == null && bytes == null) { - throw {{ spec.title | caseUcfirs }}Exception('On IO platforms one of `path` or `bytes` is required`); + throw {{ spec.title | caseUcfirst }}Exception('On IO platforms one of `path` or `bytes` is required`); } } } From 721a53233ae57a25ff65c680a8b53a0dfa8fc457 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 24 Jun 2022 09:15:46 +0000 Subject: [PATCH 094/555] fix template --- templates/dart/lib/src/input_file.dart.twig | 8 +++----- templates/flutter/lib/src/input_file.dart.twig | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/templates/dart/lib/src/input_file.dart.twig b/templates/dart/lib/src/input_file.dart.twig index 06fec6f31f..84af234f8c 100644 --- a/templates/dart/lib/src/input_file.dart.twig +++ b/templates/dart/lib/src/input_file.dart.twig @@ -1,4 +1,4 @@ -import 'package:flutter/foundation.dart'; +import 'exception.dart'; class InputFile { late final String? path; @@ -9,10 +9,8 @@ class InputFile { /// Provide a file, use `path` for IO platforms /// and provide `bytes` for web platform InputFile({this.path, this.filename, this.contentType, this.bytes}) { - if (kIsWeb && bytes == null) { - throw {{ spec.title | caseUcfirst }}Exception('On web `bytes` is required'); - } else if(!kIsWeb && path == null && bytes == null) { - throw {{ spec.title | caseUcfirst }}Exception('On IO platforms one of `path` or `bytes` is required`); + if (path == null && bytes == null) { + throw {{ spec.title | caseUcfirst }}Exception('One of `path` or `bytes` is required'); } } } diff --git a/templates/flutter/lib/src/input_file.dart.twig b/templates/flutter/lib/src/input_file.dart.twig index 06fec6f31f..ef5e7be144 100644 --- a/templates/flutter/lib/src/input_file.dart.twig +++ b/templates/flutter/lib/src/input_file.dart.twig @@ -1,4 +1,5 @@ import 'package:flutter/foundation.dart'; +import 'exception.dart'; class InputFile { late final String? path; @@ -12,7 +13,7 @@ class InputFile { if (kIsWeb && bytes == null) { throw {{ spec.title | caseUcfirst }}Exception('On web `bytes` is required'); } else if(!kIsWeb && path == null && bytes == null) { - throw {{ spec.title | caseUcfirst }}Exception('On IO platforms one of `path` or `bytes` is required`); + throw {{ spec.title | caseUcfirst }}Exception('On IO platforms one of `path` or `bytes` is required'); } } } From 09216b749440fa0554c98914f23d0e2e2883e420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 24 Jun 2022 10:33:52 +0000 Subject: [PATCH 095/555] Deno more file types support --- composer.lock | 91 +++++++++-- src/SDK/Language/Deno.php | 8 +- templates/deno/mod.ts.twig | 2 + templates/deno/src/inputFile.ts.twig | 42 +++++ templates/deno/src/services/service.ts.twig | 164 ++++++++++---------- 5 files changed, 208 insertions(+), 99 deletions(-) create mode 100644 templates/deno/src/inputFile.ts.twig diff --git a/composer.lock b/composer.lock index 63f45efc6f..d776086ed4 100644 --- a/composer.lock +++ b/composer.lock @@ -374,16 +374,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v6.4.4", + "version": "v6.5.0", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "589cdb23728b2a19872945580b95d8aa2c6619da" + "reference": "d22afc08dab73d1dff07c700ed6a78f138f5020e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/589cdb23728b2a19872945580b95d8aa2c6619da", - "reference": "589cdb23728b2a19872945580b95d8aa2c6619da", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/d22afc08dab73d1dff07c700ed6a78f138f5020e", + "reference": "d22afc08dab73d1dff07c700ed6a78f138f5020e", "shasum": "" }, "require": { @@ -391,23 +391,25 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-simplexml": "*", + "jean85/pretty-package-versions": "^2.0.5", "php": "^7.3 || ^8.0", - "phpunit/php-code-coverage": "^9.2.11", + "phpunit/php-code-coverage": "^9.2.15", "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-timer": "^5.0.3", - "phpunit/phpunit": "^9.5.14", - "sebastian/environment": "^5.1.3", - "symfony/console": "^5.4.0 || ^6.0.0", - "symfony/process": "^5.4.0 || ^6.0.0" + "phpunit/phpunit": "^9.5.21", + "sebastian/environment": "^5.1.4", + "symfony/console": "^5.4.9 || ^6.1.1", + "symfony/process": "^5.4.8 || ^6.1.0" }, "require-dev": { "doctrine/coding-standard": "^9.0.0", + "ext-pcov": "*", "ext-posix": "*", - "infection/infection": "^0.26.5", + "infection/infection": "^0.26.12", "malukenho/mcbumpface": "^1.1.5", - "squizlabs/php_codesniffer": "^3.6.2", - "symfony/filesystem": "^v5.4.0 || ^6.0.0", - "vimeo/psalm": "^4.20.0" + "squizlabs/php_codesniffer": "^3.7.1", + "symfony/filesystem": "^5.4.9 || ^6.1.0", + "vimeo/psalm": "^4.23.0" }, "bin": [ "bin/paratest" @@ -446,7 +448,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v6.4.4" + "source": "https://github.com/paratestphp/paratest/tree/v6.5.0" }, "funding": [ { @@ -458,7 +460,7 @@ "type": "paypal" } ], - "time": "2022-03-28T07:55:11+00:00" + "time": "2022-06-23T13:00:19+00:00" }, { "name": "doctrine/instantiator", @@ -530,6 +532,65 @@ ], "time": "2022-03-03T08:28:38+00:00" }, + { + "name": "jean85/pretty-package-versions", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/ae547e455a3d8babd07b96966b17d7fd21d9c6af", + "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.0.0", + "php": "^7.1|^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.17", + "jean85/composer-provided-replaced-stub-package": "^1.0", + "phpstan/phpstan": "^0.12.66", + "phpunit/phpunit": "^7.5|^8.5|^9.4", + "vimeo/psalm": "^4.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A library to get pretty versions strings of installed dependencies", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "support": { + "issues": "https://github.com/Jean85/pretty-package-versions/issues", + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.5" + }, + "time": "2021-10-08T21:21:46+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.11.0", diff --git a/src/SDK/Language/Deno.php b/src/SDK/Language/Deno.php index 57063607f7..1912daf419 100644 --- a/src/SDK/Language/Deno.php +++ b/src/SDK/Language/Deno.php @@ -36,6 +36,12 @@ public function getFiles() 'template' => 'deno/src/query.ts.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'src/inputFile.ts', + 'template' => 'deno/src/inputFile.ts.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/src/service.ts', @@ -101,7 +107,7 @@ public function getTypeName($type) return 'string'; break; case self::TYPE_FILE: - return 'string'; + return 'InputFile'; break; case self::TYPE_BOOLEAN: return 'boolean'; diff --git a/templates/deno/mod.ts.twig b/templates/deno/mod.ts.twig index 9cc9d84d9f..d2e91faba1 100644 --- a/templates/deno/mod.ts.twig +++ b/templates/deno/mod.ts.twig @@ -1,5 +1,6 @@ import { Client } from "./src/client.ts"; import { Query } from "./src/query.ts"; +import { InputFile } from "./src/inputFile.ts"; import { {{spec.title | caseUcfirst}}Exception } from "./src/exception.ts"; {% for service in spec.services %} import { {{service.name | caseUcfirst}} } from "./src/services/{{service.name | caseDash}}.ts"; @@ -8,6 +9,7 @@ import { {{service.name | caseUcfirst}} } from "./src/services/{{service.name | export { Client, Query, + InputFile, {{spec.title | caseUcfirst}}Exception, {% for service in spec.services %} {{service.name | caseUcfirst}}, diff --git a/templates/deno/src/inputFile.ts.twig b/templates/deno/src/inputFile.ts.twig new file mode 100644 index 0000000000..0d3865fa48 --- /dev/null +++ b/templates/deno/src/inputFile.ts.twig @@ -0,0 +1,42 @@ +import { readableStreamFromReader } from "https://deno.land/std/streams/conversion.ts"; + +const _bufferToString = (buffer: Uint8Array): ReadableStream => { + return new ReadableStream({ + start(controller) { + controller.enqueue(buffer); + controller.close(); + } + }); +}; + +export class InputFile { + stream: ReadableStream; // Content of file as a stream + size: number; // Total final size of the file content + name: string; // File name + + static fromPath = (filePath: string, name: string): InputFile => { + const file = Deno.openSync(filePath); + const stream = readableStreamFromReader(file); + const size = Deno.statSync(filePath).size; + return new InputFile(stream, name, size); + }; + + static fromBuffer = (buffer: Uint8Array, name: string): InputFile => { + const stream = _bufferToString(buffer); + const size = buffer.byteLength; + return new InputFile(stream, name, size); + }; + + static fromPlainText = (content: string, name: string): InputFile => { + const buffer = new TextEncoder().encode(content); + const stream = _bufferToString(buffer); + const size = buffer.byteLength; + return new InputFile(stream, name, size); + }; + + constructor(stream: ReadableStream, name: string, size: number) { + this.stream = stream; + this.name = name; + this.size = size; + } +} \ No newline at end of file diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index 56c8ddbff3..57781fcd06 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -28,6 +28,7 @@ import { basename } from "https://deno.land/std@0.122.0/path/mod.ts"; import { Service } from '../service.ts'; import { Payload, Client } from '../client.ts'; +import { InputFile } from '../inputFile.ts'; import { AppwriteException } from '../exception.ts'; import type { Models } from '../models.d.ts'; @@ -70,122 +71,119 @@ export class {{ service.name | caseUcfirst }} extends Service { {% for parameter in method.parameters.query %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %}.toString(){% endif %}; + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; } {% endfor %} {% for parameter in method.parameters.body %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %}.toString(){% endif %}; + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; } {% endfor %} {% if 'multipart/form-data' in method.consumes %} {% for parameter in method.parameters.all %} {% if parameter.type == 'file' %} - const {size: size} = await Deno.stat({{ parameter.name | caseCamel | escapeKeyword }}); - if (size <= Client.CHUNK_SIZE) { - payload['{{ parameter.name }}'] = new File([await Deno.readFile({{ parameter.name | caseCamel | escapeKeyword }})], basename({{ parameter.name | caseCamel | escapeKeyword }})); - - return await this.client.call('{{ method.method | caseLower }}', path, { + const size = {{ parameter.name | caseCamel | escapeKeyword }}.size; + + const headers: { [header: string]: string } = { {% for parameter in method.parameters.header %} - '{{ parameter.name }}': ${{ parameter.name | caseCamel | escapeKeyword }}, + '{{ parameter.name }}': ${{ parameter.name | caseCamel | escapeKeyword }}, {% endfor %} {% for key, header in method.headers %} - '{{ key }}': '{{ header }}', + '{{ key }}': '{{ header }}', {% endfor %} - }, payload); - } else { - const stream = await Deno.open({{ parameter.name | caseCamel | escapeKeyword }}, { read: true }); - - let id = undefined; - let response = undefined; + }; - let counter = 0; - const totalCounters = Math.ceil(size / Client.CHUNK_SIZE); + let id = undefined; + let response = undefined; - const headers: { [header: string]: string } = { -{% for parameter in method.parameters.header %} - '{{ parameter.name }}': ${{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}': '{{ header }}', -{% endfor %} - }; + let chunksUploaded = 0; {% for parameter in method.parameters.all %} {% if parameter.isUploadID %} - if({{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { - try { - response = await this.client.call('get', path + '/' + {{ parameter.name }}, headers); - counter = response.chunksUploaded; - } catch(e) { - } + if({{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { + try { + response = await this.client.call('get', path + '/' + {{ parameter.name }}, headers); + chunksUploaded = response.chunksUploaded; + } catch(e) { } + } {% endif %} {% endfor %} - for (counter; counter < totalCounters; counter++) { - const start = (counter * Client.CHUNK_SIZE); - const end = Math.min((((counter * Client.CHUNK_SIZE) + Client.CHUNK_SIZE) - 1), size); - - headers['content-range'] = 'bytes ' + start + '-' + end + '/' + size + let currentChunk = 1; + let currentPosition = 0; + let uploadableChunk = new Uint8Array(Client.CHUNK_SIZE); - if (id) { - headers['x-{{spec.title | caseLower }}-id'] = id; - } - - let totalBuffer = new Uint8Array(Client.CHUNK_SIZE); - let lastBufferIndex = -1; - - for (let blockIndex = 0; blockIndex < Client.CHUNK_SIZE / Client.DENO_READ_CHUNK_SIZE; blockIndex++) { - const buf = new Uint8Array(Client.DENO_READ_CHUNK_SIZE); - const cursorPosition = await Deno.seek(stream.rid, start + (blockIndex * 16384), Deno.SeekMode.Start); - const numberOfBytesRead = await Deno.read(stream.rid, buf); - - if (!numberOfBytesRead) { - break; - } - - for (let byteIndex = 0; byteIndex < Client.DENO_READ_CHUNK_SIZE; byteIndex++) { - totalBuffer[(blockIndex * Client.DENO_READ_CHUNK_SIZE) + byteIndex] = buf[byteIndex]; - - if(buf[byteIndex] !== 0) { - lastBufferIndex = (blockIndex * Client.DENO_READ_CHUNK_SIZE) + byteIndex; - } - } - } + const uploadChunk = async (lastUpload = false) => { + if(currentChunk <= chunksUploaded) { + return; + } - // Shrink empty bytes - if(lastBufferIndex !== -1) { - const newTotalBuffer = new Uint8Array(lastBufferIndex + 1); - for(let index = 0; index <= lastBufferIndex; index++) { - newTotalBuffer[index] = totalBuffer[index]; - } - totalBuffer = newTotalBuffer; - } - - payload['{{ parameter.name }}'] = new File([totalBuffer], basename({{ parameter.name | caseCamel | escapeKeyword }})); + const start = ((currentChunk - 1) * Client.CHUNK_SIZE); + const end = start + currentPosition; - response = await this.client.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); + if(!lastUpload || currentChunk !== 1) { + headers['content-range'] = 'bytes ' + start + '-' + end + '/' + size; + } - if (!id) { - id = response['$id']; - } + console.log(headers['content-range']); - if (onProgress !== null) { - onProgress({ - $id: response['$id'], - progress: Math.min((counter+1) * Client.CHUNK_SIZE, size) / size * 100, - sizeUploaded: end+1, - chunksTotal: response['chunksTotal'], - chunksUploaded: response['chunksUploaded'] - }); + let uploadableChunkTrimmed: Uint8Array; + + if(currentPosition >= Client.CHUNK_SIZE) { + uploadableChunkTrimmed = uploadableChunk; + } else { + uploadableChunkTrimmed = new Uint8Array(currentPosition); + for(let i = 0; i <= currentPosition; i++) { + uploadableChunkTrimmed[i] = uploadableChunk[i]; } } - return response; + if (id) { + headers['x-{{spec.title | caseLower }}-id'] = id; + } + + payload['{{ parameter.name }}'] = new File([uploadableChunkTrimmed], {{ parameter.name | caseCamel | escapeKeyword }}.name); + + response = await this.client.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); + + if (!id) { + id = response['$id']; + } + + if (onProgress !== null) { + onProgress({ + $id: response['$id'], + progress: Math.min((currentChunk) * Client.CHUNK_SIZE, size) / size * 100, + sizeUploaded: end+1, + chunksTotal: response['chunksTotal'], + chunksUploaded: response['chunksUploaded'] + }); + } + + uploadableChunk = new Uint8Array(Client.CHUNK_SIZE); + currentPosition = 0; + currentChunk++; } + + for await (const chunk of {{ parameter.name | caseCamel | escapeKeyword }}.stream) { + let i = 0; + for(const b of chunk) { + uploadableChunk[currentPosition] = chunk[i]; + i++; + currentPosition++; + + if(currentPosition >= Client.CHUNK_SIZE) { + await uploadChunk(); + } + } + } + + await uploadChunk(true); + + return response; {% endif %} {% endfor %} {% else %} From 79aae367355d35270421df0ef36e66cb7022cc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 24 Jun 2022 11:00:36 +0000 Subject: [PATCH 096/555] Fix bugs --- templates/deno/src/client.ts.twig | 8 +++++++- templates/deno/src/services/service.ts.twig | 16 ++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/templates/deno/src/client.ts.twig b/templates/deno/src/client.ts.twig index 7c448ce990..13e4444963 100644 --- a/templates/deno/src/client.ts.twig +++ b/templates/deno/src/client.ts.twig @@ -78,7 +78,13 @@ export class Client { const formData = new FormData(); const flatParams = this.flatten(params); for (const key in flatParams) { - formData.append(key, flatParams[key]); + const value = flatParams[key]; + + if(value && value.type && value.type === 'file') { + formData.append(key, value.file, value.filename); + } else { + formData.append(key, flatParams[key]); + } } body = formData; } else { diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index 57781fcd06..e4910899a3 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -128,14 +128,12 @@ export class {{ service.name | caseUcfirst }} extends Service { headers['content-range'] = 'bytes ' + start + '-' + end + '/' + size; } - console.log(headers['content-range']); - let uploadableChunkTrimmed: Uint8Array; - if(currentPosition >= Client.CHUNK_SIZE) { + if(currentPosition + 1 >= Client.CHUNK_SIZE) { uploadableChunkTrimmed = uploadableChunk; } else { - uploadableChunkTrimmed = new Uint8Array(currentPosition); + uploadableChunkTrimmed = new Uint8Array(currentPosition + 1); for(let i = 0; i <= currentPosition; i++) { uploadableChunkTrimmed[i] = uploadableChunk[i]; } @@ -145,7 +143,7 @@ export class {{ service.name | caseUcfirst }} extends Service { headers['x-{{spec.title | caseLower }}-id'] = id; } - payload['{{ parameter.name }}'] = new File([uploadableChunkTrimmed], {{ parameter.name | caseCamel | escapeKeyword }}.name); + payload['{{ parameter.name }}'] = { type: 'file', file: new File([uploadableChunkTrimmed], {{ parameter.name | caseCamel | escapeKeyword }}.name), filename: {{ parameter.name | caseCamel | escapeKeyword }}.name }; response = await this.client.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); @@ -172,12 +170,14 @@ export class {{ service.name | caseUcfirst }} extends Service { let i = 0; for(const b of chunk) { uploadableChunk[currentPosition] = chunk[i]; - i++; - currentPosition++; - if(currentPosition >= Client.CHUNK_SIZE) { + if(currentPosition + 1 >= Client.CHUNK_SIZE) { await uploadChunk(); + currentPosition--; } + + i++; + currentPosition++; } } From 567ee5dfaf2ac90f119b6a9c8009119a36fc7171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 24 Jun 2022 11:07:59 +0000 Subject: [PATCH 097/555] Update tests, fix bug --- templates/deno/src/services/service.ts.twig | 6 +++--- tests/languages/deno/tests.ts | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index e4910899a3..234bb0b8c6 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -95,8 +95,8 @@ export class {{ service.name | caseUcfirst }} extends Service { {% endfor %} }; - let id = undefined; - let response = undefined; + let id: string | undefined = undefined; + let response: any = undefined; let chunksUploaded = 0; @@ -133,7 +133,7 @@ export class {{ service.name | caseUcfirst }} extends Service { if(currentPosition + 1 >= Client.CHUNK_SIZE) { uploadableChunkTrimmed = uploadableChunk; } else { - uploadableChunkTrimmed = new Uint8Array(currentPosition + 1); + uploadableChunkTrimmed = new Uint8Array(currentPosition); for(let i = 0; i <= currentPosition; i++) { uploadableChunkTrimmed[i] = uploadableChunk[i]; } diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts index a9411ca8d7..9833e0cea3 100644 --- a/tests/languages/deno/tests.ts +++ b/tests/languages/deno/tests.ts @@ -64,11 +64,11 @@ async function start() { // @ts-ignore console.log(response.result) - response = await general.upload('string', 123, ['string in array'], './tests/resources/file.png') + response = await general.upload('string', 123, ['string in array'], appwrite.InputFile.fromPath('./tests/resources/file.png', 'file.png')) // @ts-ignore console.log(response.result) - response = await general.upload('string', 123, ['string in array'], './tests/resources/large_file.mp4') + response = await general.upload('string', 123, ['string in array'], appwrite.InputFile.fromPath('./tests/resources/file.png', 'file.png')) // @ts-ignore console.log(response.result) @@ -93,4 +93,6 @@ async function start() { await general.empty(); } -start() +start().catch((err) => { + console.error(err); +}); From b12e0c14fa594df6d375f5c5123cea6983e4a8ff Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 26 Jun 2022 12:58:45 +0000 Subject: [PATCH 098/555] basic approach for dart --- src/SDK/SDK.php | 1 + src/Spec/Swagger2.php | 18 ++++++++++++++++-- templates/dart/base/requests/api.twig | 2 +- templates/dart/base/requests/file.twig | 2 +- templates/dart/base/requests/location.twig | 2 +- templates/dart/base/requests/oauth.twig | 2 +- templates/dart/base/utils.twig | 2 +- templates/dart/lib/services/service.dart.twig | 6 +++--- 8 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index 4eae44775f..506a8d27af 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -556,6 +556,7 @@ public function generate($target) foreach ($this->spec->getServices() as $key => $service) { $methods = $this->spec->getMethods($key); $params['service'] = [ + 'globalParams' => $service['globalParams'] ?? [], 'description' => $service['description'] ?? '', 'name' => $key, 'features' => [ diff --git a/src/Spec/Swagger2.php b/src/Spec/Swagger2.php index 9450d65c14..94f86bc8b9 100644 --- a/src/Spec/Swagger2.php +++ b/src/Spec/Swagger2.php @@ -6,6 +6,10 @@ class Swagger2 extends Spec { + /** + * @var array + */ + private array $serviceParams = []; /** * @return string @@ -104,9 +108,11 @@ public function getServices() if (isset($method['tags'])) { foreach ($method['tags'] as $tag) { if (!array_key_exists($tag, $list)) { + $methods = $this->getMethods($tag); $list[$tag] = [ 'name' => $tag, - 'methods' => $this->getMethods($tag), + 'methods' => $methods, + 'globalParams' => $this->serviceParams[$tag] ?? [], ]; } } @@ -132,7 +138,7 @@ public function getServices() public function getMethods($service) { $list = []; - + $serviceParams= []; $security = $this->getAttribute('securityDefinitions', []); $paths = $this->getAttribute('paths', []); @@ -204,6 +210,7 @@ public function getMethods($service) 'default' => $parameter['default'] ?? null, 'example' => $parameter['x-example'] ?? null, 'isUploadID' => $parameter['x-upload-id'] ?? false, + 'isGlobal' => $parameter['x-global'] ?? false, 'array' => [ 'type' => $parameter['items']['type'] ?? '', ], @@ -215,6 +222,10 @@ public function getMethods($service) $param['default'] = (is_array($param['default'])) ? json_encode($param['default']) : $param['default']; + if(($parameter['x-global'] ?? false)) { + $serviceParams[$param['name']] = $param; + } + switch ($parameter['in']) { case 'header': $output['parameters']['header'][] = $param; @@ -239,6 +250,7 @@ public function getMethods($service) $param['required'] = (in_array($key, $bodyRequired)); $param['default'] = $value['default'] ?? null; $param['example'] = $value['x-example'] ?? null; + $param['isGlobal'] = $value['x-global'] ?? false; $param['isUploadID'] = $value['x-upload-id'] ?? false; $param['array'] = [ 'type' => $value['items']['type'] ?? '', @@ -270,6 +282,8 @@ public function getMethods($service) } } + $this->serviceParams[$service] = $serviceParams; + return $list; } diff --git a/templates/dart/base/requests/api.twig b/templates/dart/base/requests/api.twig index b3e5dd8190..25f617c79c 100644 --- a/templates/dart/base/requests/api.twig +++ b/templates/dart/base/requests/api.twig @@ -1,4 +1,4 @@ -{% import 'flutter/base/utils.twig' as utils %} +{% import 'dart/base/utils.twig' as utils %} final Map params = { {{ utils.map_parameter(method.parameters.query) }} {{ utils.map_parameter(method.parameters.body) }} diff --git a/templates/dart/base/requests/file.twig b/templates/dart/base/requests/file.twig index b469b48319..c551210b19 100644 --- a/templates/dart/base/requests/file.twig +++ b/templates/dart/base/requests/file.twig @@ -1,4 +1,4 @@ - {% import 'flutter/base/utils.twig' as utils %} +{% import 'dart/base/utils.twig' as utils %} final Map params = { {{ utils.map_parameter(method.parameters.query) }} {{ utils.map_parameter(method.parameters.body) }} diff --git a/templates/dart/base/requests/location.twig b/templates/dart/base/requests/location.twig index 47731d778b..e2d1629e95 100644 --- a/templates/dart/base/requests/location.twig +++ b/templates/dart/base/requests/location.twig @@ -1,4 +1,4 @@ -{% import 'flutter/base/utils.twig' as utils %} +{% import 'dart/base/utils.twig' as utils %} final Map params = { {{ utils.map_parameter(method.parameters.query) }} {{ utils.map_parameter(method.parameters.body) }} diff --git a/templates/dart/base/requests/oauth.twig b/templates/dart/base/requests/oauth.twig index 4a19160be8..377b829da1 100644 --- a/templates/dart/base/requests/oauth.twig +++ b/templates/dart/base/requests/oauth.twig @@ -1,4 +1,4 @@ -{% import 'flutter/base/utils.twig' as utils %} +{% import 'dart/base/utils.twig' as utils %} final Map params = { {{ utils.map_parameter(method.parameters.query) }} {{ utils.map_parameter(method.parameters.body) }} diff --git a/templates/dart/base/utils.twig b/templates/dart/base/utils.twig index 2a23dbd98e..47e2517be4 100644 --- a/templates/dart/base/utils.twig +++ b/templates/dart/base/utils.twig @@ -8,4 +8,4 @@ {% for key, header in headers %} '{{ key }}': '{{ header }}', {% endfor %} -{% endmacro %} \ No newline at end of file +{% endmacro %} diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index fa43fb491a..2b089eff75 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -2,14 +2,14 @@ part of {{ language.params.packageName }}; {% macro parameter(parameter) %} {% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | escapeKeyword }}{% endmacro %} {% macro method_parameters(parameters, consumes) %} -{% if parameters.all|length > 0 %}{{ '{' }}{% for parameter in parameters.all %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} +{% if parameters|length > 0 %}{{ '{' }}{% for parameter in parameters %}{% if not parameter.isGlobal %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} {% endmacro %} {%if service.description %} {{ service.description|dartComment}} {% endif %} class {{ service.name | caseUcfirst }} extends Service { - {{ service.name | caseUcfirst }}(Client client): super(client); + {{ service.name | caseUcfirst }}(Client client{% if service.globalParams | length %}, {{ _self.method_parameters(service.globalParams, []) }}{% endif %}): super(client); {% for method in service.methods %} /// {{ method.title }} @@ -18,7 +18,7 @@ class {{ service.name | caseUcfirst }} extends Service { {{ method.description | dartComment }} /// {% endif %} - {% if method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters, method.consumes) }}) async { + {% if method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all, method.consumes) }}) async { final String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; {% if 'multipart/form-data' in method.consumes %} From d4acdb1b0ca18cb75b761328b8477bed81369cf6 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 27 Jun 2022 06:45:07 +0000 Subject: [PATCH 099/555] fix global params --- templates/dart/lib/services/service.dart.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index 2b089eff75..9ce4a8295f 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -2,7 +2,7 @@ part of {{ language.params.packageName }}; {% macro parameter(parameter) %} {% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | escapeKeyword }}{% endmacro %} {% macro method_parameters(parameters, consumes) %} -{% if parameters|length > 0 %}{{ '{' }}{% for parameter in parameters %}{% if not parameter.isGlobal %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} +{% if parameters|length > 0 %}{{ '{' }}{% for parameter in parameters %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} {% endmacro %} {%if service.description %} @@ -18,7 +18,7 @@ class {{ service.name | caseUcfirst }} extends Service { {{ method.description | dartComment }} /// {% endif %} - {% if method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all, method.consumes) }}) async { + {% if method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all | filter((param) => not param.isGlobal), method.consumes) }}) async { final String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; {% if 'multipart/form-data' in method.consumes %} From bbf4db9a8f94f46da82db5560d392df536de9c57 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 27 Jun 2022 07:00:07 +0000 Subject: [PATCH 100/555] flutter service params --- templates/flutter/lib/services/service.dart.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index e253f1cfbd..a835671d4d 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -1,14 +1,14 @@ part of {{ language.params.packageName }}; {% macro parameter(parameter) %}{% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | escapeKeyword }}{% endmacro %} {% macro method_parameters(parameters, consumes) %} -{% if parameters.all|length > 0 %}{{ '{' }}{% for parameter in parameters.all %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} +{% if parameters|length > 0 %}{{ '{' }}{% for parameter in parameters %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} {% endmacro %} {%if service.description %} {{ service.description|dartComment}} {% endif %} class {{ service.name | caseUcfirst }} extends Service { - {{ service.name | caseUcfirst }}(Client client): super(client); + {{ service.name | caseUcfirst }}(Client client{% if service.globalParams | length %}, {{ _self.method_parameters(service.globalParams, []) }}{% endif %}): super(client); {% for method in service.methods %} /// {{ method.title }} @@ -17,7 +17,7 @@ class {{ service.name | caseUcfirst }} extends Service { {{ method.description|dartComment }} /// {% endif %} - {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters, method.consumes) }}) async { + {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all | filter((param) => not param.isGlobal), method.consumes) }}) async { {% if method.parameters.path | length > 0 %}final{% else %}const{% endif %} String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; {% if 'multipart/form-data' in method.consumes %} From 68454ba2779e27bc14df7ee5dfd2d05c0925042f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 27 Jun 2022 07:22:22 +0000 Subject: [PATCH 101/555] updated spec and fixes for testing --- src/SDK/Language/Dart.php | 2 +- templates/dart/lib/services/service.dart.twig | 13 ++++++++++--- templates/flutter/lib/services/service.dart.twig | 14 +++++++++++--- tests/languages/dart/tests.dart | 12 ++++++------ tests/resources/spec.json | 5 +++++ 5 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index b87c307ee8..49eacb8973 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -112,7 +112,7 @@ public function getKeywords() */ public function getIdentifierOverrides() { - return ['Function' => 'Func']; + return ['Function' => 'Func', 'default' => 'xdefault', 'required' => 'xrequired']; } /** diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index 9ce4a8295f..59225e0812 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -1,15 +1,22 @@ part of {{ language.params.packageName }}; -{% macro parameter(parameter) %} -{% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | escapeKeyword }}{% endmacro %} +{% macro parameter(parameter) %}{% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}{% endmacro %} {% macro method_parameters(parameters, consumes) %} {% if parameters|length > 0 %}{{ '{' }}{% for parameter in parameters %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} {% endmacro %} +{% macro service_params(parameters) %} +{% if parameters|length > 0 %}{{ ', {' }}{% for parameter in parameters %}{% if parameter.required %}required {% endif %}this.{{ parameter.name | caseCamel | overrideIdentifier }}{% if not loop.last %}, {% endif %}{% endfor %}{{ '}' }}{% endif %} +{% endmacro %} {%if service.description %} {{ service.description|dartComment}} {% endif %} class {{ service.name | caseUcfirst }} extends Service { - {{ service.name | caseUcfirst }}(Client client{% if service.globalParams | length %}, {{ _self.method_parameters(service.globalParams, []) }}{% endif %}): super(client); + {{ service.name | caseUcfirst }}(Client client{{ _self.service_params(service.globalParams) }}): super(client); +{% if service.globalParams | length %} +{% for parameter in service.globalParams %} + {{ parameter.type | typeName }}{% if not parameter.required %}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}; +{% endfor %} +{% endif %} {% for method in service.methods %} /// {{ method.title }} diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index a835671d4d..20f19dc699 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -1,14 +1,22 @@ part of {{ language.params.packageName }}; -{% macro parameter(parameter) %}{% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | escapeKeyword }}{% endmacro %} +{% macro parameter(parameter) %}{% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}{% endmacro %} {% macro method_parameters(parameters, consumes) %} {% if parameters|length > 0 %}{{ '{' }}{% for parameter in parameters %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} {% endmacro %} +{% macro service_params(parameters) %} +{% if parameters|length > 0 %}{{ ', {' }}{% for parameter in parameters %}{% if parameter.required %}required {% endif %}this.{{ parameter.name | caseCamel | overrideIdentifier }}{% if not loop.last %}, {% endif %}{% endfor %}{{ '}' }}{% endif %} +{% endmacro %} {%if service.description %} {{ service.description|dartComment}} {% endif %} class {{ service.name | caseUcfirst }} extends Service { - {{ service.name | caseUcfirst }}(Client client{% if service.globalParams | length %}, {{ _self.method_parameters(service.globalParams, []) }}{% endif %}): super(client); + {{ service.name | caseUcfirst }}(Client client{{ _self.service_params(service.globalParams) }}): super(client); +{% if service.globalParams | length %} +{% for parameter in service.globalParams %} + {{ parameter.type | typeName }}{% if not parameter.required %}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}; +{% endfor %} +{% endif %} {% for method in service.methods %} /// {{ method.title }} @@ -18,7 +26,7 @@ class {{ service.name | caseUcfirst }} extends Service { /// {% endif %} {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all | filter((param) => not param.isGlobal), method.consumes) }}) async { - {% if method.parameters.path | length > 0 %}final{% else %}const{% endif %} String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; + {% if method.parameters.path | length > 0 %}final{% else %}const{% endif %} String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | overrideIdentifier }}){% endfor %}; {% if 'multipart/form-data' in method.consumes %} {{ include('flutter/base/requests/file.twig') }} diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 7aff91edbe..32602ed39a 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -3,7 +3,7 @@ import '../lib/models.dart'; void main() async { Client client = Client(); - Foo foo = Foo(client); + Foo foo = Foo(client, x: 'string'); Bar bar = Bar(client); General general = General(client); @@ -14,19 +14,19 @@ void main() async { // Foo Tests Mock response; - response = await foo.get(x: 'string', y: 123, z: ['string in array']); + response = await foo.get(y: 123, z: ['string in array']); print(response.result); - response = await foo.post(x: 'string', y: 123, z: ['string in array']); + response = await foo.post(y: 123, z: ['string in array']); print(response.result); - response = await foo.put(x: 'string', y: 123, z: ['string in array']); + response = await foo.put(y: 123, z: ['string in array']); print(response.result); - response = await foo.patch(x: 'string', y: 123, z: ['string in array']); + response = await foo.patch(y: 123, z: ['string in array']); print(response.result); - response = await foo.delete(x: 'string', y: 123, z: ['string in array']); + response = await foo.delete(y: 123, z: ['string in array']); print(response.result); // Bar Tests diff --git a/tests/resources/spec.json b/tests/resources/spec.json index e0ec51431b..deeb42d6b6 100644 --- a/tests/resources/spec.json +++ b/tests/resources/spec.json @@ -383,6 +383,7 @@ "description": "Sample string param", "required": true, "type": "string", + "x-global": true, "x-example": "[]", "in": "query" }, @@ -445,6 +446,7 @@ "type": "string", "description": "Sample string param", "default": null, + "x-global": true, "x-example": "[]" }, "y": { @@ -506,6 +508,7 @@ "type": "string", "description": "Sample string param", "default": null, + "x-global": true, "x-example": "[]" }, "y": { @@ -567,6 +570,7 @@ "type": "string", "description": "Sample string param", "default": null, + "x-global": true, "x-example": "[]" }, "y": { @@ -628,6 +632,7 @@ "type": "string", "description": "Sample string param", "default": null, + "x-global": true, "x-example": "[]" }, "y": { From 89be5db8066dca5f95bdbfc4502a81a1ea3e210a Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 27 Jun 2022 07:58:54 +0000 Subject: [PATCH 102/555] php service level params and flutter fix --- templates/php/base/params.twig | 27 +++++++++++++++++ templates/php/base/requests/params.twig | 27 ----------------- templates/php/src/Services/Service.php.twig | 33 ++++++++++++++++++--- tests/languages/flutter/tests.dart | 2 +- tests/languages/php/test.php | 12 ++++---- 5 files changed, 63 insertions(+), 38 deletions(-) create mode 100644 templates/php/base/params.twig delete mode 100644 templates/php/base/requests/params.twig diff --git a/templates/php/base/params.twig b/templates/php/base/params.twig new file mode 100644 index 0000000000..9fac3d03e2 --- /dev/null +++ b/templates/php/base/params.twig @@ -0,0 +1,27 @@ + $params = []; +{% if method.parameters.all | length %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal ) %} +{% if parameter.required %} + if (!isset(${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }})) { + throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); + } +{% endif %} +{% endfor %} +{% for parameter in method.parameters.query %} + if (!is_null(${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }})) { + $params['{{ parameter.name }}'] = ${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; + } + +{% endfor %} +{% for parameter in method.parameters.body %} + if (!is_null(${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }})) { + $params['{{ parameter.name }}'] = ${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; + } + +{% endfor %} +{% for parameter in method.parameters.formData %} + if (!is_null(${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }})) { + $params['{{ parameter.name }}'] = ${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; + } +{% endfor %} +{% endif %} \ No newline at end of file diff --git a/templates/php/base/requests/params.twig b/templates/php/base/requests/params.twig deleted file mode 100644 index 04813d936f..0000000000 --- a/templates/php/base/requests/params.twig +++ /dev/null @@ -1,27 +0,0 @@ - $params = []; -{% if method.parameters.all | length %} -{% for parameter in method.parameters.all %} -{% if parameter.required %} - if (!isset(${{ parameter.name | caseCamel | escapeKeyword }})) { - throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); - } -{% endif %} -{% endfor %} -{% for parameter in method.parameters.query %} - if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { - $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; - } - -{% endfor %} -{% for parameter in method.parameters.body %} - if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { - $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; - } - -{% endfor %} -{% for parameter in method.parameters.formData %} - if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { - $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; - } -{% endfor %} -{% endif %} \ No newline at end of file diff --git a/templates/php/src/Services/Service.php.twig b/templates/php/src/Services/Service.php.twig index a41e6f9627..fbab772c4e 100644 --- a/templates/php/src/Services/Service.php.twig +++ b/templates/php/src/Services/Service.php.twig @@ -9,6 +9,31 @@ use {{ spec.title | caseUcfirst }}\InputFile; class {{ service.name | caseUcfirst }} extends Service { +{% if service.globalParams | length %} + +{% for parameter in service.globalParams %} + protected {{ parameter.type | typeName }} ${{ parameter.name | caseCamel | escapeKeyword }}; + + public function set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}): void + { + $this->{{ parameter.name | caseCamel | escapeKeyword }} = ${{ parameter.name | caseCamel | escapeKeyword }}; + } + + public function get{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}): {{ parameter.type | typeName }} + { + return $this->{{ parameter.name | caseCamel | escapeKeyword }}; + } +{% endfor %} + + public function __construct(Client $client, {% for parameter in service.globalParams %} {{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + { + $this->client = $client; +{% for parameter in service.globalParams %} + $this->{{ parameter.name | caseCamel | escapeKeyword }} = ${{ parameter.name | caseCamel | escapeKeyword }}; +{% endfor %} + } + +{% endif %} {% for method in service.methods %} /** * {{ method.title }} @@ -17,18 +42,18 @@ class {{ service.name | caseUcfirst }} extends Service {{ method.description|comment1 }} * {% endif %} -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} * @param {{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{spec.title | caseUcfirst}}Exception * @return {{ method | getReturn }} */ - public function {{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, callable $onProgress = null{% endif %}): {{ method | getReturn }} + public function {{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal ) %}{{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, callable $onProgress = null{% endif %}): {{ method | getReturn }} { - $path = str_replace([{% for parameter in method.parameters.path %}'{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}'{% if not loop.last %}, {% endif %}{% endfor %}], [{% for parameter in method.parameters.path %}${{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}], '{{ method.path }}'); + $path = str_replace([{% for parameter in method.parameters.path %}'{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}'{% if not loop.last %}, {% endif %}{% endfor %}], [{% for parameter in method.parameters.path %}${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}], '{{ method.path }}'); -{{ include('php/base/requests/params.twig') }} +{{ include('php/base/params.twig') }} {% if 'multipart/form-data' in method.consumes %} {{ include('php/base/requests/file.twig') }} {% else %} diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index b03b3bc585..c8ae1e87b0 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -5,7 +5,7 @@ import '../lib/models.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); Client client = Client(); - Foo foo = Foo(client); + Foo foo = Foo(client, x: 'string'); Bar bar = Bar(client); General general = General(client); diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index 5667b27a2c..9a6ec906d5 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -16,7 +16,7 @@ use Appwrite\Services\General; $client = new Client(); -$foo = new Foo($client); +$foo = new Foo($client, 'string'); $bar = new Bar($client); $general = new General($client); @@ -26,19 +26,19 @@ // Foo Service -$response = $foo->get('string', 123, ['string in array']); +$response = $foo->get(123, ['string in array']); echo "{$response['result']}\n"; -$response = $foo->post('string', 123, ['string in array']); +$response = $foo->post(123, ['string in array']); echo "{$response['result']}\n"; -$response = $foo->put('string', 123, ['string in array']); +$response = $foo->put(123, ['string in array']); echo "{$response['result']}\n"; -$response = $foo->patch('string', 123, ['string in array']); +$response = $foo->patch(123, ['string in array']); echo "{$response['result']}\n"; -$response = $foo->delete('string', 123, ['string in array']); +$response = $foo->delete(123, ['string in array']); echo "{$response['result']}\n"; // Bar Service From 3c41ff09151132b9759318a354d57baf467f398e Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 27 Jun 2022 08:25:30 +0000 Subject: [PATCH 103/555] fix flutter tests --- tests/languages/flutter/tests.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index c8ae1e87b0..6bf56b1672 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -23,19 +23,19 @@ void main() async { print('\nTest Started'); Mock response; - response = await foo.get(x: 'string', y: 123, z: ['string in array']); + response = await foo.get(y: 123, z: ['string in array']); print(response.result); - response = await foo.post(x: 'string', y: 123, z: ['string in array']); + response = await foo.post(y: 123, z: ['string in array']); print(response.result); - response = await foo.put(x: 'string', y: 123, z: ['string in array']); + response = await foo.put(y: 123, z: ['string in array']); print(response.result); - response = await foo.patch(x: 'string', y: 123, z: ['string in array']); + response = await foo.patch(y: 123, z: ['string in array']); print(response.result); - response = await foo.delete(x: 'string', y: 123, z: ['string in array']); + response = await foo.delete(y: 123, z: ['string in array']); print(response.result); // Bar Tests From b4fb01a20e02f5f972715d3052587b38f5a64013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 27 Jun 2022 08:32:42 +0000 Subject: [PATCH 104/555] Service-level params for Deno --- templates/deno/src/services/service.ts.twig | 37 ++++++++++++++++----- tests/languages/deno/tests.ts | 12 +++---- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index 56c8ddbff3..82c81e712e 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -40,6 +40,27 @@ export type UploadProgress = { } export class {{ service.name | caseUcfirst }} extends Service { +{% if service.globalParams | length %} +{% for parameter in service.globalParams %} + protected {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}; + public set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}): void + { + this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; + } + public get{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}): {{ parameter.type | typeName }} + { + return this.{{ parameter.name | caseCamel | escapeKeyword }}; + } +{% endfor %} + constructor(client: Client, {% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}:{{ parameter.type | typeName }}{% if not parameter.required %}|null = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + { + super(client); + +{% for parameter in service.globalParams %} + this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; +{% endfor %} + } +{% endif %} {% for method in service.methods %} {% set generics = _self.get_generics(spec.definitions[method.responseModel], spec, true, true) %} {% set generics_return = _self.get_generics_return(spec.definitions[method.responseModel], spec) %} @@ -50,14 +71,14 @@ export class {{ service.name | caseUcfirst }} extends Service { {{ method.description|comment1 }} * {% endif %} -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {AppwriteException} * @returns {Promise} */ - async {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): Promise<{% if method.type == 'webAuth' %}Response{% elseif method.type == 'location' %}Response{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}> { -{% for parameter in method.parameters.all %} + async {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): Promise<{% if method.type == 'webAuth' %}Response{% elseif method.type == 'location' %}Response{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}> { +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if parameter.required %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); @@ -65,18 +86,18 @@ export class {{ service.name | caseUcfirst }} extends Service { {% endif %} {% endfor %} - let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; + let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name }}{{ '}' }}', {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; let payload: Payload = {}; {% for parameter in method.parameters.query %} - if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %}.toString(){% endif %}; + if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %}.toString(){% endif %}; } {% endfor %} {% for parameter in method.parameters.body %} - if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %}.toString(){% endif %}; + if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %}.toString(){% endif %}; } {% endfor %} {% if 'multipart/form-data' in method.consumes %} diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts index a9411ca8d7..26aa21670e 100644 --- a/tests/languages/deno/tests.ts +++ b/tests/languages/deno/tests.ts @@ -8,7 +8,7 @@ async function start() { // Init SDK let client = new appwrite.Client() - let foo = new appwrite.Foo(client) + let foo = new appwrite.Foo(client, 'string') let bar = new appwrite.Bar(client) let general = new appwrite.General(client) @@ -18,23 +18,23 @@ async function start() { // Foo - response = await foo.get('string', 123, ['string in array']) + response = await foo.get(123, ['string in array']) // @ts-ignore console.log(response.result) - response = await foo.post('string', 123, ['string in array']) + response = await foo.post(123, ['string in array']) // @ts-ignore console.log(response.result) - response = await foo.put('string', 123, ['string in array']) + response = await foo.put(123, ['string in array']) // @ts-ignore console.log(response.result) - response = await foo.patch('string', 123, ['string in array']) + response = await foo.patch(123, ['string in array']) // @ts-ignore console.log(response.result) - response = await foo.delete('string', 123, ['string in array']) + response = await foo.delete(123, ['string in array']) // @ts-ignore console.log(response.result) From c71e8ec1666e0c22c17c9dd8c8198274d5ca234b Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 27 Jun 2022 08:39:47 +0000 Subject: [PATCH 105/555] service params in Ruby --- templates/php/src/Services/Service.php.twig | 1 - .../lib/container/services/service.rb.twig | 21 +++++++++++++++---- tests/languages/ruby/tests.rb | 12 +++++------ 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/templates/php/src/Services/Service.php.twig b/templates/php/src/Services/Service.php.twig index fbab772c4e..3a40ce33ed 100644 --- a/templates/php/src/Services/Service.php.twig +++ b/templates/php/src/Services/Service.php.twig @@ -10,7 +10,6 @@ use {{ spec.title | caseUcfirst }}\InputFile; class {{ service.name | caseUcfirst }} extends Service { {% if service.globalParams | length %} - {% for parameter in service.globalParams %} protected {{ parameter.type | typeName }} ${{ parameter.name | caseCamel | escapeKeyword }}; diff --git a/templates/ruby/lib/container/services/service.rb.twig b/templates/ruby/lib/container/services/service.rb.twig index a796fcb90d..bdb9f55049 100644 --- a/templates/ruby/lib/container/services/service.rb.twig +++ b/templates/ruby/lib/container/services/service.rb.twig @@ -3,6 +3,19 @@ module {{spec.title | caseUcfirst}} class {{ service.name | caseUcfirst }} < Service +{% if service.globalParams | length %} +{% for parameter in service.globalParams %} + @{{ parameter.name | caseSnake | escapeKeyword }}{% if not parameter.required %}: nil{% endif %} +{% endfor %} + + def initialize(client, {% for parameter in service.globalParams %}{{ parameter.name | caseSnake | escapeKeyword }}:{% if not parameter.required %} nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + @client = client +{% for parameter in service.globalParams %} + @{{ parameter.name | caseSnake | escapeKeyword }} = {{ parameter.name | caseSnake | escapeKeyword }} +{% endfor %} + end +{% endif %} + {% for method in service.methods %} {{ method.description | rubyComment }} # @@ -11,10 +24,10 @@ module {{spec.title | caseUcfirst}} {% endfor %} # # @return [{{ method.responseModel | caseUcfirst }}] - def {{ method.name | caseSnake }}({% for parameter in method.parameters.all %}{{ parameter.name | caseSnake | escapeKeyword }}:{% if not parameter.required %} nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress: nil{% endif %}) + def {{ method.name | caseSnake }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseSnake | escapeKeyword }}:{% if not parameter.required %} nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress: nil{% endif %}) {% for parameter in method.parameters.all %} {% if parameter.required %} - if {{ parameter.name | caseSnake | escapeKeyword }}.nil? + if {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}.nil? raise {{spec.title | caseUcfirst}}::Exception.new('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"') end @@ -22,12 +35,12 @@ module {{spec.title | caseUcfirst}} {% endfor %} path = '{{ method.path }}' {% for parameter in method.parameters.path %} - .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {{ parameter.name | caseSnake | escapeKeyword }}) + .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}) {% endfor %} params = { {% for parameter in method.parameters.query | merge(method.parameters.body) %} - {{ parameter.name }}: {{ parameter.name | caseSnake | escapeKeyword }}, + {{ parameter.name }}: {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}, {% endfor %} } diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index 4ce61537c7..35a44859f4 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -3,7 +3,7 @@ client = Appwrite::Client.new client.add_header('Origin', 'http://localhost') -foo = Appwrite::Foo.new(client) +foo = Appwrite::Foo.new(client, x: 'string') bar = Appwrite::Bar.new(client) general = Appwrite::General.new(client) @@ -12,19 +12,19 @@ # Foo -response = foo.get(x: 'string', y: 123, z: ['string in array']) +response = foo.get(y: 123, z: ['string in array']) puts response.result -response = foo.post(x: 'string', y: 123, z: ['string in array']) +response = foo.post(y: 123, z: ['string in array']) puts response.result -response = foo.put(x: 'string', y: 123, z: ['string in array']) +response = foo.put(y: 123, z: ['string in array']) puts response.result -response = foo.patch(x: 'string', y: 123, z: ['string in array']) +response = foo.patch(y: 123, z: ['string in array']) puts response.result -response = foo.delete(x: 'string', y: 123, z: ['string in array']) +response = foo.delete(y: 123, z: ['string in array']) puts response.result # Bar From 7551778cf825f1bcd73fb2b3fa9d0a1921cec002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 27 Jun 2022 08:42:49 +0000 Subject: [PATCH 106/555] Service-level params for Node --- templates/node/lib/services/service.js.twig | 47 ++++++++++++++++++--- tests/languages/node/test.js | 12 +++--- 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 3487c7974c..d7fa99303e 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -7,6 +7,39 @@ const { promisify } = require('util'); const fs = require('fs'); class {{ service.name | caseUcfirst }} extends Service { +{% if service.globalParams | length %} +{% for parameter in service.globalParams %} + {{ parameter.name | caseCamel | escapeKeyword }}; + /** + * Set {{ parameter.name }}. + * + * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} + * + * @return void + */ + set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}) + { + this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; + } + /** + * Get {{ parameter.name }}. + * + * @return {{ parameter.type | typeName }} + */ + get{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}) + { + return this.{{ parameter.name | caseCamel | escapeKeyword }}; + } +{% endfor %} + constructor(client, {% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + { + super(client); + +{% for parameter in service.globalParams %} + this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; +{% endfor %} + } +{% endif %} {% for method in service.methods %} /** @@ -16,14 +49,14 @@ class {{ service.name | caseUcfirst }} extends Service { {{ method.description|comment1 }} * {% endif %} -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {Promise} */ - async {{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = () => {}{% endif %}) { -{% for parameter in method.parameters.all %} + async {{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = () => {}{% endif %}) { +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if parameter.required %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); @@ -35,14 +68,14 @@ class {{ service.name | caseUcfirst }} extends Service { let payload = {}; {% for parameter in method.parameters.query %} - if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; + if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; } {% endfor %} {% for parameter in method.parameters.body %} - if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword}}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; + if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword}}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; } {% endfor %} diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index 76a31d2b18..7f48708bfa 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -9,7 +9,7 @@ async function start() { // Init SDK let client = new appwrite.Client(); - let foo = new appwrite.Foo(client); + let foo = new appwrite.Foo(client, 'string'); let bar = new appwrite.Bar(client); let general = new appwrite.General(client); @@ -19,19 +19,19 @@ async function start() { // Foo - response = await foo.get('string', 123, ['string in array']); + response = await foo.get(123, ['string in array']); console.log(response.result); - response = await foo.post('string', 123, ['string in array']); + response = await foo.post(123, ['string in array']); console.log(response.result); - response = await foo.put('string', 123, ['string in array']); + response = await foo.put(123, ['string in array']); console.log(response.result); - response = await foo.patch('string', 123, ['string in array']); + response = await foo.patch(123, ['string in array']); console.log(response.result); - response = await foo.delete('string', 123, ['string in array']); + response = await foo.delete(123, ['string in array']); console.log(response.result); // Bar From 086d438b5bd5b62193dbb07c689537caf1ee882d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 27 Jun 2022 08:52:24 +0000 Subject: [PATCH 107/555] Service-level params for Web --- templates/web/src/services/template.ts.twig | 49 +++++++++++++++++---- tests/languages/web/index.html | 12 ++--- tests/languages/web/node.js | 12 ++--- 3 files changed, 53 insertions(+), 20 deletions(-) diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index 900bb99ca7..9d40d36cbd 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -8,6 +8,39 @@ type Payload = { } export class {{ service.name | caseUcfirst }} extends Service { +{% if service.globalParams | length %} +{% for parameter in service.globalParams %} + {{ parameter.name | caseCamel | escapeKeyword }}; + /** + * Set {{ parameter.name }}. + * + * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} + * + * @return void + */ + set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}) + { + this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; + } + /** + * Get {{ parameter.name }}. + * + * @return {{ parameter.type | typeName }} + */ + get{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}) + { + return this.{{ parameter.name | caseCamel | escapeKeyword }}; + } +{% endfor %} + constructor(client, {% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + { + super(client); + +{% for parameter in service.globalParams %} + this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; +{% endfor %} + } +{% endif %} {% for method in service.methods %} /** @@ -17,15 +50,15 @@ export class {{ service.name | caseUcfirst }} extends Service { {{ method.description|comment3 }} {% endif %} * -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} * @param {{ '{' }}{{ parameter.type | getPropertyType(method) | raw }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {% if method.type == 'webAuth' %}{void|string}{% elseif method.type == 'location' %}{URL}{% else %}{Promise}{% endif %} */ - {% if method.type != 'location' and method.type != 'webAuth'%}async {% endif %}{{ method.name | caseCamel }}{{ method.responseModel | getGenerics(spec) | raw }}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | getPropertyType(method) | raw }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): {{ method | getReturn(spec) | raw }} { -{% for parameter in method.parameters.all %} + {% if method.type != 'location' and method.type != 'webAuth'%}async {% endif %}{{ method.name | caseCamel }}{{ method.responseModel | getGenerics(spec) | raw }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | getPropertyType(method) | raw }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): {{ method | getReturn(spec) | raw }} { +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if parameter.required %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); @@ -33,18 +66,18 @@ export class {{ service.name | caseUcfirst }} extends Service { {% endif %} {% endfor %} - let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel | escapeKeyword }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; + let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel | escapeKeyword }}{{ '}' }}', {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; let payload: Payload = {}; {% for parameter in method.parameters.query %} - if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}; + if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; } {% endfor %} {% for parameter in method.parameters.body %} - if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}; + if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; } {% endfor %} diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index bab5e567f5..e614a892ae 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -22,7 +22,7 @@ // Init SDK const { Client, Foo, Bar, General } = Appwrite; const client = new Client(); - const foo = new Foo(client); + const foo = new Foo(client, 'string'); const bar = new Bar(client); const general = new General(client); @@ -34,19 +34,19 @@ }); // Foo - response = await foo.get("string", 123, ["string in array"]); + response = await foo.get(123, ["string in array"]); console.log(response.result); - response = await foo.post("string", 123, ["string in array"]); + response = await foo.post(123, ["string in array"]); console.log(response.result); - response = await foo.put("string", 123, ["string in array"]); + response = await foo.put(123, ["string in array"]); console.log(response.result); - response = await foo.patch("string", 123, ["string in array"]); + response = await foo.patch(123, ["string in array"]); console.log(response.result); - response = await foo.delete("string", 123, ["string in array"]); + response = await foo.delete(123, ["string in array"]); console.log(response.result); // Bar diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js index e5fccb359f..b2de9a4c8f 100644 --- a/tests/languages/web/node.js +++ b/tests/languages/web/node.js @@ -5,23 +5,23 @@ async function start() { console.log('\nTest Started'); const client = new Client(); - const foo = new Foo(client); + const foo = new Foo(client, 'string'); const bar = new Bar(client); const general = new General(client); // Foo - response = await foo.get('string', 123, ['string in array']); + response = await foo.get(123, ['string in array']); console.log(response.result); - response = await foo.post('string', 123, ['string in array']); + response = await foo.post(123, ['string in array']); console.log(response.result); - response = await foo.put('string', 123, ['string in array']); + response = await foo.put(123, ['string in array']); console.log(response.result); - response = await foo.patch('string', 123, ['string in array']); + response = await foo.patch(123, ['string in array']); console.log(response.result); - response = await foo.delete('string', 123, ['string in array']); + response = await foo.delete(123, ['string in array']); console.log(response.result); // Bar From e170c34da4780abfca215c957eff1cd58a7df762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 27 Jun 2022 08:52:33 +0000 Subject: [PATCH 108/555] Fix node service params --- templates/node/lib/services/service.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index d7fa99303e..4573216e15 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -64,7 +64,7 @@ class {{ service.name | caseUcfirst }} extends Service { {% endif %} {% endfor %} - let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; + let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; let payload = {}; {% for parameter in method.parameters.query %} From 0e24ea7676200d9879610ab4d9eea40e54296ace Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 27 Jun 2022 10:56:14 +0000 Subject: [PATCH 109/555] swift --- .../swift/Sources/Services/Service.swift.twig | 27 ++++++++++++++----- tests/languages/swift-client/Tests.swift | 12 ++++----- tests/languages/swift-server/Tests.swift | 12 ++++----- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index 65f467c738..b5327ab1c9 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -10,6 +10,21 @@ import NIO import {{spec.title | caseUcfirst}}Models open class {{ service.name | caseUcfirst }}: Service { +{% if service.globalParams | length %} +{% for parameter in service.globalParams %} + var {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}{% if not parameter.required %}?{% endif %} +{% endfor %} + + + public init(_ client: Client, {% for parameter in service.globalParams %}_ {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + { +{% for parameter in service.globalParams %} + self.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }} +{% endfor %} + super.init(client) + } + +{% endif %} {% for method in service.methods %} /// /// {{ method.title }} @@ -28,7 +43,7 @@ open class {{ service.name | caseUcfirst }}: Service { @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) {% endif %} open func {{ method.name | caseCamel }}( -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} {% endfor %} @@ -40,7 +55,7 @@ open class {{ service.name | caseUcfirst }}: Service { {% for parameter in method.parameters.path %} path = path.replacingOccurrences( of: "{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}", - with: {% if method.parameters.path %}{{ parameter.name | caseCamel | escapeKeyword }}{% else %}""{% endif %} + with: {% if method.parameters.path %}{% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% else %}""{% endif %} ) {% endfor %} @@ -50,7 +65,7 @@ open class {{ service.name | caseUcfirst }}: Service { let params: [String: Any?] = [:] {% endif %} {% for parameter in method.parameters.query | merge(method.parameters.body) %} - "{{ parameter.name }}": {{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last or _self.methodNeedsSecurityParameters(method) %},{% endif %} + "{{ parameter.name }}": {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last or _self.methodNeedsSecurityParameters(method) %},{% endif %} {% endfor %} {% if _self.methodNeedsSecurityParameters(method) %} @@ -138,7 +153,7 @@ open class {{ service.name | caseUcfirst }}: Service { {{ method.description | swiftComment }} /// {% endif %} -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} /// @param {{ parameter.type | typeName | raw}} {{ parameter.name | caseCamel }} {% endfor %} /// @throws Exception @@ -149,7 +164,7 @@ open class {{ service.name | caseUcfirst }}: Service { @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) {% endif %} open func {{ method.name | caseCamel }}( -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}, {% endfor %} {% if 'multipart/form-data' in method.consumes %} @@ -160,7 +175,7 @@ open class {{ service.name | caseUcfirst }}: Service { Task { do { let result = try await {{ method.name | caseCamel }}( -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} {% endfor %} diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/swift-client/Tests.swift index 807bc09d41..bbee6d6af1 100644 --- a/tests/languages/swift-client/Tests.swift +++ b/tests/languages/swift-client/Tests.swift @@ -25,7 +25,7 @@ class Tests: XCTestCase { .addHeader(key: "Origin", value: "http://localhost") .setSelfSigned() - let foo = Foo(client) + let foo = Foo(client, "string") let bar = Bar(client) let general = General(client) let realtime = Realtime(client) @@ -41,19 +41,19 @@ class Tests: XCTestCase { var mock: Mock // Foo Tests - mock = try await foo.get(x: "string", y: 123, z: ["string in array"]) + mock = try await foo.get(y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.post(x: "string", y: 123, z: ["string in array"]) + mock = try await foo.post(y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.put(x: "string", y: 123, z: ["string in array"]) + mock = try await foo.put(y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.patch(x: "string", y: 123, z: ["string in array"]) + mock = try await foo.patch(y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.delete(x: "string", y: 123, z: ["string in array"]) + mock = try await foo.delete(y: 123, z: ["string in array"]) print(mock.result) diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index 4b03b95ec6..29d70b0f52 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -24,26 +24,26 @@ class Tests: XCTestCase { .addHeader(key: "Origin", value: "http://localhost") .setSelfSigned() - let foo = Foo(client) + let foo = Foo(client, "string") let bar = Bar(client) let general = General(client) var mock: Mock // Foo Tests - mock = try await foo.get(x: "string", y: 123, z: ["string in array"]) + mock = try await foo.get(y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.post(x: "string", y: 123, z: ["string in array"]) + mock = try await foo.post(y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.put(x: "string", y: 123, z: ["string in array"]) + mock = try await foo.put(y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.patch(x: "string", y: 123, z: ["string in array"]) + mock = try await foo.patch(y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.delete(x: "string", y: 123, z: ["string in array"]) + mock = try await foo.delete(y: 123, z: ["string in array"]) print(mock.result) From 62a1b5304b3e9a0bd1f5edbaa0650a08047a68fb Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 27 Jun 2022 10:56:29 +0000 Subject: [PATCH 110/555] example spec updated --- specs/swagger2-latest-console.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/swagger2-latest-console.json b/specs/swagger2-latest-console.json index 7c667134d2..54afe0ccf1 100644 --- a/specs/swagger2-latest-console.json +++ b/specs/swagger2-latest-console.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"version":"0.13.4","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@appwrite.io"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"HOSTNAME","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":47,"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":37,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete 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":56,"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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":54,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":46,"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:{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":50,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":52,"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, Team Invites and Magic URL, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":53,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 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":48,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":55,"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":{},"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":60,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":61,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":49,"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":38,"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 at least 8 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":59,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":45,"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\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":43,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":44,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":39,"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, notion, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, zoom, yahoo, yammer, yandex, wordpress, stripe.","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":"","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":"","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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":51,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to \"refresh\" the access token.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":58,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":57,"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 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":62,"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},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":63,"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 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 [GET \/account\/sessions](\/docs\/client\/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":65,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":64,"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":68,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":66,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":67,"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. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":70,"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.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":69,"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 1 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":1,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/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":72,"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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":71,"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":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[COLLECTION_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/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":73,"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 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":77,"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 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]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name","permission"]}}]},"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":78,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databaseListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":87,"cookies":false,"type":"","demo":"database\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databaseCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a boolean attribute.\n","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":86,"cookies":false,"type":"","demo":"database\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databaseCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an email attribute.\n","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":80,"cookies":false,"type":"","demo":"database\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databaseCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":81,"cookies":false,"type":"","demo":"database\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databaseCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":85,"cookies":false,"type":"","demo":"database\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"number","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"number","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databaseCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":84,"cookies":false,"type":"","demo":"database\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databaseCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create IP address attribute.\n","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":82,"cookies":false,"type":"","demo":"database\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databaseCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a string attribute.\n","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":79,"cookies":false,"type":"","demo":"database\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databaseCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a URL attribute.\n","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":83,"cookies":false,"type":"","demo":"database\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databaseGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":88,"cookies":false,"type":"","demo":"database\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databaseDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":89,"cookies":false,"type":"","demo":"database\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","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":95,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/database#querying-documents).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"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":94,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","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":96,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"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":98,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object. Include only attribute and value pairs to be updated.","default":{},"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":99,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databaseListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the document activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":97,"cookies":false,"type":"","demo":"database\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databaseListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":91,"cookies":false,"type":"","demo":"database\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databaseCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":90,"cookies":false,"type":"","demo":"database\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/database\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databaseGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":92,"cookies":false,"type":"","demo":"database\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databaseDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":93,"cookies":false,"type":"","demo":"database\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/database\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databaseListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":76,"cookies":false,"type":"","demo":"database\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databaseGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getUsage","weight":74,"cookies":false,"type":"","demo":"database\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/database\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databaseGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":75,"cookies":false,"type":"","demo":"database\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_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":193,"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":"Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":192,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[FUNCTION_ID]"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","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":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List runtimes","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active on your instance.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":194,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":195,"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 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":197,"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 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](https:\/\/appwrite.io\/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 that will be passed to the function as environment variables.","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":"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":199,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments":{"get":{"summary":"List Deployments","operationId":"functionsListDeployments","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code deployments. You can use the query params to filter your results.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"listDeployments","weight":201,"cookies":false,"type":"","demo":"functions\/list-deployments.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-deployments.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 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":"Maximum number of deployments to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 Deployment","operationId":"functionsCreateDeployment","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"createDeployment","weight":200,"cookies":false,"type":"","demo":"functions\/create-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"entrypoint","description":"Entrypoint File.","required":true,"type":"string","x-example":"[ENTRYPOINT]","in":"formData"},{"name":"code","description":"Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.","required":true,"type":"file","in":"formData"},{"name":"activate","description":"Automatically activate the deployment when it is finished building.","required":true,"type":"boolean","x-example":false,"in":"formData"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}":{"get":{"summary":"Get Deployment","operationId":"functionsGetDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code deployment by its unique ID.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"getDeployment","weight":202,"cookies":false,"type":"","demo":"functions\/get-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"patch":{"summary":"Update Function Deployment","operationId":"functionsUpdateDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateDeployment","weight":198,"cookies":false,"type":"","demo":"functions\/update-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"delete":{"summary":"Delete Deployment","operationId":"functionsDeleteDeployment","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code deployment by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDeployment","weight":203,"cookies":false,"type":"","demo":"functions\/delete-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":207,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":205,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":204,"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 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]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":206,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":196,"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 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":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":107,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":117,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":110,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":109,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":114,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":115,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":113,"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\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":112,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":116,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":111,"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":100,"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":104,"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":101,"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":102,"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":103,"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":105,"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":106,"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":120,"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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":119,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[PROJECT_ID]"},"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":["projectId","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":121,"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":123,"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":128,"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 at least 8 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":126,"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":"integer","description":"Set the max number of users allowed in this project. Use 0 for unlimited.","default":null,"x-example":0}},"required":["limit"]}}]}},"\/projects\/{projectId}\/auth\/{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":127,"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,magic-url,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":145,"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":144,"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":146,"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":148,"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":147,"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":135,"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":134,"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":136,"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":137,"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":138,"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":125,"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":140,"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":139,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":"[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":141,"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":142,"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":143,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":124,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":122,"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":130,"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":129,"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":131,"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":132,"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":133,"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\/buckets":{"get":{"summary":"List buckets","operationId":"storageListBuckets","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the storage buckets. You can use the query params to filter your results.","responses":{"200":{"description":"Buckets List","schema":{"$ref":"#\/definitions\/bucketList"}}},"x-appwrite":{"method":"listBuckets","weight":150,"cookies":false,"type":"","demo":"storage\/list-buckets.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"cursor","description":"ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 bucket","operationId":"storageCreateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new storage bucket.","responses":{"201":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"createBucket","weight":149,"cookies":false,"type":"","demo":"storage\/create-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"bucketId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[BUCKET_ID]"},"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":30000000,"x-example":null},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["bucketId","name","permission"]}}]}},"\/storage\/buckets\/{bucketId}":{"get":{"summary":"Get Bucket","operationId":"storageGetBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"getBucket","weight":151,"cookies":false,"type":"","demo":"storage\/get-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]},"put":{"summary":"Update Bucket","operationId":"storageUpdateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a storage bucket by its unique ID.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"updateBucket","weight":152,"cookies":false,"type":"","demo":"storage\/update-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":null,"x-example":null},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Bucket","operationId":"storageDeleteBucket","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a storage bucket by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteBucket","weight":153,"cookies":false,"type":"","demo":"storage\/delete-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["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":155,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":154,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/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":156,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":160,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":161,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":158,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":157,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":159,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":162,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":163,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":165,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":164,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":166,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":167,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":168,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/logs":{"get":{"summary":"List Team Logs","operationId":"teamsListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get the team activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":175,"cookies":false,"type":"","demo":"teams\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":170,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":169,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":171,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":172,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). 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":174,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":173,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":177,"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":"Maximum number of users to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":176,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":191,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":178,"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 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":190,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":186,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":181,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":184,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":185,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/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":179,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"usersUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":187,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":180,"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 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":189,"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 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":188,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":182,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateVerification","weight":183,"cookies":false,"type":"","demo":"users\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}}},"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":{"documentList":{"description":"Documents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of documents documents that matched your query.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["total","documents"]},"collectionList":{"description":"Collections List","type":"object","properties":{"total":{"type":"integer","description":"Total number of collections documents that matched your query.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["total","collections"]},"indexList":{"description":"Indexes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of indexes documents that matched your query.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["total","indexes"]},"userList":{"description":"Users List","type":"object","properties":{"total":{"type":"integer","description":"Total number of users documents that matched your query.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["total","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of sessions documents that matched your query.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["total","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"total":{"type":"integer","description":"Total number of logs documents that matched your query.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["total","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"total":{"type":"integer","description":"Total number of files documents that matched your query.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["total","files"]},"bucketList":{"description":"Buckets List","type":"object","properties":{"total":{"type":"integer","description":"Total number of buckets documents that matched your query.","x-example":5,"format":"int32"},"buckets":{"type":"array","description":"List of buckets.","items":{"type":"object","$ref":"#\/definitions\/bucket"},"x-example":""}},"required":["total","buckets"]},"teamList":{"description":"Teams List","type":"object","properties":{"total":{"type":"integer","description":"Total number of teams documents that matched your query.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["total","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"total":{"type":"integer","description":"Total number of memberships documents that matched your query.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["total","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of functions documents that matched your query.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["total","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of runtimes documents that matched your query.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["total","runtimes"]},"deploymentList":{"description":"Deployments List","type":"object","properties":{"total":{"type":"integer","description":"Total number of deployments documents that matched your query.","x-example":5,"format":"int32"},"deployments":{"type":"array","description":"List of deployments.","items":{"type":"object","$ref":"#\/definitions\/deployment"},"x-example":""}},"required":["total","deployments"]},"executionList":{"description":"Executions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of executions documents that matched your query.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["total","executions"]},"projectList":{"description":"Projects List","type":"object","properties":{"total":{"type":"integer","description":"Total number of projects documents that matched your query.","x-example":5,"format":"int32"},"projects":{"type":"array","description":"List of projects.","items":{"type":"object","$ref":"#\/definitions\/project"},"x-example":""}},"required":["total","projects"]},"webhookList":{"description":"Webhooks List","type":"object","properties":{"total":{"type":"integer","description":"Total number of webhooks documents that matched your query.","x-example":5,"format":"int32"},"webhooks":{"type":"array","description":"List of webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"},"x-example":""}},"required":["total","webhooks"]},"keyList":{"description":"API Keys List","type":"object","properties":{"total":{"type":"integer","description":"Total number of keys documents that matched your query.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["total","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"total":{"type":"integer","description":"Total number of platforms documents that matched your query.","x-example":5,"format":"int32"},"platforms":{"type":"array","description":"List of platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"},"x-example":""}},"required":["total","platforms"]},"domainList":{"description":"Domains List","type":"object","properties":{"total":{"type":"integer","description":"Total number of domains documents that matched your query.","x-example":5,"format":"int32"},"domains":{"type":"array","description":"List of domains.","items":{"type":"object","$ref":"#\/definitions\/domain"},"x-example":""}},"required":["total","domains"]},"countryList":{"description":"Countries List","type":"object","properties":{"total":{"type":"integer","description":"Total number of countries documents that matched your query.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["total","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of continents documents that matched your query.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["total","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"total":{"type":"integer","description":"Total number of languages documents that matched your query.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["total","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"total":{"type":"integer","description":"Total number of currencies documents that matched your query.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["total","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"total":{"type":"integer","description":"Total number of phones documents that matched your query.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["total","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"total":{"type":"integer","description":"Total number of metrics documents that matched your query.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["total","metrics"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$read","$write","name","enabled","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of attributes in the given collection.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["total","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"integer","description":"Attribute size.","x-example":128,"format":"int32"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"count"},"type":{"type":"string","description":"Attribute type.","x-example":"integer"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"percentageCompleted"},"type":{"type":"string","description":"Attribute type.","x-example":"double"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"isEnabled"},"type":{"type":"string","description":"Attribute type.","x-example":"boolean"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"userEmail"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"status"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"ipAddress"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"githubUrl"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":"primary"},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"integer","description":"Date, the Unix timestamp of when the access token expires.","x-example":1592981250,"format":"int32"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"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"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$read","$write","name","dateCreated","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"bucket":{"description":"Bucket","type":"object","properties":{"$id":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":["role:all"]},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":["user:608f9da25e7e1"]},"permission":{"type":"string","description":"Bucket permission model. Possible values: `bucket` or `file`","x-example":"file"},"dateCreated":{"type":"integer","description":"Bucket creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Bucket update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Bucket name.","x-example":"Documents"},"enabled":{"type":"boolean","description":"Bucket enabled.","x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size supported.","x-example":100,"format":"int32"},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions.","items":{"type":"string"},"x-example":["jpg","png"]},"encryption":{"type":"boolean","description":"Bucket is encrypted.","x-example":false},"antivirus":{"type":"boolean","description":"Virus scanning is enabled.","x-example":false}},"required":["$id","$read","$write","permission","dateCreated","dateUpdated","name","enabled","maximumFileSize","allowedFileExtensions","encryption","antivirus"]},"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"},"total":{"type":"integer","description":"Total number of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","total"]},"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"},"execute":{"type":"array","description":"Execution permissions.","items":{"type":"string"},"x-example":"role:member"},"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"},"runtime":{"type":"string","description":"Function execution runtime.","x-example":"python-3.8"},"deployment":{"type":"string","description":"Function's active deployment ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"object","additionalProperties":true,"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","execute","name","dateCreated","dateUpdated","status","runtime","deployment","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"deployment":{"description":"Deployment","type":"object","properties":{"$id":{"type":"string","description":"Deployment ID.","x-example":"5e5ea5c16897e"},"resourceId":{"type":"string","description":"Resource ID.","x-example":"5e5ea6g16897e"},"resourceType":{"type":"string","description":"Resource type.","x-example":"functions"},"dateCreated":{"type":"integer","description":"The deployment creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"entrypoint":{"type":"string","description":"The entrypoint file to use to execute the deployment code.","x-example":"enabled"},"size":{"type":"integer","description":"The code size in bytes.","x-example":128,"format":"int32"},"buildId":{"type":"string","description":"The current build ID.","x-example":"5e5ea5c16897e"},"activate":{"type":"boolean","description":"Whether the deployment should be automatically activated.","x-example":true},"status":{"type":"string","description":"The deployment status.","x-example":"enabled"},"buildStdout":{"type":"string","description":"The build stdout.","x-example":"enabled"},"buildStderr":{"type":"string","description":"The build stderr.","x-example":"enabled"}},"required":["$id","resourceId","resourceType","dateCreated","entrypoint","size","buildId","activate","status","buildStdout","buildStderr"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"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"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$read","functionId","dateCreated","trigger","status","statusCode","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"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerNotionAppid":{"type":"string","description":"Notion OAuth app ID.","x-example":"123247283472834787438"},"providerNotionSecret":{"type":"string","description":"Notion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerVkAppid":{"type":"string","description":"VK OAuth app ID.","x-example":"123247283472834787438"},"providerVkSecret":{"type":"string","description":"VK OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerZoomAppid":{"type":"string","description":"Zoom OAuth app ID.","x-example":"123247283472834787438"},"providerZoomSecret":{"type":"string","description":"Zoom OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYammerAppid":{"type":"string","description":"Yammer OAuth app ID.","x-example":"123247283472834787438"},"providerYammerSecret":{"type":"string","description":"Yammer OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerStripeAppid":{"type":"string","description":"Stripe OAuth app ID.","x-example":"123247283472834787438"},"providerStripeSecret":{"type":"string","description":"Stripe OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabase":{"type":"boolean","description":"Database service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDiscordAppid","providerDiscordSecret","providerDropboxAppid","providerDropboxSecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerNotionAppid","providerNotionSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerVkAppid","providerVkSecret","providerZoomAppid","providerZoomSecret","providerYahooAppid","providerYahooSecret","providerYammerAppid","providerYammerSecret","providerYandexAppid","providerYandexSecret","providerWordpressAppid","providerWordpressSecret","providerStripeAppid","providerStripeSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabase","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"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"]},"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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]},"metric":{"description":"Metric","type":"object","properties":{"value":{"type":"integer","description":"The value of this metric at the timestamp.","x-example":1,"format":"int32"},"timestamp":{"type":"integer","description":"The UNIX timestamp at which this metric was aggregated.","x-example":1592981250,"format":"int32"}},"required":["value","timestamp"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by files (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"tagsStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by tags (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCount":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCount":{"type":"array","description":"Aggregated stats for total number of buckets.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCreate":{"type":"array","description":"Aggregated stats for buckets created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsRead":{"type":"array","description":"Aggregated stats for buckets read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsUpdate":{"type":"array","description":"Aggregated stats for buckets updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsDelete":{"type":"array","description":"Aggregated stats for buckets deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesStorage","tagsStorage","filesCount","bucketsCount","bucketsCreate","bucketsRead","bucketsUpdate","bucketsDelete","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesStorage":{"type":"array","description":"Aggregated stats for total storage of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesStorage","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"functionsExecutions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsFailures":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsCompute":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","functionsExecutions","functionsFailures","functionsCompute"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","functions","documents","collections","users","storage"]}},"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.15.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":"HOSTNAME","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":52,"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":[]}]}},"\/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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":59,"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 at least 8 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":55,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":57,"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, Team Invites and Magic URL, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":58,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/phone":{"patch":{"summary":"Update Account Phone","operationId":"accountUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account phone number. After changing phone number, the user confirmation status will get reset. A new confirmation SMS is not sent automatically however you can use the phone confirmation endpoint again to send the confirmation SMS.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":60,"cookies":false,"type":"","demo":"account\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["number","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":53,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":61,"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":{},"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":66,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":67,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":54,"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":65,"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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":56,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to \"refresh\" the access token.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":64,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":63,"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 ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/status":{"patch":{"summary":"Update Account Status","operationId":"accountUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":62,"cookies":false,"type":"","demo":"account\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/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#accountUpdateEmailVerification). 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":68,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"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":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":69,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/verification\/phone":{"post":{"summary":"Create Phone Verification","operationId":"accountCreatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification message to your user's phone number to confirm they are the valid owners of that address. The provided secret should 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#accountUpdatePhoneVerification). The verification link sent to the user's phone number is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneVerification","weight":70,"cookies":false,"type":"","demo":"account\/create-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]},"put":{"summary":"Create Phone Verification (confirmation)","operationId":"accountUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":71,"cookies":false,"type":"","demo":"account\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"avatarsGetBrowser","consumes":["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 [GET \/account\/sessions](\/docs\/client\/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":73,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":72,"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":76,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":74,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":75,"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. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":78,"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.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":77,"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 1 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":1,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/databases":{"get":{"summary":"List Databases","operationId":"databasesList","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Databases List","schema":{"$ref":"#\/definitions\/databaseList"}}},"x-appwrite":{"method":"list","weight":80,"cookies":false,"type":"","demo":"databases\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 Database","operationId":"databasesCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"create","weight":79,"cookies":false,"type":"","demo":"databases\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"databaseId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DATABASE_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["databaseId","name"]}}]}},"\/databases\/{databaseId}":{"get":{"summary":"Get Database","operationId":"databasesGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"get","weight":81,"cookies":false,"type":"","demo":"databases\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]},"put":{"summary":"Update Database","operationId":"databasesUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"update","weight":83,"cookies":false,"type":"","demo":"databases\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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]"}},"required":["name"]}}]},"delete":{"summary":"Delete Database","operationId":"databasesDelete","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":84,"cookies":false,"type":"","demo":"databases\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections":{"get":{"summary":"List Collections","operationId":"databasesListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":86,"cookies":false,"type":"","demo":"databases\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"databasesCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":85,"cookies":false,"type":"","demo":"databases\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[COLLECTION_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Specifies the permissions model used in this collection, which accepts either 'collection' or 'document'. For 'collection' level permission, the permissions specified in read and write params are applied to all documents in the collection. For 'document' level permissions, read and write permissions are specified in each document. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databasesGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"getCollection","weight":87,"cookies":false,"type":"","demo":"databases\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databasesUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":89,"cookies":false,"type":"","demo":"databases\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Collection","operationId":"databasesDeleteCollection","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteCollection","weight":90,"cookies":false,"type":"","demo":"databases\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databasesListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":99,"cookies":false,"type":"","demo":"databases\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databasesCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":98,"cookies":false,"type":"","demo":"databases\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databasesCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":92,"cookies":false,"type":"","demo":"databases\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databasesCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":93,"cookies":false,"type":"","demo":"databases\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 4096 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databasesCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":97,"cookies":false,"type":"","demo":"databases\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"number","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"number","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databasesCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":96,"cookies":false,"type":"","demo":"databases\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databasesCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":94,"cookies":false,"type":"","demo":"databases\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databasesCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":91,"cookies":false,"type":"","demo":"databases\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databasesCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":95,"cookies":false,"type":"","demo":"databases\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databasesGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":100,"cookies":false,"type":"","demo":"databases\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databasesDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":101,"cookies":false,"type":"","demo":"databases\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databasesListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":107,"cookies":false,"type":"","demo":"databases\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/database#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results. Maximum of 100 order attributes are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order. Maximum of 100 order types are allowed.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]},"post":{"summary":"Create Document","operationId":"databasesCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":106,"cookies":false,"type":"","demo":"databases\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","data"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databasesGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"getDocument","weight":108,"cookies":false,"type":"","demo":"databases\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databasesUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"updateDocument","weight":110,"cookies":false,"type":"","demo":"databases\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object. Include only attribute and value pairs to be updated.","default":[],"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete Document","operationId":"databasesDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":111,"cookies":false,"type":"","demo":"databases\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databasesListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":103,"cookies":false,"type":"","demo":"databases\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databasesCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":102,"cookies":false,"type":"","demo":"databases\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders. Maximum of 100 orders are allowed.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databasesGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":104,"cookies":false,"type":"","demo":"databases\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databasesDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":105,"cookies":false,"type":"","demo":"databases\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"functionsList","consumes":["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":212,"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":"Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":211,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[FUNCTION_ID]"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Function maximum execution time in seconds.","default":15,"x-example":1}},"required":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List runtimes","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active on your instance.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":213,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":214,"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 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":216,"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 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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Maximum execution time in seconds.","default":15,"x-example":1}},"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":218,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments":{"get":{"summary":"List Deployments","operationId":"functionsListDeployments","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code deployments. You can use the query params to filter your results.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"listDeployments","weight":220,"cookies":false,"type":"","demo":"functions\/list-deployments.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-deployments.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 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":"Maximum number of deployments to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 Deployment","operationId":"functionsCreateDeployment","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"createDeployment","weight":219,"cookies":false,"type":"","demo":"functions\/create-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"entrypoint","description":"Entrypoint File.","required":true,"type":"string","x-example":"[ENTRYPOINT]","in":"formData"},{"name":"code","description":"Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.","required":true,"type":"file","in":"formData"},{"name":"activate","description":"Automatically activate the deployment when it is finished building.","required":true,"type":"boolean","x-example":false,"in":"formData"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}":{"get":{"summary":"Get Deployment","operationId":"functionsGetDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code deployment by its unique ID.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"getDeployment","weight":221,"cookies":false,"type":"","demo":"functions\/get-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"patch":{"summary":"Update Function Deployment","operationId":"functionsUpdateDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateDeployment","weight":217,"cookies":false,"type":"","demo":"functions\/update-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"delete":{"summary":"Delete Deployment","operationId":"functionsDeleteDeployment","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code deployment by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDeployment","weight":222,"cookies":false,"type":"","demo":"functions\/delete-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":226,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":224,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":223,"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 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]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":225,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"healthGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":122,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":132,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":125,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":124,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":129,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":130,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":128,"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\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":127,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":131,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":126,"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":115,"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":119,"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":116,"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":117,"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":118,"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":120,"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":121,"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\/buckets":{"get":{"summary":"List buckets","operationId":"storageListBuckets","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the storage buckets. You can use the query params to filter your results.","responses":{"200":{"description":"Buckets List","schema":{"$ref":"#\/definitions\/bucketList"}}},"x-appwrite":{"method":"listBuckets","weight":166,"cookies":false,"type":"","demo":"storage\/list-buckets.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"cursor","description":"ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 bucket","operationId":"storageCreateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new storage bucket.","responses":{"201":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"createBucket","weight":165,"cookies":false,"type":"","demo":"storage\/create-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"bucketId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[BUCKET_ID]"},"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":30000000,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["bucketId","name","permission"]}}]}},"\/storage\/buckets\/{bucketId}":{"get":{"summary":"Get Bucket","operationId":"storageGetBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"getBucket","weight":167,"cookies":false,"type":"","demo":"storage\/get-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]},"put":{"summary":"Update Bucket","operationId":"storageUpdateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a storage bucket by its unique ID.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"updateBucket","weight":168,"cookies":false,"type":"","demo":"storage\/update-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":null,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Bucket","operationId":"storageDeleteBucket","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a storage bucket by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteBucket","weight":169,"cookies":false,"type":"","demo":"storage\/delete-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["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":171,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":170,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/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":172,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":176,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":177,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":174,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":173,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":175,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":181,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":180,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":182,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":183,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":184,"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 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":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":186,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":185,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"URL to redirect the user back to your app from the invitation email. 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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":187,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":188,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["roles"]}}]},"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteMembership","weight":190,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":189,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":193,"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":"Maximum number of users to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":192,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"usersGet","consumes":["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":194,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"usersDelete","consumes":["application\/json"],"produces":[],"tags":["users"],"description":"Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](\/docs\/server\/users#usersUpdateStatus) endpoint instead.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":209,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":204,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":198,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/users\/{userId}\/memberships":{"get":{"summary":"Get User Memberships","operationId":"usersGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user membership list by its unique ID.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":197,"cookies":false,"type":"","demo":"users\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-memberships.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":202,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":203,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/users\/{userId}\/phone":{"patch":{"summary":"Update Phone","operationId":"usersUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":205,"cookies":false,"type":"","demo":"users\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"User phone number.","default":null,"x-example":null}},"required":["number"]}}]}},"\/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":195,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"usersUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":206,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":196,"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 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":208,"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 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":207,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":199,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateEmailVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmailVerification","weight":200,"cookies":false,"type":"","demo":"users\/update-email-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}},"\/users\/{userId}\/verification\/phone":{"patch":{"summary":"Update Phone Verification","operationId":"usersUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":201,"cookies":false,"type":"","demo":"users\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"phoneVerification":{"type":"boolean","description":"User phone verification status.","default":null,"x-example":false}},"required":["phoneVerification"]}}]}}},"tags":[{"name":"account","description":"The Account service allows you to authenticate and manage a user account.","x-globalAttributes":[]},{"name":"avatars","description":"The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.","x-globalAttributes":[]},{"name":"databases","description":"The Databases service allows you to create structured collections of documents, query and filter lists of documents","x-globalAttributes":["databaseId"]},{"name":"locale","description":"The Locale service allows you to customize your app based on your users' location.","x-globalAttributes":[]},{"name":"health","description":"The Health service allows you to both validate and monitor your Appwrite server's health.","x-globalAttributes":[]},{"name":"projects","description":"The Project service allows you to manage all the projects in your Appwrite server.","x-globalAttributes":[]},{"name":"storage","description":"The Storage service allows you to manage your project files.","x-globalAttributes":[]},{"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","x-globalAttributes":[]},{"name":"users","description":"The Users service allows you to manage your project users.","x-globalAttributes":[]},{"name":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions.","x-globalAttributes":[]}],"definitions":{"documentList":{"description":"Documents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of documents documents that matched your query.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["total","documents"]},"collectionList":{"description":"Collections List","type":"object","properties":{"total":{"type":"integer","description":"Total number of collections documents that matched your query.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["total","collections"]},"databaseList":{"description":"Databases List","type":"object","properties":{"total":{"type":"integer","description":"Total number of databases documents that matched your query.","x-example":5,"format":"int32"},"databases":{"type":"array","description":"List of databases.","items":{"type":"object","$ref":"#\/definitions\/database"},"x-example":""}},"required":["total","databases"]},"indexList":{"description":"Indexes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of indexes documents that matched your query.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["total","indexes"]},"userList":{"description":"Users List","type":"object","properties":{"total":{"type":"integer","description":"Total number of users documents that matched your query.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["total","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of sessions documents that matched your query.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["total","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"total":{"type":"integer","description":"Total number of logs documents that matched your query.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["total","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"total":{"type":"integer","description":"Total number of files documents that matched your query.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["total","files"]},"bucketList":{"description":"Buckets List","type":"object","properties":{"total":{"type":"integer","description":"Total number of buckets documents that matched your query.","x-example":5,"format":"int32"},"buckets":{"type":"array","description":"List of buckets.","items":{"type":"object","$ref":"#\/definitions\/bucket"},"x-example":""}},"required":["total","buckets"]},"teamList":{"description":"Teams List","type":"object","properties":{"total":{"type":"integer","description":"Total number of teams documents that matched your query.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["total","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"total":{"type":"integer","description":"Total number of memberships documents that matched your query.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["total","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of functions documents that matched your query.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["total","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of runtimes documents that matched your query.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["total","runtimes"]},"deploymentList":{"description":"Deployments List","type":"object","properties":{"total":{"type":"integer","description":"Total number of deployments documents that matched your query.","x-example":5,"format":"int32"},"deployments":{"type":"array","description":"List of deployments.","items":{"type":"object","$ref":"#\/definitions\/deployment"},"x-example":""}},"required":["total","deployments"]},"executionList":{"description":"Executions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of executions documents that matched your query.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["total","executions"]},"countryList":{"description":"Countries List","type":"object","properties":{"total":{"type":"integer","description":"Total number of countries documents that matched your query.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["total","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of continents documents that matched your query.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["total","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"total":{"type":"integer","description":"Total number of languages documents that matched your query.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["total","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"total":{"type":"integer","description":"Total number of currencies documents that matched your query.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["total","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"total":{"type":"integer","description":"Total number of phones documents that matched your query.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["total","phones"]},"database":{"description":"Database","type":"object","properties":{"$id":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Database name.","x-example":"My Database"}},"required":["$id","name"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Collection update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"databaseId":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$createdAt","$updatedAt","$read","$write","databaseId","name","enabled","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of attributes in the given collection.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["total","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"integer","description":"Attribute size.","x-example":128,"format":"int32"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"count"},"type":{"type":"string","description":"Attribute type.","x-example":"integer"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"percentageCompleted"},"type":{"type":"string","description":"Attribute type.","x-example":"double"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"isEnabled"},"type":{"type":"string","description":"Attribute type.","x-example":"boolean"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"userEmail"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"status"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"ipAddress"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"githubUrl"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":"primary"},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$createdAt":{"type":"integer","description":"Document creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Document update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$createdAt","$updatedAt","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"User creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"User update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"phone":{"type":"string","description":"User phone number in E.164 format.","x-example":"+4930901820"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"phoneVerification":{"type":"boolean","description":"Phone verification status.","x-example":true},"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","$createdAt","$updatedAt","name","registration","status","passwordUpdate","email","phone","emailVerification","phoneVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Session creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"integer","description":"Date, the Unix timestamp of when the access token expires.","x-example":1592981250,"format":"int32"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","$createdAt","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"$createdAt":{"type":"integer","description":"Token creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"File update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"signature":{"type":"string","description":"File MD5 signature.","x-example":"5d529fd02b544198ae075bd57c1762bb"},"mimeType":{"type":"string","description":"File mime type.","x-example":"image\/png"},"sizeOriginal":{"type":"integer","description":"File original size in bytes.","x-example":17890,"format":"int32"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$createdAt","$updatedAt","$read","$write","name","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"bucket":{"description":"Bucket","type":"object","properties":{"$id":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Bucket creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Bucket update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":["role:all"]},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":["user:608f9da25e7e1"]},"permission":{"type":"string","description":"Bucket permission model. Possible values: `bucket` or `file`","x-example":"file"},"name":{"type":"string","description":"Bucket name.","x-example":"Documents"},"enabled":{"type":"boolean","description":"Bucket enabled.","x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size supported.","x-example":100,"format":"int32"},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions.","items":{"type":"string"},"x-example":["jpg","png"]},"encryption":{"type":"boolean","description":"Bucket is encrypted.","x-example":false},"antivirus":{"type":"boolean","description":"Virus scanning is enabled.","x-example":false}},"required":["$id","$createdAt","$updatedAt","$read","$write","permission","name","enabled","maximumFileSize","allowedFileExtensions","encryption","antivirus"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Team update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"total":{"type":"integer","description":"Total number of team members.","x-example":7,"format":"int32"}},"required":["$id","$createdAt","$updatedAt","name","total"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Membership creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Membership update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"userName":{"type":"string","description":"User name.","x-example":"John Doe"},"userEmail":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"teamName":{"type":"string","description":"Team name.","x-example":"VIP"},"invited":{"type":"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","$createdAt","$updatedAt","userId","userName","userEmail","teamId","teamName","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"execute":{"type":"array","description":"Execution permissions.","items":{"type":"string"},"x-example":"role:member"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"status":{"type":"string","description":"Function status. Possible values: `disabled`, `enabled`","x-example":"enabled"},"runtime":{"type":"string","description":"Function execution runtime.","x-example":"python-3.8"},"deployment":{"type":"string","description":"Function's active deployment ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"object","additionalProperties":true,"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","$createdAt","$updatedAt","execute","name","status","runtime","deployment","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"deployment":{"description":"Deployment","type":"object","properties":{"$id":{"type":"string","description":"Deployment ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Deployment creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Deployment update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"resourceId":{"type":"string","description":"Resource ID.","x-example":"5e5ea6g16897e"},"resourceType":{"type":"string","description":"Resource type.","x-example":"functions"},"entrypoint":{"type":"string","description":"The entrypoint file to use to execute the deployment code.","x-example":"enabled"},"size":{"type":"integer","description":"The code size in bytes.","x-example":128,"format":"int32"},"buildId":{"type":"string","description":"The current build ID.","x-example":"5e5ea5c16897e"},"activate":{"type":"boolean","description":"Whether the deployment should be automatically activated.","x-example":true},"status":{"type":"string","description":"The deployment status.","x-example":"enabled"},"buildStdout":{"type":"string","description":"The build stdout.","x-example":"enabled"},"buildStderr":{"type":"string","description":"The build stderr.","x-example":"enabled"}},"required":["$id","$createdAt","$updatedAt","resourceId","resourceType","entrypoint","size","buildId","activate","status","buildStdout","buildStderr"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Execution update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"response":{"type":"string","description":"The script response output string. Logs the last 4,000 characters of the execution response output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$createdAt","$updatedAt","$read","functionId","trigger","status","statusCode","response","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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file From 4563b71817a7881c3885007eebae0e8db764ff41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 27 Jun 2022 11:25:57 +0000 Subject: [PATCH 111/555] Fix web tests --- templates/web/src/services/template.ts.twig | 22 +++++---------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index 9d40d36cbd..d74e2d5635 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -1,5 +1,5 @@ import { Service } from '../service'; -import { {{ spec.title | caseUcfirst}}Exception } from '../client'; +import { {{ spec.title | caseUcfirst}}Exception, Client } from '../client'; import type { Models } from '../models'; import type { UploadProgress } from '../client'; @@ -10,29 +10,17 @@ type Payload = { export class {{ service.name | caseUcfirst }} extends Service { {% if service.globalParams | length %} {% for parameter in service.globalParams %} - {{ parameter.name | caseCamel | escapeKeyword }}; - /** - * Set {{ parameter.name }}. - * - * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} - * - * @return void - */ - set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}) + protected {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}; + public set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}): void { this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; } - /** - * Get {{ parameter.name }}. - * - * @return {{ parameter.type | typeName }} - */ - get{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}) + public get{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}): {{ parameter.type | typeName }} { return this.{{ parameter.name | caseCamel | escapeKeyword }}; } {% endfor %} - constructor(client, {% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + constructor(client: Client, {% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}:{{ parameter.type | typeName }}{% if not parameter.required %}|null = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) { super(client); From 6ec112a9503b0a10c228683015f386fdb5961fae Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Mon, 27 Jun 2022 22:00:34 +0200 Subject: [PATCH 112/555] fix: export realtimeevent on web --- templates/web/src/index.ts.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/web/src/index.ts.twig b/templates/web/src/index.ts.twig index b675a39f0b..cd650c94e5 100644 --- a/templates/web/src/index.ts.twig +++ b/templates/web/src/index.ts.twig @@ -2,5 +2,5 @@ export { Client, Query, {{spec.title | caseUcfirst}}Exception } from './client'; {% for service in spec.services %} export { {{service.name | caseUcfirst}} } from './services/{{service.name | caseDash}}'; {% endfor %} -export type { Models, Payload } from './client'; +export type { Models, Payload, RealtimeResponseEvent, UploadProgress } from './client'; export type { QueryTypes, QueryTypesList } from './query'; \ No newline at end of file From 7442a19d0970b357b2a66153786a1b6648b06c93 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 28 Jun 2022 12:08:37 +1200 Subject: [PATCH 113/555] Input file test fixes --- templates/swift/Sources/Client.swift.twig | 11 ++- tests/languages/swift-server/Tests.swift | 93 ++++++++++++----------- 2 files changed, 53 insertions(+), 51 deletions(-) diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index 77a7555c1b..745aec5511 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -342,7 +342,7 @@ open class Client { switch(input.sourceType) { case "path": - input.data = ByteBuffer(data: try! Data(contentsOf: URL(fileURLWithPath: FileManager.default.currentDirectoryPath + input.path))) + input.data = ByteBuffer(data: try! Data(contentsOf: URL(fileURLWithPath: input.path))) case "data": input.data = ByteBuffer(data: input.data as! Data) default: @@ -352,6 +352,7 @@ open class Client { let size = (input.data as! ByteBuffer).readableBytes if size < Client.chunkSize { + params[paramName] = input return try await call( method: "POST", path: path, @@ -377,13 +378,11 @@ open class Client { offset = min(size, (chunksUploaded * Client.chunkSize)) } - let cachedInput = input - while offset < size { - input.data = (cachedInput.data as! ByteBuffer).getSlice(at: offset, length: Client.chunkSize) - ?? (cachedInput.data as! ByteBuffer).getSlice(at: offset, length: Int(size - offset)) + let slice = (input.data as! ByteBuffer).getSlice(at: offset, length: Client.chunkSize) + ?? (input.data as! ByteBuffer).getSlice(at: offset, length: Int(size - offset)) - params[paramName] = input + params[paramName] = InputFile.fromBuffer(slice!, filename: input.filename, mimeType: input.mimeType) headers["content-range"] = "bytes \(offset)-\(min((offset + Client.chunkSize) - 1, size))/\(size)" result = try await call( diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index 231a84504e..a5782e2329 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -75,50 +75,53 @@ class Tests: XCTestCase { } catch let error as AppwriteError { print(error.message) } -// do { -// var file = InputFile.fromPath("\(FileManager.default.currentDirectoryPath)/../../resources/large_file.mp4") -// mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) -// print(mock.result) -// } catch let error as AppwriteError { -// print(error.message) -// } -// do { -// var url = URL(fileURLWithPath: "\(FileManager.default.currentDirectoryPath)/../../resources/file.png") -// var buffer = ByteBuffer(data: try! Data(contentsOf: url)) -// var file = InputFile.fromBuffer(buffer, filename: "file.png", mimeType: "image/png") -// mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) -// print(mock.result) -// } catch let error as AppwriteError { -// print(error.message) -// } -// do { -// var url = URL(fileURLWithPath: "\(FileManager.default.currentDirectoryPath)/../../resources/large_file.mp4") -// var buffer = ByteBuffer(data: try! Data(contentsOf: url)) -// var file = InputFile.fromBuffer(buffer, filename: "large_file.mp4", mimeType: "video/mp4") -// mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) -// print(mock.result) -// } catch let error as AppwriteError { -// print(error.message) -// } -// -// do { -// try await general.error400() -// } catch let error as AppwriteError { -// print(error.message) -// } -// -// do { -// try await general.error500() -// } catch { -// print(error.localizedDescription) -// } -// -// do { -// try await general.error502() -// } catch { -// print(String(describing: error)) -// } -// -// try! await general.empty() + + do { + var file = InputFile.fromPath("\(FileManager.default.currentDirectoryPath)/../../resources/large_file.mp4") + mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) + print(mock.result) + } catch let error as AppwriteError { + print(error.message) + } + + do { + var url = URL(fileURLWithPath: "\(FileManager.default.currentDirectoryPath)/../../resources/file.png") + var buffer = ByteBuffer(data: try! Data(contentsOf: url)) + var file = InputFile.fromBuffer(buffer, filename: "file.png", mimeType: "image/png") + mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) + print(mock.result) + } catch let error as AppwriteError { + print(error.message) + } + + do { + var url = URL(fileURLWithPath: "\(FileManager.default.currentDirectoryPath)/../../resources/large_file.mp4") + var buffer = ByteBuffer(data: try! Data(contentsOf: url)) + var file = InputFile.fromBuffer(buffer, filename: "large_file.mp4", mimeType: "video/mp4") + mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) + print(mock.result) + } catch let error as AppwriteError { + print(error.message) + } + + do { + try await general.error400() + } catch let error as AppwriteError { + print(error.message) + } + + do { + try await general.error500() + } catch { + print(error.localizedDescription) + } + + do { + try await general.error502() + } catch { + print(String(describing: error)) + } + + try! await general.empty() } } From b64604c3e3df9dfac5f44804955275d8aac444df Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 28 Jun 2022 13:01:29 +1200 Subject: [PATCH 114/555] Update client tests --- tests/SwiftClient55Test.php | 2 ++ tests/languages/swift-client/Tests.swift | 44 ++++++++++++++++++------ 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/tests/SwiftClient55Test.php b/tests/SwiftClient55Test.php index 8dee28bd8d..d2557ea9e7 100644 --- a/tests/SwiftClient55Test.php +++ b/tests/SwiftClient55Test.php @@ -18,6 +18,8 @@ class SwiftClient55Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/swift-client/Tests.swift index bbee6d6af1..6af0d6b0f1 100644 --- a/tests/languages/swift-client/Tests.swift +++ b/tests/languages/swift-client/Tests.swift @@ -78,17 +78,41 @@ class Tests: XCTestCase { let result = try await general.redirect() print((result as! [String: Any])["result"] as! String) - var url = URL(fileURLWithPath: "\(FileManager.default.currentDirectoryPath)/../../resources/file.png") - var buffer = ByteBuffer(data: try! Data(contentsOf: url)) - var file = File(name: "file.png", buffer: buffer) - mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) - print(mock.result) + do { + var file = InputFile.fromPath("\(FileManager.default.currentDirectoryPath)/../../resources/file.png") + mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) + print(mock.result) + } catch let error as AppwriteError { + print(error.message) + } + + do { + var file = InputFile.fromPath("\(FileManager.default.currentDirectoryPath)/../../resources/large_file.mp4") + mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) + print(mock.result) + } catch let error as AppwriteError { + print(error.message) + } - url = URL(fileURLWithPath: "\(FileManager.default.currentDirectoryPath)/../../resources/large_file.mp4") - buffer = ByteBuffer(data: try! Data(contentsOf: url)) - file = File(name: "large_file.mp4", buffer: buffer) - mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) - print(mock.result) + do { + var url = URL(fileURLWithPath: "\(FileManager.default.currentDirectoryPath)/../../resources/file.png") + var buffer = ByteBuffer(data: try! Data(contentsOf: url)) + var file = InputFile.fromBuffer(buffer, filename: "file.png", mimeType: "image/png") + mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) + print(mock.result) + } catch let error as AppwriteError { + print(error.message) + } + + do { + var url = URL(fileURLWithPath: "\(FileManager.default.currentDirectoryPath)/../../resources/large_file.mp4") + var buffer = ByteBuffer(data: try! Data(contentsOf: url)) + var file = InputFile.fromBuffer(buffer, filename: "large_file.mp4", mimeType: "video/mp4") + mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) + print(mock.result) + } catch let error as AppwriteError { + print(error.message) + } do { try await general.error400() From 799dd0367073d65ec33b4c6f7b345ccd3358d2bd Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 28 Jun 2022 01:15:09 +0000 Subject: [PATCH 115/555] fix response model issues --- templates/dart/base/requests/api.twig | 2 +- templates/dart/base/requests/file.twig | 2 +- templates/flutter/base/requests/api.twig | 2 +- templates/flutter/base/requests/file.twig | 2 +- templates/flutter/lib/services/service.dart.twig | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/dart/base/requests/api.twig b/templates/dart/base/requests/api.twig index 25f617c79c..151872bfef 100644 --- a/templates/dart/base/requests/api.twig +++ b/templates/dart/base/requests/api.twig @@ -10,4 +10,4 @@ final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); - return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst}}.fromMap(res.data){% else %} res.data{% endif %}; + return {% if method.responseModel and method.responseModel != 'any' %}models.{{{method.responseModel | caseUcfirst | overrideIdentifier}}.fromMap(res.data){% else %} res.data{% endif %}; diff --git a/templates/dart/base/requests/file.twig b/templates/dart/base/requests/file.twig index c551210b19..97d3bcf1a3 100644 --- a/templates/dart/base/requests/file.twig +++ b/templates/dart/base/requests/file.twig @@ -27,5 +27,5 @@ onProgress: onProgress, ); - return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst}}.fromMap(res.data){% else %} res.data{% endif %}; + return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst | overrideIdentifier}}.fromMap(res.data){% else %} res.data{% endif %}; {% endif %} diff --git a/templates/flutter/base/requests/api.twig b/templates/flutter/base/requests/api.twig index b3e5dd8190..44229d7202 100644 --- a/templates/flutter/base/requests/api.twig +++ b/templates/flutter/base/requests/api.twig @@ -10,4 +10,4 @@ final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); - return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst}}.fromMap(res.data){% else %} res.data{% endif %}; + return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst | overrideIdentifier}}.fromMap(res.data){% else %} res.data{% endif %}; diff --git a/templates/flutter/base/requests/file.twig b/templates/flutter/base/requests/file.twig index 6afe2d056e..bc41436c01 100644 --- a/templates/flutter/base/requests/file.twig +++ b/templates/flutter/base/requests/file.twig @@ -27,5 +27,5 @@ onProgress: onProgress, ); - return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst}}.fromMap(res.data){% else %} res.data{% endif %}; + return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst | overrideIdentifier}}.fromMap(res.data){% else %} res.data{% endif %}; {% endif %} diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index 20f19dc699..2da2fe3165 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -25,7 +25,7 @@ class {{ service.name | caseUcfirst }} extends Service { {{ method.description|dartComment }} /// {% endif %} - {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all | filter((param) => not param.isGlobal), method.consumes) }}) async { + {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all | filter((param) => not param.isGlobal), method.consumes) }}) async { {% if method.parameters.path | length > 0 %}final{% else %}const{% endif %} String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | overrideIdentifier }}){% endfor %}; {% if 'multipart/form-data' in method.consumes %} From 64f438953ae68894c9f817b6ea6b3a4079ccf2c2 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 28 Jun 2022 01:26:27 +0000 Subject: [PATCH 116/555] fix more overrides --- src/SDK/Language/Dart.php | 2 +- templates/dart/base/utils.twig | 2 +- templates/dart/lib/services/service.dart.twig | 2 +- templates/flutter/base/utils.twig | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index 49eacb8973..f83474de02 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -112,7 +112,7 @@ public function getKeywords() */ public function getIdentifierOverrides() { - return ['Function' => 'Func', 'default' => 'xdefault', 'required' => 'xrequired']; + return ['Function' => 'Func', 'default' => 'xdefault', 'required' => 'xrequired', 'async' => 'xasync']; } /** diff --git a/templates/dart/base/utils.twig b/templates/dart/base/utils.twig index 47e2517be4..8d58c497f6 100644 --- a/templates/dart/base/utils.twig +++ b/templates/dart/base/utils.twig @@ -1,6 +1,6 @@ {% macro map_parameter(parameters) %} {% for parameter in parameters %} -'{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, +'{{ parameter.name }}': {{ parameter.name | caseCamel | overrideIdentifier }}, {% endfor %} {% endmacro %} diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index 59225e0812..b0bc553e23 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -26,7 +26,7 @@ class {{ service.name | caseUcfirst }} extends Service { /// {% endif %} {% if method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all | filter((param) => not param.isGlobal), method.consumes) }}) async { - final String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; + final String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | overrideIdentifier }}){% endfor %}; {% if 'multipart/form-data' in method.consumes %} {{ include('dart/base/requests/file.twig') }} diff --git a/templates/flutter/base/utils.twig b/templates/flutter/base/utils.twig index 331cc931f6..cfd3c8e727 100644 --- a/templates/flutter/base/utils.twig +++ b/templates/flutter/base/utils.twig @@ -1,6 +1,6 @@ {% macro map_parameter(parameters) %} {% for parameter in parameters %} -'{{ parameter.name }}': {{ parameter.name | caseCamel | escapeKeyword }}, +'{{ parameter.name }}': {{ parameter.name | caseCamel | overrideIdentifier }}, {% endfor %} {% endmacro %} From 63412a29c391df4a99532fbe06172d2c75b604ea Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 28 Jun 2022 18:53:47 +1200 Subject: [PATCH 117/555] Fix ruby input file --- templates/ruby/lib/container/client.rb.twig | 20 ++++++----- .../ruby/lib/container/input_file.rb.twig | 15 ++++---- tests/Ruby27Test.php | 2 ++ tests/Ruby30Test.php | 1 - tests/Ruby31Test.php | 2 ++ tests/languages/ruby/tests.rb | 36 +++++++++++++------ 6 files changed, 51 insertions(+), 25 deletions(-) diff --git a/templates/ruby/lib/container/client.rb.twig b/templates/ruby/lib/container/client.rb.twig index e76792df38..e09b2922f5 100644 --- a/templates/ruby/lib/container/client.rb.twig +++ b/templates/ruby/lib/container/client.rb.twig @@ -109,7 +109,7 @@ module {{ spec.title | caseUcfirst }} case input_file.source_type when 'path' size = ::File.size(input_file.path) - when 'bytes' + when 'string' size = input_file.data.bytesize end @@ -117,7 +117,7 @@ module {{ spec.title | caseUcfirst }} if input_file.source_type == 'path' input_file.data = IO.read(input_file.path) end - params[param_name] = input_file + params[param_name.to_sym] = input_file return call( method: 'POST', path: path, @@ -141,16 +141,20 @@ module {{ spec.title | caseUcfirst }} offset = [size, (chunks_uploaded * @chunk_size)].min end - cached_input = input_file - while offset < size case input_file.source_type when 'path' - input_file.data = IO.read(input_file.path, @chunk_size, offset) - when 'bytes' - input_file.data = cached_input.data.slice(offset, @chunk_size) + string = IO.read(input_file.path, @chunk_size, offset) + when 'string' + string = input_file.data.byteslice(offset, [@chunk_size, size - offset].min) end - params[param_name] = input_file + + params[param_name.to_sym] = InputFile::from_string( + string, + filename: input_file.filename, + mime_type: input_file.mime_type + ) + headers['content-range'] = "bytes #{offset}-#{[offset + @chunk_size - 1, size].min}/#{size}" result = call( diff --git a/templates/ruby/lib/container/input_file.rb.twig b/templates/ruby/lib/container/input_file.rb.twig index db5ceaa13b..2d8afe8022 100644 --- a/templates/ruby/lib/container/input_file.rb.twig +++ b/templates/ruby/lib/container/input_file.rb.twig @@ -6,25 +6,28 @@ module {{spec.title | caseUcfirst}} attr_accessor :filename attr_accessor :mime_type attr_accessor :source_type - attr_accessor :data - def self.fromPath(path) + def self.from_path(path) instance = InputFile.new instance.path = path instance.filename = ::File.basename(path) - instance.mime_type = MIME::Types.type_for(path) + instance.mime_type = MIME::Types.type_for(path).first.content_type instance.source_type = 'path' instance end - def self.fromBytes(bytes, filename: nil, mime_type: nil) + def self.from_string(string, filename: nil, mime_type: nil) instance = InputFile.new - instance.data = bytes + instance.data = string instance.filename = filename instance.mime_type = mime_type - instance.source_type = 'bytes' + instance.source_type = 'string' instance end + + def self.from_bytes(bytes, filename: nil, mime_type: nil) + self.from_string(bytes.pack('C*'), filename: filename, mime_type: mime_type) + end end end \ No newline at end of file diff --git a/tests/Ruby27Test.php b/tests/Ruby27Test.php index a23a27e5ad..86898a1cc1 100644 --- a/tests/Ruby27Test.php +++ b/tests/Ruby27Test.php @@ -17,6 +17,8 @@ class Ruby27Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES ]; } diff --git a/tests/Ruby30Test.php b/tests/Ruby30Test.php index c589d1d012..c954b102a7 100644 --- a/tests/Ruby30Test.php +++ b/tests/Ruby30Test.php @@ -19,7 +19,6 @@ class Ruby30Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, - ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES ]; } diff --git a/tests/Ruby31Test.php b/tests/Ruby31Test.php index 17c12bbf22..0b3223b168 100644 --- a/tests/Ruby31Test.php +++ b/tests/Ruby31Test.php @@ -17,6 +17,8 @@ class Ruby31Test extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, + ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES ]; } diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index 2c837ff4dd..426ff30242 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -49,19 +49,35 @@ response = general.redirect() puts response["result"] -response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.fromPath('./tests/resources/file.png')) -puts response.result +begin + response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.from_path('./tests/resources/file.png')) + puts response.result +rescue => e + puts e +end -response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.fromPath('./tests/resources/large_file.mp4')) -puts response.result +begin + response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.from_path('./tests/resources/large_file.mp4')) + puts response.result +rescue => e + puts e +end -data = IO.read('./tests/resources/file.png') -response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.fromBytes(data, filename:'file.png', mime_type: 'image/png')) -puts response.result +begin + string = IO.read('./tests/resources/file.png') + response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.from_string(string, filename:'file.png', mime_type: 'image/png')) + puts response.result +rescue => e + puts e +end -data = IO.read('./tests/resources/large_file.mp4') -response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.fromBytes(data, filename:'large_file.mp4', mime_type: 'video/mp4')) -puts response.result +begin + string = IO.read('./tests/resources/large_file.mp4') + response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.from_string(string, filename:'large_file.mp4', mime_type: 'video/mp4')) + puts response.result +rescue => e + puts e +end begin general.error400() From 561d3c5edeb84b3ff06bee2a6e087eaedb38119b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 28 Jun 2022 19:29:10 +1200 Subject: [PATCH 118/555] Service level params for Kotlin --- .../appwrite/services/ServiceTemplate.kt.twig | 21 ++++++++++++++++--- tests/languages/kotlin/ServiceTest.kt | 12 +++++------ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index d8d9662344..cf8997519f 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -1,6 +1,6 @@ {% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter.type | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} {% macro method_parameters(parameters, consumes) %} -{% if parameters.all|length > 0 %}{% for parameter in parameters.all %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} +{% if parameters.all|length > 0 %}{% for parameter in parameters.all | filter((param) => not param.isGlobal) %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} {% endmacro %} {% macro methodNeedsSecurityParameters(method) %} {% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} @@ -24,7 +24,22 @@ import okhttp3.HttpUrl.Companion.toHttpUrl {% endif %} import java.io.File -class {{ service.name | caseUcfirst }}(client: Client) : Service(client) { +class {{ service.name | caseUcfirst }} : Service { + +{% if service.globalParams | length %} +{% for parameter in service.globalParams %} + val {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | overrideIdentifier }}{% if not parameter.required %}?{% endif %} + +{% endfor %} + + public constructor(client: Client,{% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | overrideIdentifier }}{% if not parameter.required %}? = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) : super(client) { +{% for parameter in service.globalParams %} + this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }} +{% endfor %} + } +{% else %} + public constructor (client: Client) : super(client) { } +{% endif %} {% for method in service.methods %} /** @@ -34,7 +49,7 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) { {{ method.description|comment1 }} * {% endif %} -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} * @param {{ parameter.name | caseCamel }} {{ parameter.description }} {% endfor %} * {% if method.type != "webAuth" %}@return [{{ _self.resultType(sdk.namespace, method) }}]{% endif %} diff --git a/tests/languages/kotlin/ServiceTest.kt b/tests/languages/kotlin/ServiceTest.kt index dd39b397fa..3b1e4db407 100644 --- a/tests/languages/kotlin/ServiceTest.kt +++ b/tests/languages/kotlin/ServiceTest.kt @@ -34,22 +34,22 @@ class ServiceTest { val client = Client() .addHeader("Origin", "http://localhost") .setSelfSigned(true) - val foo = Foo(client) + val foo = Foo(client, "string") val bar = Bar(client) val general = General(client) runBlocking { var mock: Mock // Foo Tests - mock = foo.get("string", 123, listOf("string in array")) + mock = foo.get(123, listOf("string in array")) writeToFile(mock.result) - mock = foo.post("string", 123, listOf("string in array")) + mock = foo.post(123, listOf("string in array")) writeToFile(mock.result) - mock = foo.put("string", 123, listOf("string in array")) + mock = foo.put(123, listOf("string in array")) writeToFile(mock.result) - mock = foo.patch("string", 123, listOf("string in array")) + mock = foo.patch(123, listOf("string in array")) writeToFile(mock.result) - mock = foo.delete("string", 123, listOf("string in array")) + mock = foo.delete(123, listOf("string in array")) writeToFile(mock.result) // Bar Tests From f2d7e6cc7ba0da67cc57edf6d009cf485f5f7ba5 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 28 Jun 2022 19:29:21 +1200 Subject: [PATCH 119/555] Service level params for Android --- .../appwrite/services/ServiceTemplate.kt.twig | 21 ++++++++++++++++--- tests/languages/android/ServiceTest.kt | 12 +++++------ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index ffa18dfa6a..ab2d8c22d4 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -1,6 +1,6 @@ {% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter.type | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} {% macro method_parameters(parameters, consumes) %} -{% if parameters.all|length > 0 %}{% for parameter in parameters.all %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} +{% if parameters.all|length > 0 %}{% for parameter in parameters.all | filter((param) => not param.isGlobal) %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} {% endmacro %} {% macro methodNeedsSecurityParameters(method) %} {% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} @@ -26,7 +26,22 @@ import okhttp3.HttpUrl.Companion.toHttpUrl {% endif %} import java.io.File -class {{ service.name | caseUcfirst }}(client: Client) : Service(client) { +class {{ service.name | caseUcfirst }} : Service { + +{% if service.globalParams | length %} +{% for parameter in service.globalParams %} + val {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | overrideIdentifier }}{% if not parameter.required %}?{% endif %} + +{% endfor %} + + public constructor(client: Client,{% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | overrideIdentifier }}{% if not parameter.required %}? = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) : super(client) { +{% for parameter in service.globalParams %} + this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }} +{% endfor %} + } +{% else %} + public constructor (client: Client) : super(client) { } +{% endif %} {% for method in service.methods %} /** @@ -36,7 +51,7 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) { {{ method.description|comment1 }} * {% endif %} -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} * @param {{ parameter.name | caseCamel }} {{ parameter.description }} {% endfor %} * {% if method.type != "webAuth" %}@return [{{ _self.resultType(sdk.namespace, method) }}]{% endif %} diff --git a/tests/languages/android/ServiceTest.kt b/tests/languages/android/ServiceTest.kt index 505f9fe3d2..aed407cf25 100644 --- a/tests/languages/android/ServiceTest.kt +++ b/tests/languages/android/ServiceTest.kt @@ -59,7 +59,7 @@ class ServiceTest { .setProject("console") .addHeader("Origin", "http://localhost") .setSelfSigned(true) - val foo = Foo(client) + val foo = Foo(client, "string") val bar = Bar(client) val general = General(client) val realtime = Realtime(client) @@ -72,15 +72,15 @@ class ServiceTest { runBlocking { var mock: Mock // Foo Tests - mock = foo.get("string", 123, listOf("string in array")) + mock = foo.get(123, listOf("string in array")) writeToFile(mock.result) - mock = foo.post("string", 123, listOf("string in array")) + mock = foo.post(123, listOf("string in array")) writeToFile(mock.result) - mock = foo.put("string", 123, listOf("string in array")) + mock = foo.put(123, listOf("string in array")) writeToFile(mock.result) - mock = foo.patch("string", 123, listOf("string in array")) + mock = foo.patch(123, listOf("string in array")) writeToFile(mock.result) - mock = foo.delete("string", 123, listOf("string in array")) + mock = foo.delete(123, listOf("string in array")) writeToFile(mock.result) // Bar Tests From c3f198ffe0c0f6e987cb574f6c656125cc9adc10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 28 Jun 2022 07:49:40 +0000 Subject: [PATCH 120/555] Update example specs file --- specs/swagger2-latest-console.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/swagger2-latest-console.json b/specs/swagger2-latest-console.json index 54afe0ccf1..bf56610532 100644 --- a/specs/swagger2-latest-console.json +++ b/specs/swagger2-latest-console.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"version":"0.15.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":"HOSTNAME","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":52,"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":[]}]}},"\/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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":59,"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 at least 8 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":55,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":57,"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, Team Invites and Magic URL, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":58,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/phone":{"patch":{"summary":"Update Account Phone","operationId":"accountUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account phone number. After changing phone number, the user confirmation status will get reset. A new confirmation SMS is not sent automatically however you can use the phone confirmation endpoint again to send the confirmation SMS.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":60,"cookies":false,"type":"","demo":"account\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["number","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":53,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":61,"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":{},"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":66,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":67,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":54,"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":65,"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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":56,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to \"refresh\" the access token.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":64,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":63,"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 ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/status":{"patch":{"summary":"Update Account Status","operationId":"accountUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":62,"cookies":false,"type":"","demo":"account\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/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#accountUpdateEmailVerification). 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":68,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"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":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":69,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/verification\/phone":{"post":{"summary":"Create Phone Verification","operationId":"accountCreatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification message to your user's phone number to confirm they are the valid owners of that address. The provided secret should 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#accountUpdatePhoneVerification). The verification link sent to the user's phone number is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneVerification","weight":70,"cookies":false,"type":"","demo":"account\/create-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]},"put":{"summary":"Create Phone Verification (confirmation)","operationId":"accountUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":71,"cookies":false,"type":"","demo":"account\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"avatarsGetBrowser","consumes":["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 [GET \/account\/sessions](\/docs\/client\/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":73,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":72,"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":76,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":74,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":75,"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. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":78,"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.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":77,"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 1 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":1,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/databases":{"get":{"summary":"List Databases","operationId":"databasesList","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Databases List","schema":{"$ref":"#\/definitions\/databaseList"}}},"x-appwrite":{"method":"list","weight":80,"cookies":false,"type":"","demo":"databases\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 Database","operationId":"databasesCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"create","weight":79,"cookies":false,"type":"","demo":"databases\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"databaseId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DATABASE_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["databaseId","name"]}}]}},"\/databases\/{databaseId}":{"get":{"summary":"Get Database","operationId":"databasesGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"get","weight":81,"cookies":false,"type":"","demo":"databases\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]},"put":{"summary":"Update Database","operationId":"databasesUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"update","weight":83,"cookies":false,"type":"","demo":"databases\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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]"}},"required":["name"]}}]},"delete":{"summary":"Delete Database","operationId":"databasesDelete","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":84,"cookies":false,"type":"","demo":"databases\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections":{"get":{"summary":"List Collections","operationId":"databasesListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":86,"cookies":false,"type":"","demo":"databases\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"databasesCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":85,"cookies":false,"type":"","demo":"databases\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[COLLECTION_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Specifies the permissions model used in this collection, which accepts either 'collection' or 'document'. For 'collection' level permission, the permissions specified in read and write params are applied to all documents in the collection. For 'document' level permissions, read and write permissions are specified in each document. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databasesGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"getCollection","weight":87,"cookies":false,"type":"","demo":"databases\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databasesUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":89,"cookies":false,"type":"","demo":"databases\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Collection","operationId":"databasesDeleteCollection","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteCollection","weight":90,"cookies":false,"type":"","demo":"databases\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databasesListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":99,"cookies":false,"type":"","demo":"databases\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databasesCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":98,"cookies":false,"type":"","demo":"databases\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databasesCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":92,"cookies":false,"type":"","demo":"databases\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databasesCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":93,"cookies":false,"type":"","demo":"databases\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 4096 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databasesCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":97,"cookies":false,"type":"","demo":"databases\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"number","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"number","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databasesCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":96,"cookies":false,"type":"","demo":"databases\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databasesCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":94,"cookies":false,"type":"","demo":"databases\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databasesCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":91,"cookies":false,"type":"","demo":"databases\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databasesCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":95,"cookies":false,"type":"","demo":"databases\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databasesGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":100,"cookies":false,"type":"","demo":"databases\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databasesDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":101,"cookies":false,"type":"","demo":"databases\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databasesListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":107,"cookies":false,"type":"","demo":"databases\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/database#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results. Maximum of 100 order attributes are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order. Maximum of 100 order types are allowed.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]},"post":{"summary":"Create Document","operationId":"databasesCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":106,"cookies":false,"type":"","demo":"databases\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","data"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databasesGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"getDocument","weight":108,"cookies":false,"type":"","demo":"databases\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databasesUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"updateDocument","weight":110,"cookies":false,"type":"","demo":"databases\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object. Include only attribute and value pairs to be updated.","default":[],"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete Document","operationId":"databasesDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":111,"cookies":false,"type":"","demo":"databases\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databasesListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":103,"cookies":false,"type":"","demo":"databases\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databasesCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":102,"cookies":false,"type":"","demo":"databases\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders. Maximum of 100 orders are allowed.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databasesGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":104,"cookies":false,"type":"","demo":"databases\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databasesDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":105,"cookies":false,"type":"","demo":"databases\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"functionsList","consumes":["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":212,"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":"Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":211,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[FUNCTION_ID]"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Function maximum execution time in seconds.","default":15,"x-example":1}},"required":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List runtimes","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active on your instance.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":213,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":214,"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 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":216,"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 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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Maximum execution time in seconds.","default":15,"x-example":1}},"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":218,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments":{"get":{"summary":"List Deployments","operationId":"functionsListDeployments","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code deployments. You can use the query params to filter your results.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"listDeployments","weight":220,"cookies":false,"type":"","demo":"functions\/list-deployments.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-deployments.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 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":"Maximum number of deployments to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 Deployment","operationId":"functionsCreateDeployment","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"createDeployment","weight":219,"cookies":false,"type":"","demo":"functions\/create-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"entrypoint","description":"Entrypoint File.","required":true,"type":"string","x-example":"[ENTRYPOINT]","in":"formData"},{"name":"code","description":"Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.","required":true,"type":"file","in":"formData"},{"name":"activate","description":"Automatically activate the deployment when it is finished building.","required":true,"type":"boolean","x-example":false,"in":"formData"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}":{"get":{"summary":"Get Deployment","operationId":"functionsGetDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code deployment by its unique ID.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"getDeployment","weight":221,"cookies":false,"type":"","demo":"functions\/get-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"patch":{"summary":"Update Function Deployment","operationId":"functionsUpdateDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateDeployment","weight":217,"cookies":false,"type":"","demo":"functions\/update-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"delete":{"summary":"Delete Deployment","operationId":"functionsDeleteDeployment","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code deployment by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDeployment","weight":222,"cookies":false,"type":"","demo":"functions\/delete-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":226,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":224,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":223,"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 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]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":225,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"healthGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":122,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":132,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":125,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":124,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":129,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":130,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":128,"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\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":127,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":131,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":126,"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":115,"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":119,"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":116,"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":117,"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":118,"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":120,"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":121,"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\/buckets":{"get":{"summary":"List buckets","operationId":"storageListBuckets","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the storage buckets. You can use the query params to filter your results.","responses":{"200":{"description":"Buckets List","schema":{"$ref":"#\/definitions\/bucketList"}}},"x-appwrite":{"method":"listBuckets","weight":166,"cookies":false,"type":"","demo":"storage\/list-buckets.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"cursor","description":"ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 bucket","operationId":"storageCreateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new storage bucket.","responses":{"201":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"createBucket","weight":165,"cookies":false,"type":"","demo":"storage\/create-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"bucketId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[BUCKET_ID]"},"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":30000000,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["bucketId","name","permission"]}}]}},"\/storage\/buckets\/{bucketId}":{"get":{"summary":"Get Bucket","operationId":"storageGetBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"getBucket","weight":167,"cookies":false,"type":"","demo":"storage\/get-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]},"put":{"summary":"Update Bucket","operationId":"storageUpdateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a storage bucket by its unique ID.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"updateBucket","weight":168,"cookies":false,"type":"","demo":"storage\/update-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":null,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Bucket","operationId":"storageDeleteBucket","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a storage bucket by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteBucket","weight":169,"cookies":false,"type":"","demo":"storage\/delete-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["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":171,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":170,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/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":172,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":176,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":177,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":174,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":173,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":175,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":181,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":180,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":182,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":183,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":184,"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 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":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":186,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":185,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"URL to redirect the user back to your app from the invitation email. 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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":187,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":188,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["roles"]}}]},"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteMembership","weight":190,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":189,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":193,"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":"Maximum number of users to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":192,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"usersGet","consumes":["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":194,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"usersDelete","consumes":["application\/json"],"produces":[],"tags":["users"],"description":"Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](\/docs\/server\/users#usersUpdateStatus) endpoint instead.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":209,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":204,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":198,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/users\/{userId}\/memberships":{"get":{"summary":"Get User Memberships","operationId":"usersGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user membership list by its unique ID.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":197,"cookies":false,"type":"","demo":"users\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-memberships.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":202,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":203,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/users\/{userId}\/phone":{"patch":{"summary":"Update Phone","operationId":"usersUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":205,"cookies":false,"type":"","demo":"users\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"User phone number.","default":null,"x-example":null}},"required":["number"]}}]}},"\/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":195,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"usersUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":206,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":196,"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 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":208,"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 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":207,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":199,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateEmailVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmailVerification","weight":200,"cookies":false,"type":"","demo":"users\/update-email-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}},"\/users\/{userId}\/verification\/phone":{"patch":{"summary":"Update Phone Verification","operationId":"usersUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":201,"cookies":false,"type":"","demo":"users\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"phoneVerification":{"type":"boolean","description":"User phone verification status.","default":null,"x-example":false}},"required":["phoneVerification"]}}]}}},"tags":[{"name":"account","description":"The Account service allows you to authenticate and manage a user account.","x-globalAttributes":[]},{"name":"avatars","description":"The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.","x-globalAttributes":[]},{"name":"databases","description":"The Databases service allows you to create structured collections of documents, query and filter lists of documents","x-globalAttributes":["databaseId"]},{"name":"locale","description":"The Locale service allows you to customize your app based on your users' location.","x-globalAttributes":[]},{"name":"health","description":"The Health service allows you to both validate and monitor your Appwrite server's health.","x-globalAttributes":[]},{"name":"projects","description":"The Project service allows you to manage all the projects in your Appwrite server.","x-globalAttributes":[]},{"name":"storage","description":"The Storage service allows you to manage your project files.","x-globalAttributes":[]},{"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","x-globalAttributes":[]},{"name":"users","description":"The Users service allows you to manage your project users.","x-globalAttributes":[]},{"name":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions.","x-globalAttributes":[]}],"definitions":{"documentList":{"description":"Documents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of documents documents that matched your query.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["total","documents"]},"collectionList":{"description":"Collections List","type":"object","properties":{"total":{"type":"integer","description":"Total number of collections documents that matched your query.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["total","collections"]},"databaseList":{"description":"Databases List","type":"object","properties":{"total":{"type":"integer","description":"Total number of databases documents that matched your query.","x-example":5,"format":"int32"},"databases":{"type":"array","description":"List of databases.","items":{"type":"object","$ref":"#\/definitions\/database"},"x-example":""}},"required":["total","databases"]},"indexList":{"description":"Indexes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of indexes documents that matched your query.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["total","indexes"]},"userList":{"description":"Users List","type":"object","properties":{"total":{"type":"integer","description":"Total number of users documents that matched your query.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["total","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of sessions documents that matched your query.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["total","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"total":{"type":"integer","description":"Total number of logs documents that matched your query.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["total","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"total":{"type":"integer","description":"Total number of files documents that matched your query.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["total","files"]},"bucketList":{"description":"Buckets List","type":"object","properties":{"total":{"type":"integer","description":"Total number of buckets documents that matched your query.","x-example":5,"format":"int32"},"buckets":{"type":"array","description":"List of buckets.","items":{"type":"object","$ref":"#\/definitions\/bucket"},"x-example":""}},"required":["total","buckets"]},"teamList":{"description":"Teams List","type":"object","properties":{"total":{"type":"integer","description":"Total number of teams documents that matched your query.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["total","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"total":{"type":"integer","description":"Total number of memberships documents that matched your query.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["total","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of functions documents that matched your query.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["total","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of runtimes documents that matched your query.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["total","runtimes"]},"deploymentList":{"description":"Deployments List","type":"object","properties":{"total":{"type":"integer","description":"Total number of deployments documents that matched your query.","x-example":5,"format":"int32"},"deployments":{"type":"array","description":"List of deployments.","items":{"type":"object","$ref":"#\/definitions\/deployment"},"x-example":""}},"required":["total","deployments"]},"executionList":{"description":"Executions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of executions documents that matched your query.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["total","executions"]},"countryList":{"description":"Countries List","type":"object","properties":{"total":{"type":"integer","description":"Total number of countries documents that matched your query.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["total","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of continents documents that matched your query.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["total","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"total":{"type":"integer","description":"Total number of languages documents that matched your query.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["total","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"total":{"type":"integer","description":"Total number of currencies documents that matched your query.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["total","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"total":{"type":"integer","description":"Total number of phones documents that matched your query.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["total","phones"]},"database":{"description":"Database","type":"object","properties":{"$id":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Database name.","x-example":"My Database"}},"required":["$id","name"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Collection update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"databaseId":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$createdAt","$updatedAt","$read","$write","databaseId","name","enabled","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of attributes in the given collection.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["total","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"integer","description":"Attribute size.","x-example":128,"format":"int32"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"count"},"type":{"type":"string","description":"Attribute type.","x-example":"integer"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"percentageCompleted"},"type":{"type":"string","description":"Attribute type.","x-example":"double"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"isEnabled"},"type":{"type":"string","description":"Attribute type.","x-example":"boolean"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"userEmail"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"status"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"ipAddress"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"githubUrl"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":"primary"},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$createdAt":{"type":"integer","description":"Document creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Document update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$createdAt","$updatedAt","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"User creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"User update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"phone":{"type":"string","description":"User phone number in E.164 format.","x-example":"+4930901820"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"phoneVerification":{"type":"boolean","description":"Phone verification status.","x-example":true},"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","$createdAt","$updatedAt","name","registration","status","passwordUpdate","email","phone","emailVerification","phoneVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Session creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"integer","description":"Date, the Unix timestamp of when the access token expires.","x-example":1592981250,"format":"int32"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","$createdAt","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"$createdAt":{"type":"integer","description":"Token creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"File update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"signature":{"type":"string","description":"File MD5 signature.","x-example":"5d529fd02b544198ae075bd57c1762bb"},"mimeType":{"type":"string","description":"File mime type.","x-example":"image\/png"},"sizeOriginal":{"type":"integer","description":"File original size in bytes.","x-example":17890,"format":"int32"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$createdAt","$updatedAt","$read","$write","name","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"bucket":{"description":"Bucket","type":"object","properties":{"$id":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Bucket creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Bucket update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":["role:all"]},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":["user:608f9da25e7e1"]},"permission":{"type":"string","description":"Bucket permission model. Possible values: `bucket` or `file`","x-example":"file"},"name":{"type":"string","description":"Bucket name.","x-example":"Documents"},"enabled":{"type":"boolean","description":"Bucket enabled.","x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size supported.","x-example":100,"format":"int32"},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions.","items":{"type":"string"},"x-example":["jpg","png"]},"encryption":{"type":"boolean","description":"Bucket is encrypted.","x-example":false},"antivirus":{"type":"boolean","description":"Virus scanning is enabled.","x-example":false}},"required":["$id","$createdAt","$updatedAt","$read","$write","permission","name","enabled","maximumFileSize","allowedFileExtensions","encryption","antivirus"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Team update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"total":{"type":"integer","description":"Total number of team members.","x-example":7,"format":"int32"}},"required":["$id","$createdAt","$updatedAt","name","total"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Membership creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Membership update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"userName":{"type":"string","description":"User name.","x-example":"John Doe"},"userEmail":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"teamName":{"type":"string","description":"Team name.","x-example":"VIP"},"invited":{"type":"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","$createdAt","$updatedAt","userId","userName","userEmail","teamId","teamName","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"execute":{"type":"array","description":"Execution permissions.","items":{"type":"string"},"x-example":"role:member"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"status":{"type":"string","description":"Function status. Possible values: `disabled`, `enabled`","x-example":"enabled"},"runtime":{"type":"string","description":"Function execution runtime.","x-example":"python-3.8"},"deployment":{"type":"string","description":"Function's active deployment ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"object","additionalProperties":true,"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","$createdAt","$updatedAt","execute","name","status","runtime","deployment","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"deployment":{"description":"Deployment","type":"object","properties":{"$id":{"type":"string","description":"Deployment ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Deployment creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Deployment update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"resourceId":{"type":"string","description":"Resource ID.","x-example":"5e5ea6g16897e"},"resourceType":{"type":"string","description":"Resource type.","x-example":"functions"},"entrypoint":{"type":"string","description":"The entrypoint file to use to execute the deployment code.","x-example":"enabled"},"size":{"type":"integer","description":"The code size in bytes.","x-example":128,"format":"int32"},"buildId":{"type":"string","description":"The current build ID.","x-example":"5e5ea5c16897e"},"activate":{"type":"boolean","description":"Whether the deployment should be automatically activated.","x-example":true},"status":{"type":"string","description":"The deployment status.","x-example":"enabled"},"buildStdout":{"type":"string","description":"The build stdout.","x-example":"enabled"},"buildStderr":{"type":"string","description":"The build stderr.","x-example":"enabled"}},"required":["$id","$createdAt","$updatedAt","resourceId","resourceType","entrypoint","size","buildId","activate","status","buildStdout","buildStderr"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Execution update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"response":{"type":"string","description":"The script response output string. Logs the last 4,000 characters of the execution response output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$createdAt","$updatedAt","$read","functionId","trigger","status","statusCode","response","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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]}},"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.15.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":"HOSTNAME","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":52,"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":40,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":59,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":51,"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":100,"rate-time":3600,"rate-key":"url:{url},userId:{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":55,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":57,"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, Team Invites and Magic URL, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":58,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/phone":{"patch":{"summary":"Update Account Phone","operationId":"accountUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account phone number. After changing phone number, the user confirmation status will get reset. A new confirmation SMS is not sent automatically however you can use the phone confirmation endpoint again to send the confirmation SMS.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":60,"cookies":false,"type":"","demo":"account\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["number","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":53,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":61,"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":{},"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":66,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":67,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":54,"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":[]}]},"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":65,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":50,"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\/email":{"post":{"summary":"Create Account Session with Email","operationId":"accountCreateEmailSession","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":"createEmailSession","weight":41,"cookies":false,"type":"","demo":"account\/create-email-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email.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 at least 8 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/sessions\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":46,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":47,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":42,"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, auth0, bitbucket, bitly, box, dailymotion, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, notion, okta, paypal, paypalSandbox, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoom.","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":"","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":"","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/phone":{"post":{"summary":"Create Phone session","operationId":"accountCreatePhoneSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user a SMS with a secret key for creating a session. Use the returned user ID and the secret to submit a request to the [PUT \/account\/sessions\/phone](\/docs\/client\/account#accountUpdatePhoneSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneSession","weight":48,"cookies":false,"type":"","demo":"account\/create-phone-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"number":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null}},"required":["userId","number"]}}]},"put":{"summary":"Create Phone session (confirmation)","operationId":"accountUpdatePhoneSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updatePhoneSession","weight":49,"cookies":false,"type":"","demo":"account\/update-phone-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/sessions\/{sessionId}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":56,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to \"refresh\" the access token.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":64,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":63,"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 ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/status":{"patch":{"summary":"Update Account Status","operationId":"accountUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":62,"cookies":false,"type":"","demo":"account\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/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#accountUpdateEmailVerification). 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":68,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":69,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/verification\/phone":{"post":{"summary":"Create Phone Verification","operationId":"accountCreatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification message to your user's phone number to confirm they are the valid owners of that address. The provided secret should 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#accountUpdatePhoneVerification). The verification link sent to the user's phone number is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneVerification","weight":70,"cookies":false,"type":"","demo":"account\/create-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]},"put":{"summary":"Create Phone Verification (confirmation)","operationId":"accountUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":71,"cookies":false,"type":"","demo":"account\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"avatarsGetBrowser","consumes":["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 [GET \/account\/sessions](\/docs\/client\/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":73,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":72,"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":76,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":74,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":75,"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. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":78,"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.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":77,"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 1 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":1,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/databases":{"get":{"summary":"List Databases","operationId":"databasesList","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Databases List","schema":{"$ref":"#\/definitions\/databaseList"}}},"x-appwrite":{"method":"list","weight":80,"cookies":false,"type":"","demo":"databases\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 Database","operationId":"databasesCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"create","weight":79,"cookies":false,"type":"","demo":"databases\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"databaseId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DATABASE_ID]","x-global":true},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["databaseId","name"]}}]}},"\/databases\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databasesGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageDatabases","schema":{"$ref":"#\/definitions\/usageDatabases"}}},"x-appwrite":{"method":"getUsage","weight":112,"cookies":false,"type":"","demo":"databases\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"`Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/databases\/{databaseId}":{"get":{"summary":"Get Database","operationId":"databasesGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"get","weight":81,"cookies":false,"type":"","demo":"databases\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]},"put":{"summary":"Update Database","operationId":"databasesUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"update","weight":83,"cookies":false,"type":"","demo":"databases\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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]"}},"required":["name"]}}]},"delete":{"summary":"Delete Database","operationId":"databasesDelete","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":84,"cookies":false,"type":"","demo":"databases\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections":{"get":{"summary":"List Collections","operationId":"databasesListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":86,"cookies":false,"type":"","demo":"databases\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"databasesCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":85,"cookies":false,"type":"","demo":"databases\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[COLLECTION_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Specifies the permissions model used in this collection, which accepts either 'collection' or 'document'. For 'collection' level permission, the permissions specified in read and write params are applied to all documents in the collection. For 'document' level permissions, read and write permissions are specified in each document. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databasesGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"getCollection","weight":87,"cookies":false,"type":"","demo":"databases\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databasesUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":89,"cookies":false,"type":"","demo":"databases\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Collection","operationId":"databasesDeleteCollection","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteCollection","weight":90,"cookies":false,"type":"","demo":"databases\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databasesListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":99,"cookies":false,"type":"","demo":"databases\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databasesCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":98,"cookies":false,"type":"","demo":"databases\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databasesCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":92,"cookies":false,"type":"","demo":"databases\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databasesCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":93,"cookies":false,"type":"","demo":"databases\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 4096 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databasesCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":97,"cookies":false,"type":"","demo":"databases\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"number","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"number","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databasesCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":96,"cookies":false,"type":"","demo":"databases\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databasesCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":94,"cookies":false,"type":"","demo":"databases\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databasesCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":91,"cookies":false,"type":"","demo":"databases\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databasesCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":95,"cookies":false,"type":"","demo":"databases\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databasesGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":100,"cookies":false,"type":"","demo":"databases\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databasesDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":101,"cookies":false,"type":"","demo":"databases\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databasesListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":107,"cookies":false,"type":"","demo":"databases\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/database#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results. Maximum of 100 order attributes are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order. Maximum of 100 order types are allowed.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]},"post":{"summary":"Create Document","operationId":"databasesCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":106,"cookies":false,"type":"","demo":"databases\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","data"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databasesGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"getDocument","weight":108,"cookies":false,"type":"","demo":"databases\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databasesUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"updateDocument","weight":110,"cookies":false,"type":"","demo":"databases\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object. Include only attribute and value pairs to be updated.","default":[],"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete Document","operationId":"databasesDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":111,"cookies":false,"type":"","demo":"databases\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databasesListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":109,"cookies":false,"type":"","demo":"databases\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databasesListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":103,"cookies":false,"type":"","demo":"databases\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databasesCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":102,"cookies":false,"type":"","demo":"databases\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders. Maximum of 100 orders are allowed.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databasesGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":104,"cookies":false,"type":"","demo":"databases\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databasesDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":105,"cookies":false,"type":"","demo":"databases\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databasesListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":88,"cookies":false,"type":"","demo":"databases\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databasesGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":114,"cookies":false,"type":"","demo":"databases\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databasesListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":82,"cookies":false,"type":"","demo":"databases\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/databases\/{databaseId}\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databasesGetDatabaseUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getDatabaseUsage","weight":113,"cookies":false,"type":"","demo":"databases\/get-database-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"range","description":"`Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/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":212,"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":"Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":211,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[FUNCTION_ID]"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Function maximum execution time in seconds.","default":15,"x-example":1}},"required":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List runtimes","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active on your instance.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":213,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":214,"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 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":216,"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 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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Maximum execution time in seconds.","default":15,"x-example":1}},"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":218,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments":{"get":{"summary":"List Deployments","operationId":"functionsListDeployments","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code deployments. You can use the query params to filter your results.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"listDeployments","weight":220,"cookies":false,"type":"","demo":"functions\/list-deployments.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-deployments.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 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":"Maximum number of deployments to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 Deployment","operationId":"functionsCreateDeployment","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"createDeployment","weight":219,"cookies":false,"type":"","demo":"functions\/create-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"entrypoint","description":"Entrypoint File.","required":true,"type":"string","x-example":"[ENTRYPOINT]","in":"formData"},{"name":"code","description":"Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.","required":true,"type":"file","in":"formData"},{"name":"activate","description":"Automatically activate the deployment when it is finished building.","required":true,"type":"boolean","x-example":false,"in":"formData"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}":{"get":{"summary":"Get Deployment","operationId":"functionsGetDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code deployment by its unique ID.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"getDeployment","weight":221,"cookies":false,"type":"","demo":"functions\/get-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"patch":{"summary":"Update Function Deployment","operationId":"functionsUpdateDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateDeployment","weight":217,"cookies":false,"type":"","demo":"functions\/update-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"delete":{"summary":"Delete Deployment","operationId":"functionsDeleteDeployment","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code deployment by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDeployment","weight":222,"cookies":false,"type":"","demo":"functions\/delete-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":226,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":224,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":223,"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 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]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":225,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":215,"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 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":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":122,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":132,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":125,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":124,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":129,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":130,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":128,"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\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":127,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":131,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":126,"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":115,"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":119,"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":116,"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":117,"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":118,"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":120,"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":121,"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":135,"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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":134,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[PROJECT_ID]"},"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":["projectId","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":136,"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":138,"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":143,"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 at least 8 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":141,"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":"integer","description":"Set the max number of users allowed in this project. Use 0 for unlimited.","default":null,"x-example":0}},"required":["limit"]}}]}},"\/projects\/{projectId}\/auth\/{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":142,"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,magic-url,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":161,"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":160,"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":162,"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":164,"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":163,"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":151,"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":150,"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. Maximum of 100 scopes are allowed.","default":null,"x-example":null,"items":{"type":"string"}},"expire":{"type":"integer","description":"Key expiration time in Unix timestamp. Use 0 for unlimited expiration.","default":0,"x-example":null}},"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":152,"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":153,"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. Maximum of 100 events are allowed.","default":null,"x-example":null,"items":{"type":"string"}},"expire":{"type":"integer","description":"Key expiration time in Unix timestamp. Use 0 for unlimited expiration.","default":0,"x-example":null}},"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":154,"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":140,"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":156,"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":155,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":null}},"required":["type","name"]}}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"projectsGetPlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"getPlatform","weight":157,"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":158,"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":null}},"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":159,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":139,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":137,"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":145,"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":144,"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. Maximum of 100 events are allowed.","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":146,"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":147,"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. Maximum of 100 events are allowed.","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":149,"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"}]}},"\/projects\/{projectId}\/webhooks\/{webhookId}\/signature":{"patch":{"summary":"Update Webhook Signature Key","operationId":"projectsUpdateWebhookSignature","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"updateWebhookSignature","weight":148,"cookies":false,"type":"","demo":"projects\/update-webhook-signature.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\/buckets":{"get":{"summary":"List buckets","operationId":"storageListBuckets","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the storage buckets. You can use the query params to filter your results.","responses":{"200":{"description":"Buckets List","schema":{"$ref":"#\/definitions\/bucketList"}}},"x-appwrite":{"method":"listBuckets","weight":166,"cookies":false,"type":"","demo":"storage\/list-buckets.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"cursor","description":"ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 bucket","operationId":"storageCreateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new storage bucket.","responses":{"201":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"createBucket","weight":165,"cookies":false,"type":"","demo":"storage\/create-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"bucketId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[BUCKET_ID]"},"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":30000000,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["bucketId","name","permission"]}}]}},"\/storage\/buckets\/{bucketId}":{"get":{"summary":"Get Bucket","operationId":"storageGetBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"getBucket","weight":167,"cookies":false,"type":"","demo":"storage\/get-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]},"put":{"summary":"Update Bucket","operationId":"storageUpdateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a storage bucket by its unique ID.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"updateBucket","weight":168,"cookies":false,"type":"","demo":"storage\/update-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":null,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Bucket","operationId":"storageDeleteBucket","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a storage bucket by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteBucket","weight":169,"cookies":false,"type":"","demo":"storage\/delete-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["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":171,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":170,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/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":172,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":176,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":177,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":174,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":173,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":175,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":178,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":179,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":181,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":180,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":182,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":183,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":184,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/logs":{"get":{"summary":"List Team Logs","operationId":"teamsListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get the team activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":191,"cookies":false,"type":"","demo":"teams\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":186,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":185,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"URL to redirect the user back to your app from the invitation email. 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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":187,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":188,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["roles"]}}]},"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteMembership","weight":190,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":189,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":193,"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":"Maximum number of users to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":192,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":210,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":194,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"usersDelete","consumes":["application\/json"],"produces":[],"tags":["users"],"description":"Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](\/docs\/server\/users#usersUpdateStatus) endpoint instead.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":209,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":204,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":198,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/users\/{userId}\/memberships":{"get":{"summary":"Get User Memberships","operationId":"usersGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user membership list by its unique ID.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":197,"cookies":false,"type":"","demo":"users\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-memberships.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":202,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":203,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/users\/{userId}\/phone":{"patch":{"summary":"Update Phone","operationId":"usersUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":205,"cookies":false,"type":"","demo":"users\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"User phone number.","default":null,"x-example":null}},"required":["number"]}}]}},"\/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":195,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"usersUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":206,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":196,"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 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":208,"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 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":207,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":199,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateEmailVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmailVerification","weight":200,"cookies":false,"type":"","demo":"users\/update-email-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}},"\/users\/{userId}\/verification\/phone":{"patch":{"summary":"Update Phone Verification","operationId":"usersUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":201,"cookies":false,"type":"","demo":"users\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"phoneVerification":{"type":"boolean","description":"User phone verification status.","default":null,"x-example":false}},"required":["phoneVerification"]}}]}}},"tags":[{"name":"account","description":"The Account service allows you to authenticate and manage a user account.","x-globalAttributes":[]},{"name":"avatars","description":"The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.","x-globalAttributes":[]},{"name":"databases","description":"The Databases service allows you to create structured collections of documents, query and filter lists of documents","x-globalAttributes":["databaseId"]},{"name":"locale","description":"The Locale service allows you to customize your app based on your users' location.","x-globalAttributes":[]},{"name":"health","description":"The Health service allows you to both validate and monitor your Appwrite server's health.","x-globalAttributes":[]},{"name":"projects","description":"The Project service allows you to manage all the projects in your Appwrite server.","x-globalAttributes":[]},{"name":"storage","description":"The Storage service allows you to manage your project files.","x-globalAttributes":[]},{"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","x-globalAttributes":[]},{"name":"users","description":"The Users service allows you to manage your project users.","x-globalAttributes":[]},{"name":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions.","x-globalAttributes":[]}],"definitions":{"documentList":{"description":"Documents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of documents documents that matched your query.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["total","documents"]},"collectionList":{"description":"Collections List","type":"object","properties":{"total":{"type":"integer","description":"Total number of collections documents that matched your query.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["total","collections"]},"databaseList":{"description":"Databases List","type":"object","properties":{"total":{"type":"integer","description":"Total number of databases documents that matched your query.","x-example":5,"format":"int32"},"databases":{"type":"array","description":"List of databases.","items":{"type":"object","$ref":"#\/definitions\/database"},"x-example":""}},"required":["total","databases"]},"indexList":{"description":"Indexes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of indexes documents that matched your query.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["total","indexes"]},"userList":{"description":"Users List","type":"object","properties":{"total":{"type":"integer","description":"Total number of users documents that matched your query.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["total","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of sessions documents that matched your query.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["total","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"total":{"type":"integer","description":"Total number of logs documents that matched your query.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["total","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"total":{"type":"integer","description":"Total number of files documents that matched your query.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["total","files"]},"bucketList":{"description":"Buckets List","type":"object","properties":{"total":{"type":"integer","description":"Total number of buckets documents that matched your query.","x-example":5,"format":"int32"},"buckets":{"type":"array","description":"List of buckets.","items":{"type":"object","$ref":"#\/definitions\/bucket"},"x-example":""}},"required":["total","buckets"]},"teamList":{"description":"Teams List","type":"object","properties":{"total":{"type":"integer","description":"Total number of teams documents that matched your query.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["total","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"total":{"type":"integer","description":"Total number of memberships documents that matched your query.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["total","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of functions documents that matched your query.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["total","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of runtimes documents that matched your query.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["total","runtimes"]},"deploymentList":{"description":"Deployments List","type":"object","properties":{"total":{"type":"integer","description":"Total number of deployments documents that matched your query.","x-example":5,"format":"int32"},"deployments":{"type":"array","description":"List of deployments.","items":{"type":"object","$ref":"#\/definitions\/deployment"},"x-example":""}},"required":["total","deployments"]},"executionList":{"description":"Executions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of executions documents that matched your query.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["total","executions"]},"projectList":{"description":"Projects List","type":"object","properties":{"total":{"type":"integer","description":"Total number of projects documents that matched your query.","x-example":5,"format":"int32"},"projects":{"type":"array","description":"List of projects.","items":{"type":"object","$ref":"#\/definitions\/project"},"x-example":""}},"required":["total","projects"]},"webhookList":{"description":"Webhooks List","type":"object","properties":{"total":{"type":"integer","description":"Total number of webhooks documents that matched your query.","x-example":5,"format":"int32"},"webhooks":{"type":"array","description":"List of webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"},"x-example":""}},"required":["total","webhooks"]},"keyList":{"description":"API Keys List","type":"object","properties":{"total":{"type":"integer","description":"Total number of keys documents that matched your query.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["total","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"total":{"type":"integer","description":"Total number of platforms documents that matched your query.","x-example":5,"format":"int32"},"platforms":{"type":"array","description":"List of platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"},"x-example":""}},"required":["total","platforms"]},"domainList":{"description":"Domains List","type":"object","properties":{"total":{"type":"integer","description":"Total number of domains documents that matched your query.","x-example":5,"format":"int32"},"domains":{"type":"array","description":"List of domains.","items":{"type":"object","$ref":"#\/definitions\/domain"},"x-example":""}},"required":["total","domains"]},"countryList":{"description":"Countries List","type":"object","properties":{"total":{"type":"integer","description":"Total number of countries documents that matched your query.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["total","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of continents documents that matched your query.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["total","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"total":{"type":"integer","description":"Total number of languages documents that matched your query.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["total","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"total":{"type":"integer","description":"Total number of currencies documents that matched your query.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["total","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"total":{"type":"integer","description":"Total number of phones documents that matched your query.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["total","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"total":{"type":"integer","description":"Total number of metrics documents that matched your query.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["total","metrics"]},"database":{"description":"Database","type":"object","properties":{"$id":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Database name.","x-example":"My Database"}},"required":["$id","name"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Collection update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"databaseId":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$createdAt","$updatedAt","$read","$write","databaseId","name","enabled","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of attributes in the given collection.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["total","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"integer","description":"Attribute size.","x-example":128,"format":"int32"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"count"},"type":{"type":"string","description":"Attribute type.","x-example":"integer"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"percentageCompleted"},"type":{"type":"string","description":"Attribute type.","x-example":"double"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"isEnabled"},"type":{"type":"string","description":"Attribute type.","x-example":"boolean"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"userEmail"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"status"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"ipAddress"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"githubUrl"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":"primary"},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$createdAt":{"type":"integer","description":"Document creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Document update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$createdAt","$updatedAt","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"User creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"User update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"phone":{"type":"string","description":"User phone number in E.164 format.","x-example":"+4930901820"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"phoneVerification":{"type":"boolean","description":"Phone verification status.","x-example":true},"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","$createdAt","$updatedAt","name","registration","status","passwordUpdate","email","phone","emailVerification","phoneVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Session creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"integer","description":"Date, the Unix timestamp of when the access token expires.","x-example":1592981250,"format":"int32"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","$createdAt","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"$createdAt":{"type":"integer","description":"Token creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"File update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"signature":{"type":"string","description":"File MD5 signature.","x-example":"5d529fd02b544198ae075bd57c1762bb"},"mimeType":{"type":"string","description":"File mime type.","x-example":"image\/png"},"sizeOriginal":{"type":"integer","description":"File original size in bytes.","x-example":17890,"format":"int32"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$createdAt","$updatedAt","$read","$write","name","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"bucket":{"description":"Bucket","type":"object","properties":{"$id":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Bucket creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Bucket update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":["role:all"]},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":["user:608f9da25e7e1"]},"permission":{"type":"string","description":"Bucket permission model. Possible values: `bucket` or `file`","x-example":"file"},"name":{"type":"string","description":"Bucket name.","x-example":"Documents"},"enabled":{"type":"boolean","description":"Bucket enabled.","x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size supported.","x-example":100,"format":"int32"},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions.","items":{"type":"string"},"x-example":["jpg","png"]},"encryption":{"type":"boolean","description":"Bucket is encrypted.","x-example":false},"antivirus":{"type":"boolean","description":"Virus scanning is enabled.","x-example":false}},"required":["$id","$createdAt","$updatedAt","$read","$write","permission","name","enabled","maximumFileSize","allowedFileExtensions","encryption","antivirus"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Team update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"total":{"type":"integer","description":"Total number of team members.","x-example":7,"format":"int32"}},"required":["$id","$createdAt","$updatedAt","name","total"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Membership creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Membership update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"userName":{"type":"string","description":"User name.","x-example":"John Doe"},"userEmail":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"teamName":{"type":"string","description":"Team name.","x-example":"VIP"},"invited":{"type":"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","$createdAt","$updatedAt","userId","userName","userEmail","teamId","teamName","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"execute":{"type":"array","description":"Execution permissions.","items":{"type":"string"},"x-example":"role:member"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"status":{"type":"string","description":"Function status. Possible values: `disabled`, `enabled`","x-example":"enabled"},"runtime":{"type":"string","description":"Function execution runtime.","x-example":"python-3.8"},"deployment":{"type":"string","description":"Function's active deployment ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"object","additionalProperties":true,"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","$createdAt","$updatedAt","execute","name","status","runtime","deployment","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"deployment":{"description":"Deployment","type":"object","properties":{"$id":{"type":"string","description":"Deployment ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Deployment creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Deployment update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"resourceId":{"type":"string","description":"Resource ID.","x-example":"5e5ea6g16897e"},"resourceType":{"type":"string","description":"Resource type.","x-example":"functions"},"entrypoint":{"type":"string","description":"The entrypoint file to use to execute the deployment code.","x-example":"enabled"},"size":{"type":"integer","description":"The code size in bytes.","x-example":128,"format":"int32"},"buildId":{"type":"string","description":"The current build ID.","x-example":"5e5ea5c16897e"},"activate":{"type":"boolean","description":"Whether the deployment should be automatically activated.","x-example":true},"status":{"type":"string","description":"The deployment status.","x-example":"enabled"},"buildStdout":{"type":"string","description":"The build stdout.","x-example":"enabled"},"buildStderr":{"type":"string","description":"The build stderr.","x-example":"enabled"}},"required":["$id","$createdAt","$updatedAt","resourceId","resourceType","entrypoint","size","buildId","activate","status","buildStdout","buildStderr"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Execution update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"response":{"type":"string","description":"The script response output string. Logs the last 4,000 characters of the execution response output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$createdAt","$updatedAt","$read","functionId","trigger","status","statusCode","response","stderr","time"]},"project":{"description":"Project","type":"object","properties":{"$id":{"type":"string","description":"Project ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Project creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Project update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAuth0Appid":{"type":"string","description":"Auth0 OAuth app ID.","x-example":"123247283472834787438"},"providerAuth0Secret":{"type":"string","description":"Auth0 OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDailymotionAppid":{"type":"string","description":"Dailymotion OAuth app ID.","x-example":"123247283472834787438"},"providerDailymotionSecret":{"type":"string","description":"Dailymotion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerNotionAppid":{"type":"string","description":"Notion OAuth app ID.","x-example":"123247283472834787438"},"providerNotionSecret":{"type":"string","description":"Notion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerOktaAppid":{"type":"string","description":"Okta OAuth app ID.","x-example":"123247283472834787438"},"providerOktaSecret":{"type":"string","description":"Okta OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerStripeAppid":{"type":"string","description":"Stripe OAuth app ID.","x-example":"123247283472834787438"},"providerStripeSecret":{"type":"string","description":"Stripe OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYammerAppid":{"type":"string","description":"Yammer OAuth app ID.","x-example":"123247283472834787438"},"providerYammerSecret":{"type":"string","description":"Yammer OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerZoomAppid":{"type":"string","description":"Zoom OAuth app ID.","x-example":"123247283472834787438"},"providerZoomSecret":{"type":"string","description":"Zoom OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabases":{"type":"boolean","description":"Databases service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","$createdAt","$updatedAt","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerAuth0Appid","providerAuth0Secret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDailymotionAppid","providerDailymotionSecret","providerDiscordAppid","providerDiscordSecret","providerDropboxAppid","providerDropboxSecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerNotionAppid","providerNotionSecret","providerOktaAppid","providerOktaSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerStripeAppid","providerStripeSecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerWordpressAppid","providerWordpressSecret","providerYahooAppid","providerYahooSecret","providerYammerAppid","providerYammerSecret","providerYandexAppid","providerYandexSecret","providerZoomAppid","providerZoomSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabases","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"webhook":{"description":"Webhook","type":"object","properties":{"$id":{"type":"string","description":"Webhook ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Webhook creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Webhook update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Webhook name.","x-example":"My Webhook"},"url":{"type":"string","description":"Webhook URL endpoint.","x-example":"https:\/\/example.com\/webhook"},"events":{"type":"array","description":"Webhook trigger events.","items":{"type":"string"},"x-example":"database.collections.update"},"security":{"type":"boolean","description":"Indicated if SSL \/ TLS Certificate verification is enabled.","x-example":true},"httpUser":{"type":"string","description":"HTTP basic authentication username.","x-example":"username"},"httpPass":{"type":"string","description":"HTTP basic authentication password.","x-example":"password"},"signatureKey":{"type":"string","description":"Signature key which can be used to validated incoming","x-example":"ad3d581ca230e2b7059c545e5a"}},"required":["$id","$createdAt","$updatedAt","name","url","events","security","httpUser","httpPass","signatureKey"]},"key":{"description":"Key","type":"object","properties":{"$id":{"type":"string","description":"Key ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Key creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Key update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Key name.","x-example":"My API Key"},"expire":{"type":"integer","description":"Key expiration in Unix timestamp.","x-example":"1653990687","format":"int32"},"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","$createdAt","$updatedAt","name","expire","scopes","secret"]},"domain":{"description":"Domain","type":"object","properties":{"$id":{"type":"string","description":"Domain ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Domain creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Domain update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","$updatedAt","domain","registerable","tld","verification","certificateId"]},"platform":{"description":"Platform","type":"object","properties":{"$id":{"type":"string","description":"Platform ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Project creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Project update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","$updatedAt","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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]},"usageDatabases":{"description":"UsageDatabases","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"databasesCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesDelete":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","databasesCount","documentsCount","collectionsCount","databasesCreate","databasesRead","databasesUpdate","databasesDelete","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by files (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"tagsStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by tags (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCount":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCount":{"type":"array","description":"Aggregated stats for total number of buckets.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCreate":{"type":"array","description":"Aggregated stats for buckets created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsRead":{"type":"array","description":"Aggregated stats for buckets read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsUpdate":{"type":"array","description":"Aggregated stats for buckets updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsDelete":{"type":"array","description":"Aggregated stats for buckets deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesStorage","tagsStorage","filesCount","bucketsCount","bucketsCreate","bucketsRead","bucketsUpdate","bucketsDelete","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesStorage":{"type":"array","description":"Aggregated stats for total storage of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesStorage","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"functionsExecutions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsFailures":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsCompute":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","functionsExecutions","functionsFailures","functionsCompute"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","functions","documents","collections","users","storage"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file From 0a750c2da7a6b1a09dffb03e06de5daddae3d1a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 28 Jun 2022 07:50:17 +0000 Subject: [PATCH 121/555] Update web docs --- src/SDK/SDK.php | 1 + templates/web/docs/example.md.twig | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index 506a8d27af..436d164464 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -584,6 +584,7 @@ public function generate($target) $params['service'] = [ 'name' => $key, 'methods' => $methods, + 'globalParams' => $service['globalParams'] ?? [], 'features' => [ 'upload' => $this->hasUploads($methods), 'location' => $this->hasLocation($methods), diff --git a/templates/web/docs/example.md.twig b/templates/web/docs/example.md.twig index 215e9d4c74..55dc170c6a 100644 --- a/templates/web/docs/example.md.twig +++ b/templates/web/docs/example.md.twig @@ -2,7 +2,7 @@ import {{ '{' }} Client, {{service.name | caseUcfirst}} {{ '}' }} from "{{ langu const client = new Client(); -const {{ service.name | caseCamel }} = new {{service.name | caseUcfirst}}(client); +const {{ service.name | caseCamel }} = new {{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); {% if method.security|length > 0 %} client @@ -16,7 +16,7 @@ client {% endif %} {% if method.type == 'webAuth' %}// Go to OAuth provider login page {% endif %} -{% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}const result = {% else %}const promise = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); +{% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}const result = {% else %}const promise = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); {% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}console.log(result); // Resource URL{% else %}promise.then(function (response) { console.log(response); // Success From a706b6f6aee04a34976b2e64226f3a22544939f7 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 28 Jun 2022 19:59:41 +1200 Subject: [PATCH 122/555] Service level params for Python --- .../python/package/services/service.py.twig | 32 +++++++++++-------- tests/languages/python/tests.py | 12 +++---- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/templates/python/package/services/service.py.twig b/templates/python/package/services/service.py.twig index 1035c4ba31..60a59b832b 100644 --- a/templates/python/package/services/service.py.twig +++ b/templates/python/package/services/service.py.twig @@ -3,18 +3,26 @@ from ..exception import AppwriteException class {{ service.name | caseUcfirst }}(Service): +{% if service.globalParams | length %} + def __init__(self, client,{% for parameter in service.globalParams %} {{ parameter.name | caseSnake | escapeKeyword }}{% if not parameter.required %} = None{% endif %}{% if not loop.last %},{% endif %}{% endfor %}): + super({{ service.name | caseUcfirst }}, self).__init__(client) +{% for parameter in service.globalParams %} + self.{{ parameter.name | caseSnake | escapeKeyword }} = {{ parameter.name | caseSnake | escapeKeyword }} +{% endfor %} +{% else %} def __init__(self, client): super({{ service.name | caseUcfirst }}, self).__init__(client) +{% endif %} {% for method in service.methods %} - def {{ method.name | caseSnake }}(self{% if method.parameters.all|length > 0 %}, {% endif %}{% for parameter in method.parameters.all %}{{ parameter.name | escapeKeyword | caseSnake }}{% if not parameter.required %} = None{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress = None{% endif %}): + def {{ method.name | caseSnake }}(self{% if method.parameters.all|length > 0 %}, {% endif %}{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | escapeKeyword | caseSnake }}{% if not parameter.required %} = None{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress = None{% endif %}): {% if method.title %} """{{ method.title }}""" {% endif %} -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all %} {% if parameter.required %} - if {{ parameter.name | escapeKeyword | caseSnake }} is None: + if {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} is None: raise {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | escapeKeyword | caseSnake }}"') {% endif %} @@ -22,30 +30,25 @@ class {{ service.name | caseUcfirst }}(Service): params = {} path = '{{ method.path }}' {% for parameter in method.parameters.path %} - path = path.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | escapeKeyword | caseSnake }}) + path = path.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }}) {% endfor %} {% for parameter in method.parameters.query %} - if {{ parameter.name | escapeKeyword | caseSnake }} is not None: - params['{{ parameter.name }}'] = {{ parameter.name | escapeKeyword | caseSnake }} - + params['{{ parameter.name }}'] = {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} {% endfor %} {% for parameter in method.parameters.body %} - if {{ parameter.name | escapeKeyword | caseSnake }} is not None: {% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %} - params['{{ parameter.name }}'] = str({{ parameter.name | escapeKeyword | caseSnake }}).lower() if type({{ parameter.name | escapeKeyword | caseSnake }}) is bool else {{ parameter.name | escapeKeyword | caseSnake }} + params['{{ parameter.name }}'] = str({{ parameter.name | escapeKeyword | caseSnake }}).lower() if type({{ parameter.name | escapeKeyword | caseSnake }}) is bool else {{ parameter.name | escapeKeyword | caseSnake }} {% else %} - params['{{ parameter.name }}'] = {{ parameter.name | escapeKeyword | caseSnake }} + params['{{ parameter.name }}'] = {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} {% endif %} {% endfor %} {% for parameter in method.parameters.formData %} - if {{ parameter.name | escapeKeyword | caseSnake }} is not None: {% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %} - params['{{ parameter.name }}'] = str({{ parameter.name | escapeKeyword | caseSnake }}).lower() if type({{ parameter.name | escapeKeyword | caseSnake }}) is bool else {{ parameter.name | escapeKeyword | caseSnake }} + params['{{ parameter.name }}'] = str({{ parameter.name | escapeKeyword | caseSnake }}).lower() if type({{ parameter.name | escapeKeyword | caseSnake }}) is bool else {{ parameter.name | escapeKeyword | caseSnake }} {% else %} - params['{{ parameter.name }}'] = {{ parameter.name | escapeKeyword | caseSnake }} + params['{{ parameter.name }}'] = {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} {% endif %} - {% endfor %} {% if 'multipart/form-data' in method.consumes %} {% for parameter in method.parameters.all %} @@ -71,6 +74,7 @@ class {{ service.name | caseUcfirst }}(Service): {% endfor %} }, params, param_name, on_progress, upload_id) {% else %} + return self.client.call('{{ method.method | caseLower }}', path, { {% for parameter in method.parameters.header %} '{{ parameter.name }}': {{ parameter.name | escapeKeyword | caseSnake }}, diff --git a/tests/languages/python/tests.py b/tests/languages/python/tests.py index d42a9f2f61..8fb7e91fc9 100644 --- a/tests/languages/python/tests.py +++ b/tests/languages/python/tests.py @@ -7,7 +7,7 @@ client = Client() -foo = Foo(client) +foo = Foo(client, 'string') bar = Bar(client) general = General(client) @@ -18,19 +18,19 @@ # Foo Tests -response = foo.get('string',123, ['string in array']) +response = foo.get(123, ['string in array']) print(response['result']) -response = foo.post('string', 123, ['string in array']) +response = foo.post( 123, ['string in array']) print(response['result']) -response = foo.put('string', 123, ['string in array']) +response = foo.put( 123, ['string in array']) print(response['result']) -response = foo.patch('string', 123, ['string in array']) +response = foo.patch( 123, ['string in array']) print(response['result']) -response = foo.delete('string', 123, ['string in array']) +response = foo.delete( 123, ['string in array']) print(response['result']) # Bar Tests From 093b4945fbca646aaecacd21bb8000c93c53e155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 28 Jun 2022 08:32:13 +0000 Subject: [PATCH 123/555] Global params in docs for all languages --- templates/android/docs/java/example.md.twig | 6 +++--- templates/android/docs/kotlin/example.md.twig | 6 +++--- templates/dart/docs/example.md.twig | 6 +++--- templates/deno/docs/example.md.twig | 4 ++-- templates/dotnet/docs/example.md.twig | 4 ++-- templates/flutter/docs/example.md.twig | 14 +++++++------- templates/kotlin/docs/java/example.md.twig | 6 +++--- templates/kotlin/docs/kotlin/example.md.twig | 6 +++--- templates/node/docs/example.md.twig | 4 ++-- templates/php/docs/example.md.twig | 4 ++-- templates/php/docs/service.md.twig | 18 +++++++++++++----- templates/python/docs/example.md.twig | 4 ++-- templates/ruby/docs/example.md.twig | 4 ++-- templates/swift/docs/example.md.twig | 6 +++--- 14 files changed, 50 insertions(+), 42 deletions(-) diff --git a/templates/android/docs/java/example.md.twig b/templates/android/docs/java/example.md.twig index 88743d0a28..a707e98b09 100644 --- a/templates/android/docs/java/example.md.twig +++ b/templates/android/docs/java/example.md.twig @@ -22,9 +22,9 @@ public class MainActivity extends AppCompatActivity { {% endfor %} {% endif %} - {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client); + {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); - {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}new Continuation() { + {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => not param.isGlobal) | length == 0 %}new Continuation() { @NotNull @Override public CoroutineContext getContext() { @@ -53,7 +53,7 @@ public class MainActivity extends AppCompatActivity { {% if method.type == "webAuth" %} this, {% endif %} -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if parameter.required %} {{ parameter | paramExample }}{% if not loop.last %}, {% endif %} diff --git a/templates/android/docs/kotlin/example.md.twig b/templates/android/docs/kotlin/example.md.twig index d9169895e3..1a070db999 100644 --- a/templates/android/docs/kotlin/example.md.twig +++ b/templates/android/docs/kotlin/example.md.twig @@ -20,15 +20,15 @@ class MainActivity : AppCompatActivity() { {% endfor %} {% endif %} - val {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client) + val {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) GlobalScope.launch { -{% if method.type == 'webAuth' %} {% elseif method.type == 'location' %} val result = {% else %} val response = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}){% endif %} +{% if method.type == 'webAuth' %} {% elseif method.type == 'location' %} val result = {% else %} val response = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => not param.isGlobal) | length == 0 %}){% endif %} {% if method.type == "webAuth" %} activity = this@MainActivity, {% endif %} -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if parameter.required %} {{parameter.name}} = {{ parameter | paramExample }}{% if not loop.last %},{% endif %} diff --git a/templates/dart/docs/example.md.twig b/templates/dart/docs/example.md.twig index 05717ef9ae..6c0ca9a1d5 100644 --- a/templates/dart/docs/example.md.twig +++ b/templates/dart/docs/example.md.twig @@ -5,7 +5,7 @@ import 'package:{{ language.params.packageName }}/{{ language.params.packageName void main() { // Init SDK Client client = Client(); - {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = {{service.name | caseUcfirst}}(client); + {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = {{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); {% if method.security|length > 0 %} client @@ -17,14 +17,14 @@ void main() { // Init SDK {% endfor %} ; {% endif %} - Future result = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %} + Future result = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if loop.first %} {% endif %} {% if parameter.required %} {{ parameter.name | caseCamel }}: {{ parameter | paramExample | replace({'': (parameter.name | caseCamel) }) | raw }}, {% endif %} -{% endfor %}{% if method.parameters.all|length > 0 %} {% endif %}); +{% endfor %}{% if method.parameters.all | filter((param) => not param.isGlobal) | length > 0 %} {% endif %}); result .then((response) { diff --git a/templates/deno/docs/example.md.twig b/templates/deno/docs/example.md.twig index 8f3ea098ca..b18069b2ff 100644 --- a/templates/deno/docs/example.md.twig +++ b/templates/deno/docs/example.md.twig @@ -6,7 +6,7 @@ const fs = require('fs'); // Init SDK let client = new sdk.Client(); -let {{ service.name | caseCamel }} = new sdk.{{service.name | caseUcfirst}}(client); +let {{ service.name | caseCamel }} = new sdk.{{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); {% if method.security|length > 0 %} client @@ -19,7 +19,7 @@ client {% endif %} -let promise = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); +let promise = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); promise.then(function (response) { console.log(response); diff --git a/templates/dotnet/docs/example.md.twig b/templates/dotnet/docs/example.md.twig index a02ce88778..533ab5b78a 100644 --- a/templates/dotnet/docs/example.md.twig +++ b/templates/dotnet/docs/example.md.twig @@ -12,6 +12,6 @@ client {% endfor %}; {% endif %} -{{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client); +{{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); -{% if method.type == 'location' %}string{% else %}HttpResponseMessage{% endif %} result = await {{ service.name | caseCamel }}.{{ method.name | caseUcfirst }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); +{% if method.type == 'location' %}string{% else %}HttpResponseMessage{% endif %} result = await {{ service.name | caseCamel }}.{{ method.name | caseUcfirst }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); diff --git a/templates/flutter/docs/example.md.twig b/templates/flutter/docs/example.md.twig index 67c886c5d6..7b95ace481 100644 --- a/templates/flutter/docs/example.md.twig +++ b/templates/flutter/docs/example.md.twig @@ -5,7 +5,7 @@ import 'package:{{ language.params.packageName }}/{{ language.params.packageName void main() { // Init SDK Client client = Client(); - {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = {{service.name | caseUcfirst}}(client); + {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = {{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); {% if method.security|length > 0 %} client @@ -18,14 +18,14 @@ void main() { // Init SDK {% endif %} {% if method.type == 'location' %} // downloading file - Future result = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %} + Future result = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if loop.first %} {% endif %} {% if parameter.required %} {{ parameter.name | caseCamel }}: {{ parameter | paramExample }}, {% endif %} -{% endfor %}{% if method.parameters.all|length > 0 %} {% endif %}).then((bytes) { +{% endfor %}{% if method.parameters.all | filter((param) => not param.isGlobal) | length > 0 %} {% endif %}).then((bytes) { final file = File('path_to_file/filename.ext'); file.writeAsBytesSync(bytes) }).catchError((error) { @@ -35,14 +35,14 @@ void main() { // Init SDK //displaying image preview FutureBuilder( - future: {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %} + future: {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if loop.first %} {% endif %} {% if parameter.required %} {{ parameter.name | caseCamel }}: {{ parameter | paramExample }}, {% endif %} -{% endfor %}{% if method.parameters.all|length > 0 %} {% endif %} +{% endfor %}{% if method.parameters.all | filter((param) => not param.isGlobal) | length > 0 %} {% endif %} ), //works for both public file and private file, for private files you need to be logged in builder: (context, snapshot) { return snapshot.hasData && snapshot.data != null @@ -53,14 +53,14 @@ FutureBuilder( }, ); {% else %} - Future result = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %} + Future result = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if loop.first %} {% endif %} {% if parameter.required %} {{ parameter.name | caseCamel }}: {{ parameter | paramExample }}, {% endif %} -{% endfor %}{% if method.parameters.all|length > 0 %} {% endif %}); +{% endfor %}{% if method.parameters.all | filter((param) => not param.isGlobal) | length > 0 %} {% endif %}); result .then((response) { diff --git a/templates/kotlin/docs/java/example.md.twig b/templates/kotlin/docs/java/example.md.twig index 62d3daaa72..0267d3e877 100644 --- a/templates/kotlin/docs/java/example.md.twig +++ b/templates/kotlin/docs/java/example.md.twig @@ -10,8 +10,8 @@ public void main() { .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}"){% if loop.last %};{% endif %} // {{node[header].description}} {% endfor %}{% endfor %}{% endif %} - {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client); - {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}new Continuation() { + {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); + {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => not param.isGlobal) | length == 0 %}new Continuation() { @NotNull @Override public CoroutineContext getContext() { @@ -34,7 +34,7 @@ public void main() { } });{% endif %} -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if parameter.required %} {{parameter.name}} = {{ parameter | paramExample }}{% if not loop.last %},{% endif %} diff --git a/templates/kotlin/docs/kotlin/example.md.twig b/templates/kotlin/docs/kotlin/example.md.twig index cc22e912a6..a084647bb2 100644 --- a/templates/kotlin/docs/kotlin/example.md.twig +++ b/templates/kotlin/docs/kotlin/example.md.twig @@ -10,10 +10,10 @@ suspend fun main() { .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}") // {{node[header].description}} {% endfor %}{% endfor %}{% endif %} - val {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client) -{% if method.type == 'webAuth' %} {% elseif method.type == 'location' %} val result = {% else %} val response = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}){% endif %} + val {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) +{% if method.type == 'webAuth' %} {% elseif method.type == 'location' %} val result = {% else %} val response = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => not param.isGlobal) | length == 0 %}){% endif %} -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if parameter.required %} {{parameter.name}} = {{ parameter | paramExample }}{% if not loop.last %},{% endif %} diff --git a/templates/node/docs/example.md.twig b/templates/node/docs/example.md.twig index e2604d6b7b..d552dc6fb3 100644 --- a/templates/node/docs/example.md.twig +++ b/templates/node/docs/example.md.twig @@ -6,7 +6,7 @@ const fs = require('fs'); // Init SDK const client = new sdk.Client(); -const {{ service.name | caseCamel }} = new sdk.{{service.name | caseUcfirst}}(client); +const {{ service.name | caseCamel }} = new sdk.{{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); {% if method.security|length > 0 %} client @@ -18,7 +18,7 @@ client {% endfor %}; {% endif %} -const promise = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); +const promise = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); promise.then(function (response) { console.log(response); diff --git a/templates/php/docs/example.md.twig b/templates/php/docs/example.md.twig index 8328d150a0..030226d219 100644 --- a/templates/php/docs/example.md.twig +++ b/templates/php/docs/example.md.twig @@ -15,6 +15,6 @@ $client {% endfor %}; {% endif %} -${{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}($client); +${{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}($client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); -$result = ${{ service.name | caseCamel }}->{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); \ No newline at end of file +$result = ${{ service.name | caseCamel }}->{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); \ No newline at end of file diff --git a/templates/php/docs/service.md.twig b/templates/php/docs/service.md.twig index 3e923c53a8..b851c82179 100644 --- a/templates/php/docs/service.md.twig +++ b/templates/php/docs/service.md.twig @@ -11,23 +11,31 @@ ** {{ method.description }} ** {% endif %} -{% if method.parameters.all is not empty %} +{% if method.parameters.all | filter((param) => not param.isGlobal) is not empty %} ### Parameters | Field Name | Type | Description | Default | | --- | --- | --- | --- | -{% for parameter in method.parameters.path %} +{% if method.parameters.path | length > 0 %} +{% for parameter in method.parameters.path | filter((param) => not param.isGlobal) %} | {{ parameter.name }} | {{ parameter.type }} | {% if parameter.required == 1 %}**Required** {% endif %}{{ parameter.description }} | {{ parameter.default }} | {% endfor %} -{% for parameter in method.parameters.query %} +{% endif %} +{% if method.parameters.query | length > 0 %} +{% for parameter in method.parameters.query | filter((param) => not param.isGlobal) %} | {{ parameter.name }} | {{ parameter.type }} | {% if parameter.required == 1 %}**Required** {% endif %}{{ parameter.description }} | {{ parameter.default }} | {% endfor %} -{% for parameter in method.parameters.body %} +{% endif %} +{% if method.parameters.body | length > 0 %} +{% for parameter in method.parameters.body | filter((param) => not param.isGlobal) %} | {{ parameter.name }} | {{ parameter.type }} | {{ parameter.description }} | {{ parameter.default }} | {% endfor %} -{% for parameter in method.parameters.formData %} +{% endif %} +{% if method.parameters.formData | length > 0 %} +{% for parameter in method.parameters.formData | filter((param) => not param.isGlobal) %} | {{ parameter.name }} | {{ parameter.type }} | {{ parameter.description }} | {{ parameter.default }} | {% endfor %} +{% endif %} {% endif %} {% endfor %} \ No newline at end of file diff --git a/templates/python/docs/example.md.twig b/templates/python/docs/example.md.twig index 0326405e7c..141b29ebc8 100644 --- a/templates/python/docs/example.md.twig +++ b/templates/python/docs/example.md.twig @@ -13,6 +13,6 @@ client = Client() {% endfor %}) {% endif %} -{{ service.name | caseSnake }} = {{ service.name | caseUcfirst }}(client) +{{ service.name | caseSnake }} = {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) -result = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}) +result = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}) diff --git a/templates/ruby/docs/example.md.twig b/templates/ruby/docs/example.md.twig index 3faecfa6f9..e78296397d 100644 --- a/templates/ruby/docs/example.md.twig +++ b/templates/ruby/docs/example.md.twig @@ -10,8 +10,8 @@ client {% endfor %} {% endfor %} -{{ service.name | caseSnake }} = {{spec.title | caseUcfirst}}::{{ service.name | caseUcfirst }}.new(client) +{{ service.name | caseSnake }} = {{spec.title | caseUcfirst}}::{{ service.name | caseUcfirst }}.new(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) -response = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{parameter.name|caseSnake}}: {% if parameter | paramExample == "File.new" %}{{spec.title | caseUcfirst}}::{{ parameter | paramExample }}{% else %}{{ parameter | paramExample }}{% endif %}{% endif %}{% endfor %}) +response = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{parameter.name|caseSnake}}: {% if parameter | paramExample == "File.new" %}{{spec.title | caseUcfirst}}::{{ parameter | paramExample }}{% else %}{{ parameter | paramExample }}{% endif %}{% endif %}{% endfor %}) puts response.inspect \ No newline at end of file diff --git a/templates/swift/docs/example.md.twig b/templates/swift/docs/example.md.twig index 20a8aae37f..4bb02784db 100644 --- a/templates/swift/docs/example.md.twig +++ b/templates/swift/docs/example.md.twig @@ -10,10 +10,10 @@ func main() async throws { {% endfor %} {% endfor %} {% endif %} - let {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client) - let {% if method.type == 'webAuth' %}success{% elseif method.type == 'location' %}byteBuffer{% elseif method.responseModel | length == 0 %}result{% else %}{{ method.responseModel | caseCamel | escapeKeyword }}{% endif %} = try await {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => param.required) | length == 0 %}){{ '\n' }}{% endif %} + let {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) + let {% if method.type == 'webAuth' %}success{% elseif method.type == 'location' %}byteBuffer{% elseif method.responseModel | length == 0 %}result{% else %}{{ method.responseModel | caseCamel | escapeKeyword }}{% endif %} = try await {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => not param.isGlobal) | filter((param) => param.required) | length == 0 %}){{ '\n' }}{% endif %} -{% for parameter in method.parameters.all | filter((parameter) => parameter.required) %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) | filter((parameter) => parameter.required) %} {{parameter.name}}: {{ parameter | paramExample | escapeKeyword }}{% if not loop.last %},{% endif %} {% if loop.last %} From 4b284dc0edad7f4631ea7e3c65f59b42aeda6e3c Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 28 Jun 2022 09:47:32 +0000 Subject: [PATCH 124/555] remove extra bracket --- templates/dart/base/requests/api.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/dart/base/requests/api.twig b/templates/dart/base/requests/api.twig index 151872bfef..950658e818 100644 --- a/templates/dart/base/requests/api.twig +++ b/templates/dart/base/requests/api.twig @@ -10,4 +10,4 @@ final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); - return {% if method.responseModel and method.responseModel != 'any' %}models.{{{method.responseModel | caseUcfirst | overrideIdentifier}}.fromMap(res.data){% else %} res.data{% endif %}; + return {% if method.responseModel and method.responseModel != 'any' %}models.{{method.responseModel | caseUcfirst | overrideIdentifier}}.fromMap(res.data){% else %} res.data{% endif %}; From b39a7e61a2d08b61855d8c03444d5ccc58547b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 28 Jun 2022 10:12:20 +0000 Subject: [PATCH 125/555] Rename file to filename --- templates/deno/src/inputFile.ts.twig | 18 +++++++++--------- templates/deno/src/services/service.ts.twig | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/templates/deno/src/inputFile.ts.twig b/templates/deno/src/inputFile.ts.twig index 0d3865fa48..7863a5a558 100644 --- a/templates/deno/src/inputFile.ts.twig +++ b/templates/deno/src/inputFile.ts.twig @@ -12,31 +12,31 @@ const _bufferToString = (buffer: Uint8Array): ReadableStream => { export class InputFile { stream: ReadableStream; // Content of file as a stream size: number; // Total final size of the file content - name: string; // File name + filename: string; // File name - static fromPath = (filePath: string, name: string): InputFile => { + static fromPath = (filePath: string, filename: string): InputFile => { const file = Deno.openSync(filePath); const stream = readableStreamFromReader(file); const size = Deno.statSync(filePath).size; - return new InputFile(stream, name, size); + return new InputFile(stream, filename, size); }; - static fromBuffer = (buffer: Uint8Array, name: string): InputFile => { + static fromBuffer = (buffer: Uint8Array, filename: string): InputFile => { const stream = _bufferToString(buffer); const size = buffer.byteLength; - return new InputFile(stream, name, size); + return new InputFile(stream, filename, size); }; - static fromPlainText = (content: string, name: string): InputFile => { + static fromPlainText = (content: string, filename: string): InputFile => { const buffer = new TextEncoder().encode(content); const stream = _bufferToString(buffer); const size = buffer.byteLength; - return new InputFile(stream, name, size); + return new InputFile(stream, filename, size); }; - constructor(stream: ReadableStream, name: string, size: number) { + constructor(stream: ReadableStream, filename: string, size: number) { this.stream = stream; - this.name = name; + this.filename = filename; this.size = size; } } \ No newline at end of file diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index dd69120a8b..cc3dd1baaf 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -164,7 +164,7 @@ export class {{ service.name | caseUcfirst }} extends Service { headers['x-{{spec.title | caseLower }}-id'] = id; } - payload['{{ parameter.name }}'] = { type: 'file', file: new File([uploadableChunkTrimmed], {{ parameter.name | caseCamel | escapeKeyword }}.name), filename: {{ parameter.name | caseCamel | escapeKeyword }}.name }; + payload['{{ parameter.name }}'] = { type: 'file', file: new File([uploadableChunkTrimmed], {{ parameter.name | caseCamel | escapeKeyword }}.name), filename: {{ parameter.name | caseCamel | escapeKeyword }}.filename }; response = await this.client.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); From 23a894592d0f7f6dee5870edd0b1fa07c6cb0508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 28 Jun 2022 10:31:44 +0000 Subject: [PATCH 126/555] Rename file to filename --- templates/deno/src/services/service.ts.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index cc3dd1baaf..5e12647025 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -164,7 +164,7 @@ export class {{ service.name | caseUcfirst }} extends Service { headers['x-{{spec.title | caseLower }}-id'] = id; } - payload['{{ parameter.name }}'] = { type: 'file', file: new File([uploadableChunkTrimmed], {{ parameter.name | caseCamel | escapeKeyword }}.name), filename: {{ parameter.name | caseCamel | escapeKeyword }}.filename }; + payload['{{ parameter.name }}'] = { type: 'file', file: new File([uploadableChunkTrimmed], {{ parameter.name | caseCamel | escapeKeyword }}.filename), filename: {{ parameter.name | caseCamel | escapeKeyword }}.filename }; response = await this.client.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); From ef502e1ad53a98de79a646011df2c0dd30f38c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 28 Jun 2022 10:35:12 +0000 Subject: [PATCH 127/555] Fix node var names --- templates/node/lib/inputFile.js.twig | 26 ++++++++++----------- templates/node/lib/services/service.js.twig | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/templates/node/lib/inputFile.js.twig b/templates/node/lib/inputFile.js.twig index c0ba0c99b9..d4b5fcf60d 100644 --- a/templates/node/lib/inputFile.js.twig +++ b/templates/node/lib/inputFile.js.twig @@ -5,41 +5,41 @@ const { promisify } = require('util'); class InputFile { stream; // Content of file, readable stream size; // Total final size of the file content - name; // File name + filename; // File name - static fromPath = (filePath, name) => { + static fromPath = (filePath, filename) => { const stream = fs.createReadStream(filePath); const { size } = fs.statSync(filePath); - return new InputFile(stream, name, size); + return new InputFile(stream, filename, size); }; - static fromBuffer = (buffer, name) => { + static fromBuffer = (buffer, filename) => { const stream = Readable.from(buffer.toString()); const size = Buffer.byteLength(buffer); - return new InputFile(stream, name, size); + return new InputFile(stream, filename, size); }; - static fromBlob = (blob, name) => { + static fromBlob = (blob, filename) => { const buffer = blob.arrayBuffer(); const stream = Readable.from(buffer.toString()); const size = Buffer.byteLength(buffer); - return new InputFile(stream, name); + return new InputFile(stream, filename); }; - static fromStream = (stream, name, size) => { - return new InputFile(stream, name, size); + static fromStream = (stream, filename, size) => { + return new InputFile(stream, filename, size); }; - static fromPlainText = (content, name) => { + static fromPlainText = (content, filename) => { const buffer = Buffer.from(content, "utf-8"); const stream = Readable.from(buffer.toString()); const size = Buffer.byteLength(buffer); - return new InputFile(stream, name, size); + return new InputFile(stream, filename, size); }; - constructor(stream, name, size) { + constructor(stream, filename, size) { this.stream = stream; - this.name = name; + this.filename = filename; this.size = size; } } diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 4573216e15..4d993dcc09 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -133,7 +133,7 @@ class {{ service.name | caseUcfirst }} extends Service { } const stream = Stream.Readable.from(currentChunk); - payload['{{ parameter.name }}'] = { type: 'file', file: stream, filename: file.name }; + payload['{{ parameter.name }}'] = { type: 'file', file: stream, filename: file.filename }; response = await selfClient.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); From c3d05add92327f89c0eb42d38c868fe80cdf0f63 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 28 Jun 2022 10:36:38 +0000 Subject: [PATCH 128/555] fix named parameters --- templates/dart/docs/example.md.twig | 4 ++-- templates/flutter/docs/example.md.twig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/dart/docs/example.md.twig b/templates/dart/docs/example.md.twig index 6c0ca9a1d5..77e0462c75 100644 --- a/templates/dart/docs/example.md.twig +++ b/templates/dart/docs/example.md.twig @@ -5,7 +5,7 @@ import 'package:{{ language.params.packageName }}/{{ language.params.packageName void main() { // Init SDK Client client = Client(); - {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = {{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); + {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = {{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter.name | caseCamel | overrideIdentifier }}: {{ parameter | paramExample }}{% endfor %}{% endif %}); {% if method.security|length > 0 %} client @@ -22,7 +22,7 @@ void main() { // Init SDK {% endif %} {% if parameter.required %} - {{ parameter.name | caseCamel }}: {{ parameter | paramExample | replace({'': (parameter.name | caseCamel) }) | raw }}, + {{ parameter.name | caseCamel | overrideIdentifier }}: {{ parameter | paramExample | replace({'': (parameter.name | caseCamel) }) | raw }}, {% endif %} {% endfor %}{% if method.parameters.all | filter((param) => not param.isGlobal) | length > 0 %} {% endif %}); diff --git a/templates/flutter/docs/example.md.twig b/templates/flutter/docs/example.md.twig index 7b95ace481..6ae4da7943 100644 --- a/templates/flutter/docs/example.md.twig +++ b/templates/flutter/docs/example.md.twig @@ -5,7 +5,7 @@ import 'package:{{ language.params.packageName }}/{{ language.params.packageName void main() { // Init SDK Client client = Client(); - {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = {{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); + {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = {{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter.name | caseCamel | overrideIdentifier }}: {{ parameter | paramExample }}{% endfor %}{% endif %}); {% if method.security|length > 0 %} client @@ -40,7 +40,7 @@ FutureBuilder( {% endif %} {% if parameter.required %} - {{ parameter.name | caseCamel }}: {{ parameter | paramExample }}, + {{ parameter.name | caseCamel | overrideIdentifier }}: {{ parameter | paramExample }}, {% endif %} {% endfor %}{% if method.parameters.all | filter((param) => not param.isGlobal) | length > 0 %} {% endif %} ), //works for both public file and private file, for private files you need to be logged in From a0c7e9d13549cf48f7139d52ce2954beab86a969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 28 Jun 2022 14:36:41 +0000 Subject: [PATCH 129/555] Fix file var name --- templates/node/lib/services/service.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 4d993dcc09..c0e32817ce 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -133,7 +133,7 @@ class {{ service.name | caseUcfirst }} extends Service { } const stream = Stream.Readable.from(currentChunk); - payload['{{ parameter.name }}'] = { type: 'file', file: stream, filename: file.filename }; + payload['{{ parameter.name }}'] = { type: 'file', file: stream, filename: '{{ parameter.name }}'.filename }; response = await selfClient.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); From 8d7ef135f430b2e753e0e9aac5376095586894fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 28 Jun 2022 16:52:24 +0200 Subject: [PATCH 130/555] Apply suggestions from code review Co-authored-by: Torsten Dittmann --- templates/node/lib/services/service.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index c0e32817ce..9fba248cfe 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -133,7 +133,7 @@ class {{ service.name | caseUcfirst }} extends Service { } const stream = Stream.Readable.from(currentChunk); - payload['{{ parameter.name }}'] = { type: 'file', file: stream, filename: '{{ parameter.name }}'.filename }; + payload['{{ parameter.name }}'] = { type: 'file', file: stream, filename: {{ parameter.name }}.filename }; response = await selfClient.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); From 60cc70e0b2445b211b1a3b877fd65eaaaf16b45f Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 28 Jun 2022 15:53:02 +0000 Subject: [PATCH 131/555] Initial commit --- templates/node/base/requests/api.twig | 0 templates/node/base/requests/file.twig | 0 templates/node/base/requests/location.twig | 0 templates/node/base/utils.twig | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 templates/node/base/requests/api.twig create mode 100644 templates/node/base/requests/file.twig create mode 100644 templates/node/base/requests/location.twig create mode 100644 templates/node/base/utils.twig diff --git a/templates/node/base/requests/api.twig b/templates/node/base/requests/api.twig new file mode 100644 index 0000000000..e69de29bb2 diff --git a/templates/node/base/requests/file.twig b/templates/node/base/requests/file.twig new file mode 100644 index 0000000000..e69de29bb2 diff --git a/templates/node/base/requests/location.twig b/templates/node/base/requests/location.twig new file mode 100644 index 0000000000..e69de29bb2 diff --git a/templates/node/base/utils.twig b/templates/node/base/utils.twig new file mode 100644 index 0000000000..e69de29bb2 From ef56d82ad3de00698c724239690802bf6481b00d Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 28 Jun 2022 16:31:46 +0000 Subject: [PATCH 132/555] separate api call from node sdk --- templates/node/base/requests/api.twig | 8 ++++++++ templates/node/lib/services/service.js.twig | 14 ++------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/templates/node/base/requests/api.twig b/templates/node/base/requests/api.twig index e69de29bb2..387261cf8d 100644 --- a/templates/node/base/requests/api.twig +++ b/templates/node/base/requests/api.twig @@ -0,0 +1,8 @@ +return await this.client.call('{{ method.method | caseLower }}', path, { +{% for parameter in method.parameters.header %} + '{{ parameter.name }}': ${{ parameter.name | caseCamel | escapeKeyword }}, +{% endfor %} +{% for key, header in method.headers %} + '{{ key }}': '{{ header }}', +{% endfor %} + }, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); \ No newline at end of file diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 9fba248cfe..505c0bdab8 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -211,18 +211,8 @@ class {{ service.name | caseUcfirst }} extends Service { }); {% endif %} {% endfor %} -{% else %} - return await this.client.call('{{ method.method | caseLower }}', path, { -{% for parameter in method.parameters.header %} - '{{ parameter.name }}': ${{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}': '{{ header }}', -{% endfor %} - }, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); -{% endif %} - } -{% endfor %} +{# api section #} + } } module.exports = {{ service.name | caseUcfirst }}; \ No newline at end of file From f6fa901c2f08643c56ef1440cc369ed0d9997035 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 29 Jun 2022 00:48:05 +0000 Subject: [PATCH 133/555] analyzer fixes and package updates --- templates/dart/lib/package.dart.twig | 2 -- templates/dart/lib/src/client.dart.twig | 1 - templates/dart/pubspec.yaml.twig | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/templates/dart/lib/package.dart.twig b/templates/dart/lib/package.dart.twig index 669717f72a..6e550eae40 100644 --- a/templates/dart/lib/package.dart.twig +++ b/templates/dart/lib/package.dart.twig @@ -2,14 +2,12 @@ library {{ language.params.packageName }}; import 'dart:async'; import 'dart:typed_data'; -import 'package:http/http.dart' show MultipartFile; import 'src/enums.dart'; import 'src/client.dart'; import 'src/service.dart'; import 'src/input_file.dart'; import 'src/upload_progress.dart'; import 'models.dart' as models; -import 'src/exception.dart'; export 'src/response.dart'; export 'src/client.dart'; diff --git a/templates/dart/lib/src/client.dart.twig b/templates/dart/lib/src/client.dart.twig index 774335f20b..4176700350 100644 --- a/templates/dart/lib/src/client.dart.twig +++ b/templates/dart/lib/src/client.dart.twig @@ -3,7 +3,6 @@ import 'client_stub.dart' if (dart.library.html) 'client_browser.dart' if (dart.library.io) 'client_io.dart'; import 'response.dart'; -import 'input_file.dart'; import 'upload_progress.dart'; abstract class Client { diff --git a/templates/dart/pubspec.yaml.twig b/templates/dart/pubspec.yaml.twig index 1c37b4f7e4..f7e8ad2c03 100644 --- a/templates/dart/pubspec.yaml.twig +++ b/templates/dart/pubspec.yaml.twig @@ -12,4 +12,4 @@ dependencies: dev_dependencies: test: ^1.16.8 - lints: ^1.0.1 \ No newline at end of file + lints: ^2.0.0 \ No newline at end of file From 3181786a2c7d9ab84936a9dfe7ab0d64697f069b Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 29 Jun 2022 00:58:41 +0000 Subject: [PATCH 134/555] update lint and fix analyzer comments --- templates/flutter/lib/package.dart.twig | 3 --- templates/flutter/pubspec.yaml.twig | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/templates/flutter/lib/package.dart.twig b/templates/flutter/lib/package.dart.twig index 5c08f82eee..c7a935ca73 100644 --- a/templates/flutter/lib/package.dart.twig +++ b/templates/flutter/lib/package.dart.twig @@ -2,15 +2,12 @@ library {{ language.params.packageName }}; import 'dart:async'; import 'dart:typed_data'; -import 'package:flutter/foundation.dart'; -import 'package:http/http.dart' show MultipartFile; import 'src/enums.dart'; import 'src/client.dart'; import 'src/service.dart'; import 'src/input_file.dart'; import 'models.dart' as models; import 'src/upload_progress.dart'; -import 'src/exception.dart'; export 'src/response.dart'; export 'src/client.dart'; diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 8eca71c61a..0ee2f23ad7 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -19,6 +19,6 @@ dependencies: web_socket_channel: ^2.2.0 dev_dependencies: - flutter_lints: ^1.0.4 + flutter_lints: ^2.0.1 flutter_test: sdk: flutter From 1ba18e8c69cf6d9823b181cab858a28b49e55cfa Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Wed, 29 Jun 2022 11:59:08 +0000 Subject: [PATCH 135/555] Break down node templates --- templates/node/base/params.twig | 8 ++ templates/node/base/requests/file.twig | 131 ++++++++++++++++++ templates/node/base/utils.twig | 0 templates/node/lib/services/service.js.twig | 141 +------------------- 4 files changed, 141 insertions(+), 139 deletions(-) create mode 100644 templates/node/base/params.twig delete mode 100644 templates/node/base/utils.twig diff --git a/templates/node/base/params.twig b/templates/node/base/params.twig new file mode 100644 index 0000000000..8a75e3446b --- /dev/null +++ b/templates/node/base/params.twig @@ -0,0 +1,8 @@ +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% if parameter.required %} + if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { + throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); + } + +{% endif %} +{% endfor %} \ No newline at end of file diff --git a/templates/node/base/requests/file.twig b/templates/node/base/requests/file.twig index e69de29bb2..81dd9baa5b 100644 --- a/templates/node/base/requests/file.twig +++ b/templates/node/base/requests/file.twig @@ -0,0 +1,131 @@ +{% for parameter in method.parameters.all %} +{% if parameter.type == 'file' %} + const size = {{ parameter.name | caseCamel | escapeKeyword }}.size; + + const headers = { +{% for parameter in method.parameters.header %} + '{{ parameter.name }}': ${{ parameter.name | caseCamel | escapeKeyword }}, +{% endfor %} +{% for key, header in method.headers %} + '{{ key }}': '{{ header }}', +{% endfor %} + }; + + let id = undefined; + let response = undefined; + + let chunksUploaded = 0; + +{% for parameter in method.parameters.all %} +{% if parameter.isUploadID %} + if({{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { + try { + response = await this.client.call('get', path + '/' + {{ parameter.name }}, headers); + chunksUploaded = response.chunksUploaded; + } catch(e) { + } + } +{% endif %} +{% endfor %} + + let currentChunk = Buffer.from(''); + let currentChunkSize = 0; + let currentChunkStart = 0; + + const selfClient = this.client; + + async function uploadChunk(lastUpload = false) { + if(chunksUploaded - 1 >= currentChunkStart / client.CHUNK_SIZE) { + return; + } + + const start = currentChunkStart; + const end = Math.min(((start + client.CHUNK_SIZE) - 1), size); + + if(!lastUpload || currentChunkStart !== 0) { + headers['content-range'] = 'bytes ' + start + '-' + end + '/' + size; + } + + if (id) { + headers['x-{{spec.title | caseLower }}-id'] = id; + } + + const stream = Stream.Readable.from(currentChunk); + payload['{{ parameter.name }}'] = { type: 'file', file: stream, filename: {{ parameter.name }}.filename }; + + response = await selfClient.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); + + if (!id) { + id = response['$id']; + } + + if (onProgress !== null) { + onProgress({ + $id: response['$id'], + progress: Math.min((start+client.CHUNK_SIZE) * client.CHUNK_SIZE, size) / size * 100, + sizeUploaded: end+1, + chunksTotal: response['chunksTotal'], + chunksUploaded: response['chunksUploaded'] + }); + } + + currentChunkStart += client.CHUNK_SIZE; + } + + return await new Promise((resolve, reject) => { + const writeStream = new Stream.Writable(); + writeStream._write = async (mainChunk, encoding, next) => { + // Segment incoming chunk into up to 5MB chunks + const mainChunkSize = Buffer.byteLength(mainChunk); + const chunksCount = Math.ceil(mainChunkSize / client.CHUNK_SIZE); + const chunks = []; + + for(let i = 0; i < chunksCount; i++) { + const chunk = mainChunk.slice(i * client.CHUNK_SIZE, client.CHUNK_SIZE); + chunks.push(chunk); + } + + for (const chunk of chunks) { + const chunkSize = Buffer.byteLength(chunk); + + if(chunkSize + currentChunkSize == client.CHUNK_SIZE) { + // Upload chunk + currentChunk = Buffer.concat([currentChunk, chunk]); + await uploadChunk(); + currentChunk = Buffer.from(''); + currentChunkSize = 0; + } else if(chunkSize + currentChunkSize > client.CHUNK_SIZE) { + // Upload chunk, put rest into next chunk + const bytesToUpload = client.CHUNK_SIZE - currentChunkSize; + const newChunkSection = chunk.slice(0, bytesToUpload); + currentChunk = Buffer.concat([currentChunk, newChunkSection]); + currentChunkSize = Buffer.byteLength(currentChunk); + await uploadChunk(); + currentChunk = chunk.slice(bytesToUpload, undefined); + currentChunkSize = chunkSize - bytesToUpload; + } else { + // Append into current chunk + currentChunk = Buffer.concat([currentChunk, chunk]); + currentChunkSize = chunkSize + currentChunkSize; + } + } + + next(); + } + + writeStream.on("finish", async () => { + if(currentChunkSize > 0) { + await uploadChunk(true); + } + + resolve(response); + }); + + writeStream.on("error", (err) => { + reject(err); + }); + + {{ parameter.name | caseCamel | escapeKeyword }}.stream.pipe(writeStream); + }); +{% endif %} +{% endfor %} \ No newline at end of file diff --git a/templates/node/base/utils.twig b/templates/node/base/utils.twig deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 505c0bdab8..8c2f3fa938 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -56,14 +56,7 @@ class {{ service.name | caseUcfirst }} extends Service { * @returns {Promise} */ async {{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = () => {}{% endif %}) { -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} -{% if parameter.required %} - if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { - throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); - } - -{% endif %} -{% endfor %} +{# modified params section #} let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; let payload = {}; {% for parameter in method.parameters.query %} @@ -80,137 +73,7 @@ class {{ service.name | caseUcfirst }} extends Service { {% endfor %} {% if 'multipart/form-data' in method.consumes %} -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - const size = {{ parameter.name | caseCamel | escapeKeyword }}.size; - - const headers = { -{% for parameter in method.parameters.header %} - '{{ parameter.name }}': ${{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}': '{{ header }}', -{% endfor %} - }; - - let id = undefined; - let response = undefined; - - let chunksUploaded = 0; - -{% for parameter in method.parameters.all %} -{% if parameter.isUploadID %} - if({{ parameter.name | caseCamel | escapeKeyword }} != 'unique()') { - try { - response = await this.client.call('get', path + '/' + {{ parameter.name }}, headers); - chunksUploaded = response.chunksUploaded; - } catch(e) { - } - } -{% endif %} -{% endfor %} - - let currentChunk = Buffer.from(''); - let currentChunkSize = 0; - let currentChunkStart = 0; - - const selfClient = this.client; - - async function uploadChunk(lastUpload = false) { - if(chunksUploaded - 1 >= currentChunkStart / client.CHUNK_SIZE) { - return; - } - - const start = currentChunkStart; - const end = Math.min(((start + client.CHUNK_SIZE) - 1), size); - - if(!lastUpload || currentChunkStart !== 0) { - headers['content-range'] = 'bytes ' + start + '-' + end + '/' + size; - } - - if (id) { - headers['x-{{spec.title | caseLower }}-id'] = id; - } - - const stream = Stream.Readable.from(currentChunk); - payload['{{ parameter.name }}'] = { type: 'file', file: stream, filename: {{ parameter.name }}.filename }; - - response = await selfClient.call('{{ method.method | caseLower }}', path, headers, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); - - if (!id) { - id = response['$id']; - } - - if (onProgress !== null) { - onProgress({ - $id: response['$id'], - progress: Math.min((start+client.CHUNK_SIZE) * client.CHUNK_SIZE, size) / size * 100, - sizeUploaded: end+1, - chunksTotal: response['chunksTotal'], - chunksUploaded: response['chunksUploaded'] - }); - } - - currentChunkStart += client.CHUNK_SIZE; - } - - return await new Promise((resolve, reject) => { - const writeStream = new Stream.Writable(); - writeStream._write = async (mainChunk, encoding, next) => { - // Segment incoming chunk into up to 5MB chunks - const mainChunkSize = Buffer.byteLength(mainChunk); - const chunksCount = Math.ceil(mainChunkSize / client.CHUNK_SIZE); - const chunks = []; - - for(let i = 0; i < chunksCount; i++) { - const chunk = mainChunk.slice(i * client.CHUNK_SIZE, client.CHUNK_SIZE); - chunks.push(chunk); - } - - for (const chunk of chunks) { - const chunkSize = Buffer.byteLength(chunk); - - if(chunkSize + currentChunkSize == client.CHUNK_SIZE) { - // Upload chunk - currentChunk = Buffer.concat([currentChunk, chunk]); - await uploadChunk(); - currentChunk = Buffer.from(''); - currentChunkSize = 0; - } else if(chunkSize + currentChunkSize > client.CHUNK_SIZE) { - // Upload chunk, put rest into next chunk - const bytesToUpload = client.CHUNK_SIZE - currentChunkSize; - const newChunkSection = chunk.slice(0, bytesToUpload); - currentChunk = Buffer.concat([currentChunk, newChunkSection]); - currentChunkSize = Buffer.byteLength(currentChunk); - await uploadChunk(); - currentChunk = chunk.slice(bytesToUpload, undefined); - currentChunkSize = chunkSize - bytesToUpload; - } else { - // Append into current chunk - currentChunk = Buffer.concat([currentChunk, chunk]); - currentChunkSize = chunkSize + currentChunkSize; - } - } - - next(); - } - - writeStream.on("finish", async () => { - if(currentChunkSize > 0) { - await uploadChunk(true); - } - - resolve(response); - }); - - writeStream.on("error", (err) => { - reject(err); - }); - - {{ parameter.name | caseCamel | escapeKeyword }}.stream.pipe(writeStream); - }); -{% endif %} -{% endfor %} +{# file section #} {# api section #} } } From ac7a452797146d5f82fa488e8e616746c7b6034c Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Wed, 29 Jun 2022 12:16:12 +0000 Subject: [PATCH 136/555] separte location.twig from service.js.twig --- templates/node/base/requests/api.twig | 2 +- templates/node/base/requests/location.twig | 1 + templates/node/lib/services/service.js.twig | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/node/base/requests/api.twig b/templates/node/base/requests/api.twig index 387261cf8d..5291562744 100644 --- a/templates/node/base/requests/api.twig +++ b/templates/node/base/requests/api.twig @@ -5,4 +5,4 @@ return await this.client.call('{{ method.method | caseLower }}', path, { {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} - }, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); \ No newline at end of file + }, payload{# location check #}); \ No newline at end of file diff --git a/templates/node/base/requests/location.twig b/templates/node/base/requests/location.twig index e69de29bb2..3eead2f58c 100644 --- a/templates/node/base/requests/location.twig +++ b/templates/node/base/requests/location.twig @@ -0,0 +1 @@ +{% if method.type == 'location' %}, 'arraybuffer'{% endif %} \ No newline at end of file diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 8c2f3fa938..14b19dc272 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -75,6 +75,7 @@ class {{ service.name | caseUcfirst }} extends Service { {% if 'multipart/form-data' in method.consumes %} {# file section #} {# api section #} +{% endif %} } } From 2b9f0cb56c06756f5b0b8a14b7c50b99a598d7d8 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Wed, 29 Jun 2022 12:17:06 +0000 Subject: [PATCH 137/555] fix file formatting --- templates/node/base/params.twig | 2 +- templates/node/base/requests/api.twig | 2 +- templates/node/base/requests/file.twig | 2 +- templates/node/base/requests/location.twig | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/node/base/params.twig b/templates/node/base/params.twig index 8a75e3446b..2ac61ac2cb 100644 --- a/templates/node/base/params.twig +++ b/templates/node/base/params.twig @@ -5,4 +5,4 @@ } {% endif %} -{% endfor %} \ No newline at end of file +{% endfor %} diff --git a/templates/node/base/requests/api.twig b/templates/node/base/requests/api.twig index 5291562744..1a9891bbf7 100644 --- a/templates/node/base/requests/api.twig +++ b/templates/node/base/requests/api.twig @@ -5,4 +5,4 @@ return await this.client.call('{{ method.method | caseLower }}', path, { {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} - }, payload{# location check #}); \ No newline at end of file + }, payload{# location check #}); diff --git a/templates/node/base/requests/file.twig b/templates/node/base/requests/file.twig index 81dd9baa5b..80ca5faaaa 100644 --- a/templates/node/base/requests/file.twig +++ b/templates/node/base/requests/file.twig @@ -128,4 +128,4 @@ {{ parameter.name | caseCamel | escapeKeyword }}.stream.pipe(writeStream); }); {% endif %} -{% endfor %} \ No newline at end of file +{% endfor %} diff --git a/templates/node/base/requests/location.twig b/templates/node/base/requests/location.twig index 3eead2f58c..97f408aa98 100644 --- a/templates/node/base/requests/location.twig +++ b/templates/node/base/requests/location.twig @@ -1 +1 @@ -{% if method.type == 'location' %}, 'arraybuffer'{% endif %} \ No newline at end of file +{% if method.type == 'location' %}, 'arraybuffer'{% endif %} From c75aa6fc6265c5669fd81737e177d48c79bb1342 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Wed, 29 Jun 2022 12:18:53 +0000 Subject: [PATCH 138/555] fix file formatting --- templates/node/lib/services/service.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 14b19dc272..0c2cbeb33f 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -79,4 +79,4 @@ class {{ service.name | caseUcfirst }} extends Service { } } -module.exports = {{ service.name | caseUcfirst }}; \ No newline at end of file +module.exports = {{ service.name | caseUcfirst }}; From 48834f4e503d0d3b0b36760ce30ad8f3a9da0f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 29 Jun 2022 14:11:02 +0000 Subject: [PATCH 139/555] Fix get methods, and d.ts docs --- templates/deno/src/services/service.ts.twig | 2 +- templates/node/index.d.ts.twig | 39 +++++++++++++++++++-- templates/node/lib/services/service.js.twig | 2 +- templates/web/src/services/template.ts.twig | 2 +- 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index 5e12647025..ed0ce24890 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -48,7 +48,7 @@ export class {{ service.name | caseUcfirst }} extends Service { { this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; } - public get{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}): {{ parameter.type | typeName }} + public get{{ parameter.name | caseUcfirst | escapeKeyword }}(): {{ parameter.type | typeName }} { return this.{{ parameter.name | caseCamel | escapeKeyword }}; } diff --git a/templates/node/index.d.ts.twig b/templates/node/index.d.ts.twig index d98603cf6c..ecc100f148 100644 --- a/templates/node/index.d.ts.twig +++ b/templates/node/index.d.ts.twig @@ -1,3 +1,5 @@ +import { InputFile } from "./lib/inputFile"; + {% macro sub_schema(property, definition, spec) %} {% apply spaceless %} {% if property.sub_schema %} @@ -126,6 +128,18 @@ declare module "{{ language.params.npmPackage|caseDash }}" { constructor(client: Client); } + export class InputFile { + static fromPath(filePath: string, filename: string): InputFile; + + static fromBuffer(buffer: Buffer, filename: string): InputFile; + + static fromBlob(blob: Blob, filename: string): InputFile; + + static fromStream(stream: any, filename: string, size: number): InputFile; + + static fromPlainText(content: string, filename: string): InputFile; + } + type QueryTypesSingle = string | number | boolean; type QueryTypesList = string[] | number[] | boolean[]; type QueryTypes = QueryTypesSingle | QueryTypesList; @@ -152,6 +166,27 @@ declare module "{{ language.params.npmPackage|caseDash }}" { {% for service in spec.services %} export class {{ service.name | caseUcfirst }} extends Service { + constructor(client: Client{% for parameter in service.globalParams %}, {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}{% if not parameter.required %}|null{% endif %}{% endfor %}); + +{% if service.globalParams | length %} +{% for parameter in service.globalParams %} + /** + * Get {{ parameter.name }}. + * + * @returns {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} + */ + get{{ parameter.name | caseUcfirst | escapeKeyword }}(): {{ parameter.type | typeName }}; + + /** + * Set {{ parameter.name }}. + * + * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} + * @returns {void} + */ + set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}): void; + +{% endfor %} +{% endif %} {% for method in service.methods %} {% set generics = _self.get_generics_method(spec.definitions[method.responseModel], spec, true, true) %} {% set generics_return = _self.get_generics_method_return(spec.definitions[method.responseModel], spec) %} @@ -162,13 +197,13 @@ declare module "{{ language.params.npmPackage|caseDash }}" { {{ method.description|comment1 }} * {% endif %} -{% for parameter in method.parameters.all %} +{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel }} {% endfor %} * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {Promise} */ - {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}): Promise<{% if method.type == 'location' %}Buffer{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}>; + {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}): Promise<{% if method.type == 'location' %}Buffer{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}>; {% endfor %} } {% endfor %} diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 9fba248cfe..03443422b1 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -26,7 +26,7 @@ class {{ service.name | caseUcfirst }} extends Service { * * @return {{ parameter.type | typeName }} */ - get{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}) + get{{ parameter.name | caseUcfirst | escapeKeyword }}() { return this.{{ parameter.name | caseCamel | escapeKeyword }}; } diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index d74e2d5635..6f15944953 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -15,7 +15,7 @@ export class {{ service.name | caseUcfirst }} extends Service { { this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; } - public get{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}): {{ parameter.type | typeName }} + public get{{ parameter.name | caseUcfirst | escapeKeyword }}(): {{ parameter.type | typeName }} { return this.{{ parameter.name | caseCamel | escapeKeyword }}; } From faeb98817477451d7eb3a39af01b40a8f95eeef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 29 Jun 2022 14:12:25 +0000 Subject: [PATCH 140/555] Cleanup --- templates/node/index.d.ts.twig | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/node/index.d.ts.twig b/templates/node/index.d.ts.twig index ecc100f148..fee304ac0e 100644 --- a/templates/node/index.d.ts.twig +++ b/templates/node/index.d.ts.twig @@ -1,5 +1,3 @@ -import { InputFile } from "./lib/inputFile"; - {% macro sub_schema(property, definition, spec) %} {% apply spaceless %} {% if property.sub_schema %} From f986926c3b83f5a18714c0b076020af6a3ce505e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 30 Jun 2022 14:29:25 +1200 Subject: [PATCH 141/555] Fix InputFile example docs for PHP, Node & Deno --- src/SDK/Language/Deno.php | 4 ++-- src/SDK/Language/Node.php | 4 ++-- src/SDK/Language/PHP.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SDK/Language/Deno.php b/src/SDK/Language/Deno.php index 1912daf419..31ddbb7a8c 100644 --- a/src/SDK/Language/Deno.php +++ b/src/SDK/Language/Deno.php @@ -151,7 +151,7 @@ public function getParamExample(array $param) $output .= '{}'; break; case self::TYPE_FILE: - $output .= "'file.png'"; + $output .= "InputFile.fromPath('/path/to/file.png', 'file.png')"; break; } } @@ -170,7 +170,7 @@ public function getParamExample(array $param) $output .= "'{$example}'"; break; case self::TYPE_FILE: - $output .= "'file.png'"; + $output .= "InputFile.fromPath('/path/to/file.png', 'file.png')"; break; } } diff --git a/src/SDK/Language/Node.php b/src/SDK/Language/Node.php index 4d932e5b6f..62f9ea5ffc 100644 --- a/src/SDK/Language/Node.php +++ b/src/SDK/Language/Node.php @@ -154,7 +154,7 @@ public function getParamExample(array $param) $output .= '{}'; break; case self::TYPE_FILE: - $output .= "'file.png'"; + $output .= "InputFile.fromPath('/path/to/file.png', 'file.png')"; break; } } @@ -173,7 +173,7 @@ public function getParamExample(array $param) $output .= "'{$example}'"; break; case self::TYPE_FILE: - $output .= "'file.png'"; + $output .= "InputFile.fromPath('/path/to/file.png', 'file.png')"; break; } } diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index 3cfe60f561..fd7b94db1d 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -316,7 +316,7 @@ public function getParamExample(array $param) $output .= '[]'; break; case self::TYPE_FILE: - $output .= "'file.png'"; + $output .= "InputFile::withPath('file.png')"; break; } } @@ -337,7 +337,7 @@ public function getParamExample(array $param) $output .= "'{$example}'"; break; case self::TYPE_FILE: - $output .= "'file.png'"; + $output .= "InputFile::withPath('file.png')"; break; } } From 82b519544a9778336f80353d8f714ec7a68a48d5 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 30 Jun 2022 12:27:59 +0000 Subject: [PATCH 142/555] refactor params.twig --- templates/node/base/params.twig | 15 +++++++++++++++ templates/node/lib/services/service.js.twig | 14 +------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/templates/node/base/params.twig b/templates/node/base/params.twig index 2ac61ac2cb..e850b8ce45 100644 --- a/templates/node/base/params.twig +++ b/templates/node/base/params.twig @@ -1,3 +1,5 @@ +let payload = {}; +{% if method.parameters.all | length %} {% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if parameter.required %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { @@ -6,3 +8,16 @@ {% endif %} {% endfor %} +{% for parameter in method.parameters.query %} + + if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; + } +{% endfor %} +{% for parameter in method.parameters.body %} + + if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword}}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; + } +{% endfor %} +{% endif %} \ No newline at end of file diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 0c2cbeb33f..0d307aeb25 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -58,19 +58,7 @@ class {{ service.name | caseUcfirst }} extends Service { async {{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = () => {}{% endif %}) { {# modified params section #} let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; - let payload = {}; -{% for parameter in method.parameters.query %} - - if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; - } -{% endfor %} -{% for parameter in method.parameters.body %} - - if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword}}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; - } -{% endfor %} +{# modified params #} {% if 'multipart/form-data' in method.consumes %} {# file section #} From d08399a8faf182171182e2f78cb4cbf5d8042305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 30 Jun 2022 12:40:10 +0000 Subject: [PATCH 143/555] Improve CLI after 0.15 --- composer.lock | 56 ++++++++++--------- example.php | 2 +- templates/cli/lib/commands/deploy.js.twig | 64 +++++++++++++++------- templates/cli/lib/commands/generic.js.twig | 4 +- templates/cli/lib/commands/init.js.twig | 58 ++++++++++++++------ templates/cli/lib/parser.js.twig | 2 +- templates/cli/lib/questions.js.twig | 46 +++++++++++++++- 7 files changed, 164 insertions(+), 68 deletions(-) diff --git a/composer.lock b/composer.lock index d776086ed4..b9935887aa 100644 --- a/composer.lock +++ b/composer.lock @@ -374,16 +374,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v6.5.0", + "version": "v6.5.1", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "d22afc08dab73d1dff07c700ed6a78f138f5020e" + "reference": "41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/d22afc08dab73d1dff07c700ed6a78f138f5020e", - "reference": "d22afc08dab73d1dff07c700ed6a78f138f5020e", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9", + "reference": "41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9", "shasum": "" }, "require": { @@ -412,7 +412,9 @@ "vimeo/psalm": "^4.23.0" }, "bin": [ - "bin/paratest" + "bin/paratest", + "bin/paratest.bat", + "bin/paratest_for_phpstorm" ], "type": "library", "autoload": { @@ -448,7 +450,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v6.5.0" + "source": "https://github.com/paratestphp/paratest/tree/v6.5.1" }, "funding": [ { @@ -460,7 +462,7 @@ "type": "paypal" } ], - "time": "2022-06-23T13:00:19+00:00" + "time": "2022-06-24T16:02:27+00:00" }, { "name": "doctrine/instantiator", @@ -2483,16 +2485,16 @@ }, { "name": "symfony/console", - "version": "v6.1.1", + "version": "v6.1.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6187424023fbffcd757789aeb517c9161b1eabee" + "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6187424023fbffcd757789aeb517c9161b1eabee", - "reference": "6187424023fbffcd757789aeb517c9161b1eabee", + "url": "https://api.github.com/repos/symfony/console/zipball/7a86c1c42fbcb69b59768504c7bca1d3767760b7", + "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7", "shasum": "" }, "require": { @@ -2559,7 +2561,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.1" + "source": "https://github.com/symfony/console/tree/v6.1.2" }, "funding": [ { @@ -2575,11 +2577,11 @@ "type": "tidelift" } ], - "time": "2022-06-08T14:02:09+00:00" + "time": "2022-06-26T13:01:30+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.1.0", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", @@ -2626,7 +2628,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.1" }, "funding": [ { @@ -2872,16 +2874,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.1.0", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "d66cd8ab656780f62c4215b903a420eb86358957" + "reference": "925e713fe8fcacf6bc05e936edd8dd5441a21239" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d66cd8ab656780f62c4215b903a420eb86358957", - "reference": "d66cd8ab656780f62c4215b903a420eb86358957", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/925e713fe8fcacf6bc05e936edd8dd5441a21239", + "reference": "925e713fe8fcacf6bc05e936edd8dd5441a21239", "shasum": "" }, "require": { @@ -2937,7 +2939,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.1.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.1.1" }, "funding": [ { @@ -2953,20 +2955,20 @@ "type": "tidelift" } ], - "time": "2022-05-07T08:07:09+00:00" + "time": "2022-05-30T19:18:58+00:00" }, { "name": "symfony/string", - "version": "v6.1.0", + "version": "v6.1.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529" + "reference": "1903f2879875280c5af944625e8246d81c2f0604" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/d3edc75baf9f1d4f94879764dda2e1ac33499529", - "reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529", + "url": "https://api.github.com/repos/symfony/string/zipball/1903f2879875280c5af944625e8246d81c2f0604", + "reference": "1903f2879875280c5af944625e8246d81c2f0604", "shasum": "" }, "require": { @@ -3022,7 +3024,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.0" + "source": "https://github.com/symfony/string/tree/v6.1.2" }, "funding": [ { @@ -3038,7 +3040,7 @@ "type": "tidelift" } ], - "time": "2022-04-22T08:18:23+00:00" + "time": "2022-06-26T16:35:04+00:00" }, { "name": "theseer/tokenizer", diff --git a/example.php b/example.php index 89d5a61b48..4b3fbc9097 100644 --- a/example.php +++ b/example.php @@ -183,7 +183,7 @@ function getSSLPage($url) { ->setTwitter('appwrite_io') ->setDiscord('564160730845151244', 'https://appwrite.io/discord') ->setDefaultHeaders([ - 'X-Appwrite-Response-Format' => '0.13.0', + 'X-Appwrite-Response-Format' => '0.15.0', ]) ; diff --git a/templates/cli/lib/commands/deploy.js.twig b/templates/cli/lib/commands/deploy.js.twig index a0d80516e3..561edeacd3 100644 --- a/templates/cli/lib/commands/deploy.js.twig +++ b/templates/cli/lib/commands/deploy.js.twig @@ -6,22 +6,24 @@ const { questionsDeployFunctions, questionsGetEntrypoint, questionsDeployCollect const { actionRunner, success, log, error, commandDescriptions } = require("../parser"); const { functionsGet, functionsCreate, functionsUpdate, functionsCreateDeployment, functionsUpdateDeployment } = require('./functions'); const { - databaseCreateBooleanAttribute, - databaseGetCollection, - databaseCreateCollection, - databaseCreateStringAttribute, - databaseCreateIntegerAttribute, - databaseCreateFloatAttribute, - databaseCreateEmailAttribute, - databaseCreateIndex, - databaseCreateUrlAttribute, - databaseCreateIpAttribute, - databaseCreateEnumAttribute, - databaseDeleteAttribute, - databaseListAttributes, - databaseListIndexes, - databaseDeleteIndex -} = require("./database"); + databasesCreateBooleanAttribute, + databasesGetCollection, + databasesCreateCollection, + databasesCreateStringAttribute, + databasesCreateIntegerAttribute, + databasesCreateFloatAttribute, + databasesCreateEmailAttribute, + databasesCreateIndex, + databasesCreateUrlAttribute, + databasesCreateIpAttribute, + databasesCreateEnumAttribute, + databasesDeleteAttribute, + databasesListAttributes, + databasesListIndexes, + databasesDeleteIndex +} = require("./databases"); + +// TODO: Add databaseId everywhere const POOL_DEBOUNCE = 2000; // in milliseconds const POOL_MAX_DEBOUNCES = 30; @@ -145,12 +147,34 @@ const deploy = new Command("deploy") await deployCollection() })); -const deployFunction = async () => { +const deployFunction = async ({ functionId, all } = {}) => { let response = {}; - let answers = await inquirer.prompt(questionsDeployFunctions) - let functions = answers.functions.map((func) => JSONbig.parse(func)) + const functionIds = []; + if(functionId) { + functionIds.push(functionId); + } else if(all) { + const functions = localConfig.getFunctions(); + if (functions.length === 0) { + throw new Error("No functions found in the current directory."); + } + functionIds.push(...functions.map((func, idx) => { + return func.$id; + })); + } + + if(functionIds.length <= 0) { + const answers = await inquirer.prompt(questionsDeployFunctions); + functionIds.push(...answers.functions); + } + + let functions = functionIds.map((id) => { + const functions = localConfig.getFunctions(); + const func = functions.find((f) => f.$id === id); + return JSONbig.stringify(func); + }); + for (let func of functions) { log(`Deploying function ${func.name} ( ${func['$id']} )`) @@ -466,6 +490,8 @@ const deployCollection = async () => { deploy .command("function") .description("Deploy functions in the current directory.") + .option(`--functionId `, `Function ID`) + .option(`--all`, `Flag to deploy all functions`) .action(actionRunner(deployFunction)); deploy diff --git a/templates/cli/lib/commands/generic.js.twig b/templates/cli/lib/commands/generic.js.twig index 581848f746..0195da2702 100644 --- a/templates/cli/lib/commands/generic.js.twig +++ b/templates/cli/lib/commands/generic.js.twig @@ -6,7 +6,7 @@ const { globalConfig, localConfig } = require("../config"); const { actionRunner, success, parseBool, commandDescriptions, log, parse } = require("../parser"); {% if sdk.test != "true" %} const { questionsLogin } = require("../questions"); -const { accountCreateSession, accountDeleteSession } = require("./account"); +const { accountCreateEmailSession, accountDeleteSession } = require("./account"); const login = new Command("login") .description(commandDescriptions['login']) @@ -15,7 +15,7 @@ const login = new Command("login") let client = await sdkForConsole(false); - await accountCreateSession({ + await accountCreateEmailSession({ email: answers.email, password: answers.password, parseOutput: false, diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index c7ea84ba9a..82648575fa 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -6,10 +6,10 @@ const inquirer = require("inquirer"); const { teamsCreate } = require("./teams"); const { projectsCreate } = require("./projects"); const { functionsCreate } = require("./functions"); -const { databaseListCollections } = require("./database"); +const { databasesListCollections, databasesList } = require("./databases"); const { sdkForConsole } = require("../sdks"); const { localConfig } = require("../config"); -const { questionsInitProject, questionsInitFunction } = require("../questions"); +const { questionsInitProject, questionsInitFunction, questionsInitCollection } = require("../questions"); const { success, log, actionRunner, commandDescriptions } = require("../parser"); const init = new Command("init") @@ -40,7 +40,7 @@ const initProject = async () => { let teamId = response['$id']; response = await projectsCreate({ - projectId: 'unique()', + projectId: answers.id, name: answers.project, teamId, parseOutput: false @@ -54,6 +54,7 @@ const initProject = async () => { } const initFunction = async () => { + // TODO: Add CI/CD support (ID, name, runtime) let answers = await inquirer.prompt(questionsInitFunction) if (fs.existsSync(path.join(process.cwd(), 'functions', answers.name))) { @@ -65,7 +66,7 @@ const initFunction = async () => { } let response = await functionsCreate({ - functionId: 'unique()', + functionId: answers.id, name: answers.name, runtime: answers.runtime.id, parseOutput: false @@ -110,20 +111,43 @@ const initFunction = async () => { success(); } -const initCollection = async () => { - // TODO: Pagination? - let response = await databaseListCollections({ - limit: 100, - parseOutput: false - }) +const initCollection = async ({ all, databaseId } = {}) => { + const databaseIds = []; + + console.log(all); - let collections = response.collections; - log(`Found ${collections.length} collections`); + if(databaseId) { + databaseIds.push(databaseId); + } else if(all) { + let allDatabases = await databasesList({ + parseOutput: false + }) + console.log(allDatabases); + databaseIds.push(...allDatabases.databases); + } + + if(databaseIds.length <= 0) { + let answers = await inquirer.prompt(questionsInitCollection) + if (!answers.databases) process.exit(1) + databaseIds.push(...answers.databases); + } - collections.forEach(async collection => { - log(`Fetching ${collection.name} ...`); - localConfig.addCollection(collection); - }); + for(const databaseId of databaseIds) { + // TODO: Pagination? + let response = await databasesListCollections({ + databaseId, + limit: 100, + parseOutput: false + }) + + let collections = response.collections; + log(`Found ${collections.length} collections`); + + collections.forEach(async collection => { + log(`Fetching ${collection.name} ...`); + localConfig.addCollection(collection); + }); + } success(); } @@ -141,6 +165,8 @@ init init .command("collection") .description("Initialise your {{ spec.title|caseUcfirst }} collections") + .option(`--databaseId `, `Database ID`) + .option(`--all`, `Flag to initialize all databases`) .action(actionRunner(initCollection)) module.exports = { diff --git a/templates/cli/lib/parser.js.twig b/templates/cli/lib/parser.js.twig index ced68e50d9..a96b8f707c 100644 --- a/templates/cli/lib/parser.js.twig +++ b/templates/cli/lib/parser.js.twig @@ -150,7 +150,7 @@ const logo = {{ language.params.logo | raw }}; const commandDescriptions = { "account": `The account command allows you to authenticate and manage a user account.`, "avatars": `The avatars command aims to help you complete everyday tasks related to your app image, icons, and avatars.`, - "database": `The database command allows you to create structured collections of documents, query and filter lists of documents.`, + "databases": `The databases command allows you to create structured collections of documents, query and filter lists of documents.`, "deploy": `The deploy command provides a convenient wrapper for deploying your functions and collections.`, "functions": `The functions command allows you view, create and manage your Cloud Functions.`, "health": `The health command allows you to both validate and monitor your {{ spec.title|caseUcfirst }} server's health.`, diff --git a/templates/cli/lib/questions.js.twig b/templates/cli/lib/questions.js.twig index bdab4fa05c..bc4927b63a 100644 --- a/templates/cli/lib/questions.js.twig +++ b/templates/cli/lib/questions.js.twig @@ -1,6 +1,7 @@ const { localConfig } = require('./config'); const { projectsList } = require('./commands/projects'); const { functionsListRuntimes } = require('./commands/functions'); +const { databasesList } = require('./commands/databases'); const JSONbig = require("json-bigint")({ storeAsString: false }); const getIgnores = (runtime) => { @@ -108,6 +109,15 @@ const questionsInitProject = [ return answers.start == "new"; }, }, + { + type: "input", + name: "id", + message: "What ID would you like to have for your project?", + default: "myAwesomeProject", + when(answers) { + return answers.start == "new"; + }, + }, { type: "list", name: "project", @@ -146,6 +156,12 @@ const questionsInitFunction = [ message: "What would you like to name your function?", default: "My Awesome Function" }, + { + type: "input", + name: "id", + message: "What ID would you like to have for your function?", + default: "myAwesomeFunction" + }, { type: "list", name: "runtime", @@ -166,6 +182,31 @@ const questionsInitFunction = [ } ]; +const questionsInitCollection = [ + { + type: "checkbox", + name: "databases", + message: "From which database would you like to init collections?", + choices: async () => { + let response = await databasesList({ + parseOutput: false + }) + let databases = response["databases"] + + if(databases.length <= 0) { + throw new Error("No databases found. Please create one in project console.") + } + let choices = databases.map((database, idx) => { + return { + name: `${database.name} (${database.$id})`, + value: database.$id + } + }) + return choices; + } + } +]; + const questionsLogin = [ { type: "input", @@ -204,8 +245,8 @@ const questionsDeployFunctions = [ } let choices = functions.map((func, idx) => { return { - name: `${func.name} (${func['$id']})`, - value: JSONbig.stringify(func) + name: `${func.name} (${func.$id})`, + value: func.$id } }) return choices; @@ -258,6 +299,7 @@ module.exports = { questionsInitProject, questionsLogin, questionsInitFunction, + questionsInitCollection, questionsDeployFunctions, questionsDeployCollections, questionsGetEntrypoint From 7d143f8e94868fdd773ec5beb1142fb0012a9219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 30 Jun 2022 12:50:25 +0000 Subject: [PATCH 144/555] Deprecate --all options --- templates/cli/lib/commands/deploy.js.twig | 14 ++------------ templates/cli/lib/commands/init.js.twig | 16 ++++------------ 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/templates/cli/lib/commands/deploy.js.twig b/templates/cli/lib/commands/deploy.js.twig index 561edeacd3..a496ccf110 100644 --- a/templates/cli/lib/commands/deploy.js.twig +++ b/templates/cli/lib/commands/deploy.js.twig @@ -133,18 +133,8 @@ const awaitPools = { const deploy = new Command("deploy") .description(commandDescriptions['deploy']) - .option("--all", "Flag to deploy collections and functions") - .action(actionRunner(async ({ all }, command) => { - if (all == undefined) { - command.help() - } - - try { - await deployFunction(); - } catch (e) { - error(e.message); - } - await deployCollection() + .action(actionRunner(async (_options, command) => { + command.help() })); const deployFunction = async ({ functionId, all } = {}) => { diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index 82648575fa..3b45d675e3 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -14,14 +14,8 @@ const { success, log, actionRunner, commandDescriptions } = require("../parser") const init = new Command("init") .description(commandDescriptions['init']) - .option("--all", "Flag to initialize projects and collection") - .action(actionRunner(async ({ all }, command) => { - if (all == undefined) { - command.help() - } - - await initProject(); - await initCollection() + .action(actionRunner(async (_options, command) => { + command.help(); })); const initProject = async () => { @@ -114,16 +108,14 @@ const initFunction = async () => { const initCollection = async ({ all, databaseId } = {}) => { const databaseIds = []; - console.log(all); - if(databaseId) { databaseIds.push(databaseId); } else if(all) { let allDatabases = await databasesList({ parseOutput: false }) - console.log(allDatabases); - databaseIds.push(...allDatabases.databases); + + databaseIds.push(...allDatabases.databases.map((d) => d.$id)); } if(databaseIds.length <= 0) { From 2fcb9029fa65c7ad54e5e370e9388e2bc746b6ab Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 30 Jun 2022 12:50:43 +0000 Subject: [PATCH 145/555] remove comments --- templates/node/base/requests/api.twig | 3 ++- templates/node/base/requests/location.twig | 1 - templates/node/lib/services/service.js.twig | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 templates/node/base/requests/location.twig diff --git a/templates/node/base/requests/api.twig b/templates/node/base/requests/api.twig index 1a9891bbf7..7f84bcecff 100644 --- a/templates/node/base/requests/api.twig +++ b/templates/node/base/requests/api.twig @@ -5,4 +5,5 @@ return await this.client.call('{{ method.method | caseLower }}', path, { {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} - }, payload{# location check #}); + }, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %} +); diff --git a/templates/node/base/requests/location.twig b/templates/node/base/requests/location.twig deleted file mode 100644 index 97f408aa98..0000000000 --- a/templates/node/base/requests/location.twig +++ /dev/null @@ -1 +0,0 @@ -{% if method.type == 'location' %}, 'arraybuffer'{% endif %} diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 0d307aeb25..b6cf95277a 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -56,15 +56,15 @@ class {{ service.name | caseUcfirst }} extends Service { * @returns {Promise} */ async {{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = () => {}{% endif %}) { -{# modified params section #} let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; -{# modified params #} - +{{ include ('node/base/params.twig')}} {% if 'multipart/form-data' in method.consumes %} -{# file section #} -{# api section #} +{{ include ('node/base/requests/file.twig)}} +{% else %} +{{ include('php/base/requests/api.twig') }} {% endif %} } +{% endfor %} } module.exports = {{ service.name | caseUcfirst }}; From 1d265faa61d96c848d5df7566ef0c9f8be00e26e Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 30 Jun 2022 12:58:17 +0000 Subject: [PATCH 146/555] format code --- templates/node/base/params.twig | 2 +- templates/node/lib/services/service.js.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/node/base/params.twig b/templates/node/base/params.twig index e850b8ce45..63d4103765 100644 --- a/templates/node/base/params.twig +++ b/templates/node/base/params.twig @@ -20,4 +20,4 @@ let payload = {}; payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword}}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; } {% endfor %} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index ab068676f4..c314015fa8 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -61,7 +61,7 @@ class {{ service.name | caseUcfirst }} extends Service { {% if 'multipart/form-data' in method.consumes %} {{ include ('node/base/requests/file.twig)}} {% else %} -{{ include('php/base/requests/api.twig') }} +{{ include('node/base/requests/api.twig') }} {% endif %} } {% endfor %} From 9909d586cf53e6c1760ce96a447de3871904c4aa Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 30 Jun 2022 13:03:06 +0000 Subject: [PATCH 147/555] remove small error --- templates/node/lib/services/service.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index c314015fa8..9618af9cff 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -59,7 +59,7 @@ class {{ service.name | caseUcfirst }} extends Service { let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; {{ include ('node/base/params.twig')}} {% if 'multipart/form-data' in method.consumes %} -{{ include ('node/base/requests/file.twig)}} +{{ include ('node/base/requests/file.twig')}} {% else %} {{ include('node/base/requests/api.twig') }} {% endif %} From 81ea3d1f045cf4dcada80c137fbf7abb4e6bcb1e Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 30 Jun 2022 13:13:03 +0000 Subject: [PATCH 148/555] formatting fixes --- templates/node/base/params.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/base/params.twig b/templates/node/base/params.twig index 63d4103765..610392905f 100644 --- a/templates/node/base/params.twig +++ b/templates/node/base/params.twig @@ -1,4 +1,4 @@ -let payload = {}; + let payload = {}; {% if method.parameters.all | length %} {% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if parameter.required %} From 451895ce61183564ce99375ed6244356636b0b3d Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 30 Jun 2022 13:26:34 +0000 Subject: [PATCH 149/555] formatting fixes --- templates/node/base/requests/api.twig | 5 ++--- templates/node/lib/services/service.js.twig | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/templates/node/base/requests/api.twig b/templates/node/base/requests/api.twig index 7f84bcecff..4b2e8c71fb 100644 --- a/templates/node/base/requests/api.twig +++ b/templates/node/base/requests/api.twig @@ -1,9 +1,8 @@ -return await this.client.call('{{ method.method | caseLower }}', path, { + await this.client.call('{{ method.method | caseLower }}', path, { {% for parameter in method.parameters.header %} '{{ parameter.name }}': ${{ parameter.name | caseCamel | escapeKeyword }}, {% endfor %} {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} - }, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %} -); + }, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 9618af9cff..6761cbbef1 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -63,7 +63,7 @@ class {{ service.name | caseUcfirst }} extends Service { {% else %} {{ include('node/base/requests/api.twig') }} {% endif %} - } + } {% endfor %} } From ec6888ef2afb59dceb085ed6af22b79e2d9d4ba1 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 30 Jun 2022 13:33:04 +0000 Subject: [PATCH 150/555] formatting fixes --- templates/node/base/requests/api.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/base/requests/api.twig b/templates/node/base/requests/api.twig index 4b2e8c71fb..60c0a3e393 100644 --- a/templates/node/base/requests/api.twig +++ b/templates/node/base/requests/api.twig @@ -5,4 +5,4 @@ {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} - }, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); + }, payload{% if method.type == 'location' %}, 'arraybuffer'{% endif %}); \ No newline at end of file From 12650048dfa8a01f6967024af5fbac47732fdaad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 30 Jun 2022 13:48:38 +0000 Subject: [PATCH 151/555] Upgrade deploy collection command --- templates/cli/lib/commands/deploy.js.twig | 152 ++++++++++++++++------ templates/cli/lib/questions.js.twig | 2 +- 2 files changed, 110 insertions(+), 44 deletions(-) diff --git a/templates/cli/lib/commands/deploy.js.twig b/templates/cli/lib/commands/deploy.js.twig index a496ccf110..4161669e81 100644 --- a/templates/cli/lib/commands/deploy.js.twig +++ b/templates/cli/lib/commands/deploy.js.twig @@ -6,6 +6,8 @@ const { questionsDeployFunctions, questionsGetEntrypoint, questionsDeployCollect const { actionRunner, success, log, error, commandDescriptions } = require("../parser"); const { functionsGet, functionsCreate, functionsUpdate, functionsCreateDeployment, functionsUpdateDeployment } = require('./functions'); const { + databasesGet, + databasesCreate, databasesCreateBooleanAttribute, databasesGetCollection, databasesCreateCollection, @@ -23,19 +25,18 @@ const { databasesDeleteIndex } = require("./databases"); -// TODO: Add databaseId everywhere - const POOL_DEBOUNCE = 2000; // in milliseconds const POOL_MAX_DEBOUNCES = 30; const awaitPools = { - wipeAttributes: async (collectionId, iteration = 1) => { + wipeAttributes: async (databaseId, collectionId, iteration = 1) => { if (iteration > POOL_MAX_DEBOUNCES) { return false; } // TODO: Pagination? - const { attributes: remoteAttributes } = await databaseListAttributes({ + const { attributes: remoteAttributes } = await databasesListAttributes({ + databaseId, collectionId, limit: 100, parseOutput: false @@ -46,15 +47,16 @@ const awaitPools = { } await new Promise(resolve => setTimeout(resolve, POOL_DEBOUNCE)); - return await awaitPools.wipeAttributes(collectionId, iteration + 1); + return await awaitPools.wipeAttributes(databaseId, collectionId, iteration + 1); }, - wipeIndexes: async (collectionId, iteration = 1) => { + wipeIndexes: async (databaseId, collectionId, iteration = 1) => { if (iteration > POOL_MAX_DEBOUNCES) { return false; } // TODO: Pagination? - const { indexes: remoteIndexes } = await databaseListIndexes({ + const { indexes: remoteIndexes } = await databasesListIndexes({ + databaseId, collectionId, limit: 100, parseOutput: false @@ -65,15 +67,16 @@ const awaitPools = { } await new Promise(resolve => setTimeout(resolve, POOL_DEBOUNCE)); - return await awaitPools.wipeIndexes(collectionId, iteration + 1); + return await awaitPools.wipeIndexes(databaseId, collectionId, iteration + 1); }, - expectAttributes: async (collectionId, attributeKeys, iteration = 1) => { + expectAttributes: async (databaseId, collectionId, attributeKeys, iteration = 1) => { if (iteration > POOL_MAX_DEBOUNCES) { return false; } // TODO: Pagination? - const { attributes: remoteAttributes } = await databaseListAttributes({ + const { attributes: remoteAttributes } = await databasesListAttributes({ + databaseId, collectionId, limit: 100, parseOutput: false @@ -96,15 +99,16 @@ const awaitPools = { } await new Promise(resolve => setTimeout(resolve, POOL_DEBOUNCE)); - return await awaitPools.expectAttributes(collectionId, attributeKeys, iteration + 1); + return await awaitPools.expectAttributes(databaseId, collectionId, attributeKeys, iteration + 1); }, - expectIndexes: async (collectionId, indexKeys, iteration = 1) => { + expectIndexes: async (databaseId, collectionId, indexKeys, iteration = 1) => { if (iteration > POOL_MAX_DEBOUNCES) { return false; } // TODO: Pagination? - const { indexes: remoteIndexes } = await databaseListIndexes({ + const { indexes: remoteIndexes } = await databasesListIndexes({ + databaseId, collectionId, limit: 100, parseOutput: false @@ -127,7 +131,7 @@ const awaitPools = { } await new Promise(resolve => setTimeout(resolve, POOL_DEBOUNCE)); - return await awaitPools.expectIndexes(collectionId, indexKeys, iteration + 1); + return await awaitPools.expectIndexes(databaseId, collectionId, indexKeys, iteration + 1); }, } @@ -162,7 +166,12 @@ const deployFunction = async ({ functionId, all } = {}) => { let functions = functionIds.map((id) => { const functions = localConfig.getFunctions(); const func = functions.find((f) => f.$id === id); - return JSONbig.stringify(func); + + if(!func) { + throw new Error("Function '" + id + "' not found.") + } + + return func; }); for (let func of functions) { @@ -244,12 +253,13 @@ const deployFunction = async ({ functionId, all } = {}) => { } } -const createAttribute = async (collectionId, attribute) => { +const createAttribute = async (databaseId, collectionId, attribute) => { switch (attribute.type) { case 'string': switch (attribute.format) { case 'email': - return await databaseCreateEmailAttribute({ + return await databasesCreateEmailAttribute({ + databaseId, collectionId, key: attribute.key, required: attribute.required, @@ -258,7 +268,8 @@ const createAttribute = async (collectionId, attribute) => { parseOutput: false }) case 'url': - return await databaseCreateUrlAttribute({ + return await databasesCreateUrlAttribute({ + databaseId, collectionId, key: attribute.key, required: attribute.required, @@ -267,7 +278,8 @@ const createAttribute = async (collectionId, attribute) => { parseOutput: false }) case 'ip': - return await databaseCreateIpAttribute({ + return await databasesCreateIpAttribute({ + databaseId, collectionId, key: attribute.key, required: attribute.required, @@ -276,7 +288,8 @@ const createAttribute = async (collectionId, attribute) => { parseOutput: false }) case 'enum': - return await databaseCreateEnumAttribute({ + return await databasesCreateEnumAttribute({ + databaseId, collectionId, key: attribute.key, elements: attribute.elements, @@ -286,7 +299,8 @@ const createAttribute = async (collectionId, attribute) => { parseOutput: false }) default: - return await databaseCreateStringAttribute({ + return await databasesCreateStringAttribute({ + databaseId, collectionId, key: attribute.key, size: attribute.size, @@ -298,7 +312,8 @@ const createAttribute = async (collectionId, attribute) => { } case 'integer': - return await databaseCreateIntegerAttribute({ + return await databasesCreateIntegerAttribute({ + databaseId, collectionId, key: attribute.key, required: attribute.required, @@ -309,7 +324,8 @@ const createAttribute = async (collectionId, attribute) => { parseOutput: false }) case 'double': - return databaseCreateFloatAttribute({ + return databasesCreateFloatAttribute({ + databaseId, collectionId, key: attribute.key, required: attribute.required, @@ -320,7 +336,9 @@ const createAttribute = async (collectionId, attribute) => { parseOutput: false }) case 'boolean': - return databaseCreateBooleanAttribute({ + return databasesCreateBooleanAttribute({ + databaseId, + databaseId, collectionId, key: attribute.key, required: attribute.required, @@ -331,15 +349,55 @@ const createAttribute = async (collectionId, attribute) => { } } -const deployCollection = async () => { +const deployCollection = async ({ all } = {}) => { let response = {}; - let answers = await inquirer.prompt(questionsDeployCollections[0]) - let collections = answers.collections.map((collection) => JSONbig.parse(collection)); + + let collectionIds = []; + const configCollections = localConfig.getCollections(); + + if(all) { + if (configCollections.length === 0) { + throw new Error("No collections found in the current directory. Run `{{ language.params.executableName }} init collection` to fetch all your collections."); + } + collectionIds.push(...configCollections.map((c) => c.$id)); + } + + if(collectionIds.length <= 0) { + let answers = await inquirer.prompt(questionsDeployCollections[0]) + collectionIds.push(...answers.collections); + } + + let collections = []; + + for(const collectionId of collectionIds) { + const idCollections = configCollections.filter((c) => c.$id === collectionId); + collections.push(...idCollections); + } for (let collection of collections) { log(`Deploying collection ${collection.name} ( ${collection['$id']} )`) + + let databaseId; + try { - response = await databaseGetCollection({ + const database = await databasesGet({ + databaseId: collection.databaseId, + parseOutput: false, + }); + databaseId = database.$id; + } catch(err) { + log(`Database ${collection.databaseId} not found. Creating it now...`); + const database = await databasesCreate({ + databaseId: collection.databaseId, + name: collection.databaseId, + parseOutput: false, + }); + databaseId = database.$id; + } + + try { + response = await databasesGetCollection({ + databaseId, collectionId: collection['$id'], parseOutput: false, }) @@ -354,51 +412,55 @@ const deployCollection = async () => { log(`Updating attributes ... `); // TODO: Pagination? - const { indexes: remoteIndexes } = await databaseListIndexes({ + const { indexes: remoteIndexes } = await databasesListIndexes({ + databaseId, collectionId: collection['$id'], limit: 100, parseOutput: false }); await Promise.all(remoteIndexes.map(async index => { - await databaseDeleteIndex({ + await databasesDeleteIndex({ + databaseId, collectionId: collection['$id'], key: index.key, parseOutput: false }); })); - const deleteIndexesPoolStatus = await awaitPools.wipeIndexes(collection['$id']); + const deleteIndexesPoolStatus = await awaitPools.wipeIndexes(databaseId, collection['$id']); if (!deleteIndexesPoolStatus) { throw new Error("Index deletion did not finish for too long."); } // TODO: Pagination? - const { attributes: remoteAttributes } = await databaseListAttributes({ + const { attributes: remoteAttributes } = await databasesListAttributes({ + databaseId, collectionId: collection['$id'], limit: 100, parseOutput: false }); await Promise.all(remoteAttributes.map(async attribute => { - await databaseDeleteAttribute({ + await databasesDeleteAttribute({ + databaseId, collectionId: collection['$id'], key: attribute.key, parseOutput: false }); })); - const deleteAttributesPoolStatus = await awaitPools.wipeAttributes(collection['$id']); + const deleteAttributesPoolStatus = await awaitPools.wipeAttributes(databaseId, collection['$id']); if (!deleteAttributesPoolStatus) { throw new Error("Attribute deletion did not finish for too long."); } await Promise.all(collection.attributes.map(async attribute => { - await createAttribute(collection['$id'], attribute); + await createAttribute(databaseId, collection['$id'], attribute); })); const attributeKeys = collection.attributes.map(attribute => attribute.key); - const createPoolStatus = await awaitPools.expectAttributes(collection['$id'], attributeKeys); + const createPoolStatus = await awaitPools.expectAttributes(databaseId, collection['$id'], attributeKeys); if (!createPoolStatus) { throw new Error("Attribute creation did not finish for too long."); } @@ -407,7 +469,8 @@ const deployCollection = async () => { log(`Creating indexes ...`) await Promise.all(collection.indexes.map(async index => { - await databaseCreateIndex({ + await databasesCreateIndex({ + databaseId, collectionId: collection['$id'], key: index.key, type: index.type, @@ -418,7 +481,7 @@ const deployCollection = async () => { })); const indexKeys = collection.indexes.map(attribute => attribute.key); - const indexPoolStatus = await awaitPools.expectIndexes(collection['$id'], indexKeys); + const indexPoolStatus = await awaitPools.expectIndexes(databaseId, collection['$id'], indexKeys); if (!indexPoolStatus) { throw new Error("Index creation did not finish for too long."); } @@ -427,7 +490,8 @@ const deployCollection = async () => { } catch (e) { if (e.code == 404) { log(`Collection ${collection.name} does not exist in the project. Creating ... `); - response = await databaseCreateCollection({ + response = await databasesCreateCollection({ + databaseId, collectionId: collection['$id'], name: collection.name, permission: collection.permission, @@ -438,11 +502,11 @@ const deployCollection = async () => { log(`Creating attributes ... `); await Promise.all(collection.attributes.map(async attribute => { - await createAttribute(collection['$id'], attribute); + await createAttribute(databaseId, collection['$id'], attribute); })); const attributeKeys = collection.attributes.map(attribute => attribute.key); - const attributePoolStatus = await awaitPools.expectAttributes(collection['$id'], attributeKeys); + const attributePoolStatus = await awaitPools.expectAttributes(databaseId, collection['$id'], attributeKeys); if (!attributePoolStatus) { throw new Error("Attribute creation did not finish for too long."); } @@ -451,7 +515,8 @@ const deployCollection = async () => { log(`Creating indexes ...`); await Promise.all(collection.indexes.map(async index => { - await databaseCreateIndex({ + await databasesCreateIndex({ + databaseId, collectionId: collection['$id'], key: index.key, type: index.type, @@ -462,7 +527,7 @@ const deployCollection = async () => { })); const indexKeys = collection.indexes.map(attribute => attribute.key); - const indexPoolStatus = await awaitPools.expectIndexes(collection['$id'], indexKeys); + const indexPoolStatus = await awaitPools.expectIndexes(databaseId, collection['$id'], indexKeys); if (!indexPoolStatus) { throw new Error("Index creation did not finish for too long."); } @@ -487,6 +552,7 @@ deploy deploy .command("collection") .description("Deploy collections in the current project.") + .option(`--all`, `Flag to deploy all functions`) .action(actionRunner(deployCollection)); module.exports = { diff --git a/templates/cli/lib/questions.js.twig b/templates/cli/lib/questions.js.twig index bc4927b63a..2c85a639dc 100644 --- a/templates/cli/lib/questions.js.twig +++ b/templates/cli/lib/questions.js.twig @@ -267,7 +267,7 @@ const questionsDeployCollections = [ let choices = collections.map((collection, idx) => { return { name: `${collection.name} (${collection['$id']})`, - value: JSONbig.stringify(collection) + value: collection.$id } }) return choices; From eac54634509dacf71bdf3cc9fa7b3f8c60cc56d6 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 30 Jun 2022 15:46:30 +0000 Subject: [PATCH 152/555] add missing return keyword to api.twig --- templates/node/base/requests/api.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/base/requests/api.twig b/templates/node/base/requests/api.twig index 60c0a3e393..37ece04715 100644 --- a/templates/node/base/requests/api.twig +++ b/templates/node/base/requests/api.twig @@ -1,4 +1,4 @@ - await this.client.call('{{ method.method | caseLower }}', path, { + return await this.client.call('{{ method.method | caseLower }}', path, { {% for parameter in method.parameters.header %} '{{ parameter.name }}': ${{ parameter.name | caseCamel | escapeKeyword }}, {% endfor %} From 7a1e730326fffe2836dd613f91c347d768d8d33f Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 1 Jul 2022 09:10:52 +0000 Subject: [PATCH 153/555] Initial commit --- templates/python/base/params.twig | 0 templates/python/base/requests/api.twig | 0 templates/python/base/requests/file.twig | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 templates/python/base/params.twig create mode 100644 templates/python/base/requests/api.twig create mode 100644 templates/python/base/requests/file.twig diff --git a/templates/python/base/params.twig b/templates/python/base/params.twig new file mode 100644 index 0000000000..e69de29bb2 diff --git a/templates/python/base/requests/api.twig b/templates/python/base/requests/api.twig new file mode 100644 index 0000000000..e69de29bb2 diff --git a/templates/python/base/requests/file.twig b/templates/python/base/requests/file.twig new file mode 100644 index 0000000000..e69de29bb2 From 45b56dc00b996c68aecefda9074d648da85de816 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Fri, 1 Jul 2022 09:29:54 +0000 Subject: [PATCH 154/555] refactor python templates --- templates/python/base/params.twig | 31 +++++++++ templates/python/base/requests/api.twig | 8 +++ templates/python/base/requests/file.twig | 22 +++++++ .../python/package/services/service.py.twig | 65 ++----------------- 4 files changed, 65 insertions(+), 61 deletions(-) diff --git a/templates/python/base/params.twig b/templates/python/base/params.twig index e69de29bb2..b7d4fb997f 100644 --- a/templates/python/base/params.twig +++ b/templates/python/base/params.twig @@ -0,0 +1,31 @@ + params = {} +{% if method.parameters.all | length %} +{% for parameter in method.parameters.all %} +{% if parameter.required %} + if {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} is None: + raise {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | escapeKeyword | caseSnake }}"') + +{% endif %} +{% endfor %} +{% for parameter in method.parameters.path %} + path = path.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }}) +{% endfor %} + +{% for parameter in method.parameters.query %} + params['{{ parameter.name }}'] = {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} +{% endfor %} +{% for parameter in method.parameters.body %} +{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %} + params['{{ parameter.name }}'] = str({{ parameter.name | escapeKeyword | caseSnake }}).lower() if type({{ parameter.name | escapeKeyword | caseSnake }}) is bool else {{ parameter.name | escapeKeyword | caseSnake }} +{% else %} + params['{{ parameter.name }}'] = {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} +{% endif %} +{% endfor %} +{% for parameter in method.parameters.formData %} +{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %} + params['{{ parameter.name }}'] = str({{ parameter.name | escapeKeyword | caseSnake }}).lower() if type({{ parameter.name | escapeKeyword | caseSnake }}) is bool else {{ parameter.name | escapeKeyword | caseSnake }} +{% else %} + params['{{ parameter.name }}'] = {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} +{% endif %} +{% endfor %} +{% endif %} \ No newline at end of file diff --git a/templates/python/base/requests/api.twig b/templates/python/base/requests/api.twig index e69de29bb2..defae28198 100644 --- a/templates/python/base/requests/api.twig +++ b/templates/python/base/requests/api.twig @@ -0,0 +1,8 @@ + return self.client.call('{{ method.method | caseLower }}', path, { +{% for parameter in method.parameters.header %} + '{{ parameter.name }}': {{ parameter.name | escapeKeyword | caseSnake }}, +{% endfor %} +{% for key, header in method.headers %} + '{{ key }}': '{{ header }}', +{% endfor %} + }, params) \ No newline at end of file diff --git a/templates/python/base/requests/file.twig b/templates/python/base/requests/file.twig index e69de29bb2..8a8d223ffd 100644 --- a/templates/python/base/requests/file.twig +++ b/templates/python/base/requests/file.twig @@ -0,0 +1,22 @@ +{% for parameter in method.parameters.all %} +{% if parameter.type == 'file' %} + param_name = '{{ parameter.name }}' + +{% endif %} +{% endfor %} + + upload_id = '' +{% for parameter in method.parameters.all %} +{% if parameter.isUploadID %} + upload_id = {{ parameter.name | escapeKeyword | caseSnake }} +{% endif %} +{% endfor %} + + return self.client.chunked_upload(path, { +{% for parameter in method.parameters.header %} + '{{ parameter.name }}': {{ parameter.name | escapeKeyword | caseSnake }}, +{% endfor %} +{% for key, header in method.headers %} + '{{ key }}': '{{ header }}', +{% endfor %} + }, params, param_name, on_progress, upload_id) \ No newline at end of file diff --git a/templates/python/package/services/service.py.twig b/templates/python/package/services/service.py.twig index 60a59b832b..3270cea22e 100644 --- a/templates/python/package/services/service.py.twig +++ b/templates/python/package/services/service.py.twig @@ -19,69 +19,12 @@ class {{ service.name | caseUcfirst }}(Service): {% if method.title %} """{{ method.title }}""" -{% endif %} -{% for parameter in method.parameters.all %} -{% if parameter.required %} - if {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} is None: - raise {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | escapeKeyword | caseSnake }}"') - -{% endif %} -{% endfor %} - params = {} +{% endif %} path = '{{ method.path }}' -{% for parameter in method.parameters.path %} - path = path.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }}) -{% endfor %} - -{% for parameter in method.parameters.query %} - params['{{ parameter.name }}'] = {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} -{% endfor %} -{% for parameter in method.parameters.body %} -{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %} - params['{{ parameter.name }}'] = str({{ parameter.name | escapeKeyword | caseSnake }}).lower() if type({{ parameter.name | escapeKeyword | caseSnake }}) is bool else {{ parameter.name | escapeKeyword | caseSnake }} -{% else %} - params['{{ parameter.name }}'] = {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} -{% endif %} -{% endfor %} -{% for parameter in method.parameters.formData %} -{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %} - params['{{ parameter.name }}'] = str({{ parameter.name | escapeKeyword | caseSnake }}).lower() if type({{ parameter.name | escapeKeyword | caseSnake }}) is bool else {{ parameter.name | escapeKeyword | caseSnake }} -{% else %} - params['{{ parameter.name }}'] = {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} -{% endif %} -{% endfor %} +{{ include('python/base/params.twig') }} {% if 'multipart/form-data' in method.consumes %} -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - param_name = '{{ parameter.name }}' - -{% endif %} -{% endfor %} - - upload_id = '' -{% for parameter in method.parameters.all %} -{% if parameter.isUploadID %} - upload_id = {{ parameter.name | escapeKeyword | caseSnake }} -{% endif %} -{% endfor %} - - return self.client.chunked_upload(path, { -{% for parameter in method.parameters.header %} - '{{ parameter.name }}': {{ parameter.name | escapeKeyword | caseSnake }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}': '{{ header }}', -{% endfor %} - }, params, param_name, on_progress, upload_id) +{{ include('python/base/requests/file.twig') }} {% else %} - - return self.client.call('{{ method.method | caseLower }}', path, { -{% for parameter in method.parameters.header %} - '{{ parameter.name }}': {{ parameter.name | escapeKeyword | caseSnake }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}': '{{ header }}', -{% endfor %} - }, params) +{{ include('python/base/requests/api.twig') }} {% endif %} {% endfor %} From 17075c727300cea1fb78c6efe60df0ca0de27864 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Mon, 4 Jul 2022 15:31:21 +0000 Subject: [PATCH 155/555] refactor ruby templates --- templates/ruby/base/params.twig | 28 +++++++++ templates/ruby/base/requests/api.twig | 9 +++ templates/ruby/base/requests/file.twig | 19 ++++++ .../lib/container/services/service.rb.twig | 60 ++----------------- 4 files changed, 60 insertions(+), 56 deletions(-) create mode 100644 templates/ruby/base/params.twig create mode 100644 templates/ruby/base/requests/api.twig create mode 100644 templates/ruby/base/requests/file.twig diff --git a/templates/ruby/base/params.twig b/templates/ruby/base/params.twig new file mode 100644 index 0000000000..c6365579e0 --- /dev/null +++ b/templates/ruby/base/params.twig @@ -0,0 +1,28 @@ +{% if method.parameters.all | length %} +{% for parameter in method.parameters.all %} +{% if parameter.required %} + if {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}.nil? + raise {{spec.title | caseUcfirst}}::Exception.new('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"') + end + +{% endif %} +{% endfor %} +{% for parameter in method.parameters.path %} + .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}) +{% endfor %} + + params = { +{% for parameter in method.parameters.query | merge(method.parameters.body) %} + {{ parameter.name }}: {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}, +{% endfor %} + } + + headers = { +{% for parameter in method.parameters.header %} + "{{ parameter.name }}": {{ parameter.name | caseCamel | escapeKeyword }}, +{% endfor %} +{% for key, header in method.headers %} + "{{ key }}": '{{ header }}', +{% endfor %} + } +{% endif %} \ No newline at end of file diff --git a/templates/ruby/base/requests/api.twig b/templates/ruby/base/requests/api.twig new file mode 100644 index 0000000000..0ac82da49d --- /dev/null +++ b/templates/ruby/base/requests/api.twig @@ -0,0 +1,9 @@ + @client.call( + method: '{{ method.method | caseUpper }}', + path: path, + headers: headers, + params: params, +{% if method.responseModel and method.responseModel != 'any' %} + response_type: Models::{{method.responseModel | caseUcfirst}} +{% endif %} + ) \ No newline at end of file diff --git a/templates/ruby/base/requests/file.twig b/templates/ruby/base/requests/file.twig new file mode 100644 index 0000000000..f7dcb443e6 --- /dev/null +++ b/templates/ruby/base/requests/file.twig @@ -0,0 +1,19 @@ + id_param_name = {% if method.parameters.all | filter(p => p.isUploadID) | length > 0 %}{% for parameter in method.parameters.all | filter(parameter => parameter.isUploadID) %}"{{ parameter.name }}"{% endfor %}{% else %}nil{% endif %} + +{% for parameter in method.parameters.all %} +{% if parameter.type == 'file' %} + param_name = '{{ parameter.name }}' + +{% endif %} +{% endfor %} + @client.chunked_upload( + path: path, + headers: headers, + params: params, + param_name: param_name, + id_param_name: id_param_name, + on_progress: on_progress, +{% if method.responseModel and method.responseModel != 'any' %} + response_type: Models::{{method.responseModel | caseUcfirst}} +{% endif %} + ) \ No newline at end of file diff --git a/templates/ruby/lib/container/services/service.rb.twig b/templates/ruby/lib/container/services/service.rb.twig index bdb9f55049..c1f8f50071 100644 --- a/templates/ruby/lib/container/services/service.rb.twig +++ b/templates/ruby/lib/container/services/service.rb.twig @@ -25,67 +25,15 @@ module {{spec.title | caseUcfirst}} # # @return [{{ method.responseModel | caseUcfirst }}] def {{ method.name | caseSnake }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseSnake | escapeKeyword }}:{% if not parameter.required %} nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress: nil{% endif %}) -{% for parameter in method.parameters.all %} -{% if parameter.required %} - if {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}.nil? - raise {{spec.title | caseUcfirst}}::Exception.new('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"') - end -{% endif %} -{% endfor %} path = '{{ method.path }}' -{% for parameter in method.parameters.path %} - .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}) -{% endfor %} - - params = { -{% for parameter in method.parameters.query | merge(method.parameters.body) %} - {{ parameter.name }}: {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}, -{% endfor %} - } - - headers = { -{% for parameter in method.parameters.header %} - "{{ parameter.name }}": {{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for key, header in method.headers %} - "{{ key }}": '{{ header }}', -{% endfor %} - } - +{{ include('ruby/base/params.twig')}} {% if 'multipart/form-data' in method.consumes %} - id_param_name = {% if method.parameters.all | filter(p => p.isUploadID) | length > 0 %}{% for parameter in method.parameters.all | filter(parameter => parameter.isUploadID) %}"{{ parameter.name }}"{% endfor %}{% else %}nil{% endif %} - -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - param_name = '{{ parameter.name }}' - -{% endif %} -{% endfor %} - @client.chunked_upload( - path: path, - headers: headers, - params: params, - param_name: param_name, - id_param_name: id_param_name, - on_progress: on_progress, -{% if method.responseModel and method.responseModel != 'any' %} - response_type: Models::{{method.responseModel | caseUcfirst}} -{% endif %} - ) +{{ include('ruby/base/requests/file.twig')}} {% else %} - @client.call( - method: '{{ method.method | caseUpper }}', - path: path, - headers: headers, - params: params, -{% if method.responseModel and method.responseModel != 'any' %} - response_type: Models::{{method.responseModel | caseUcfirst}} -{% endif %} - ) -{% endif %} +{{ include('ruby/base/requests/api.twig')}} end - +{% endif %} {% endfor %} end end \ No newline at end of file From 3c95f21dd246262df0b632d26cf7d5a1b69b44ac Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Mon, 4 Jul 2022 16:08:28 +0000 Subject: [PATCH 156/555] fix bugs in ruby refactor --- templates/ruby/base/params.twig | 27 +++++++++---------- .../lib/container/services/service.rb.twig | 5 +++- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/templates/ruby/base/params.twig b/templates/ruby/base/params.twig index c6365579e0..92afa831b3 100644 --- a/templates/ruby/base/params.twig +++ b/templates/ruby/base/params.twig @@ -1,22 +1,9 @@ -{% if method.parameters.all | length %} -{% for parameter in method.parameters.all %} -{% if parameter.required %} - if {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}.nil? - raise {{spec.title | caseUcfirst}}::Exception.new('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"') - end - -{% endif %} -{% endfor %} -{% for parameter in method.parameters.path %} - .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}) -{% endfor %} - params = { {% for parameter in method.parameters.query | merge(method.parameters.body) %} {{ parameter.name }}: {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}, {% endfor %} } - + headers = { {% for parameter in method.parameters.header %} "{{ parameter.name }}": {{ parameter.name | caseCamel | escapeKeyword }}, @@ -25,4 +12,16 @@ "{{ key }}": '{{ header }}', {% endfor %} } +{% if method.parameters.all | length %} +{% for parameter in method.parameters.all %} +{% if parameter.required %} + if {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}.nil? + raise {{spec.title | caseUcfirst}}::Exception.new('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"') + end + +{% endif %} +{% endfor %} +{% for parameter in method.parameters.path %} + .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}) +{% endfor %} {% endif %} \ No newline at end of file diff --git a/templates/ruby/lib/container/services/service.rb.twig b/templates/ruby/lib/container/services/service.rb.twig index c1f8f50071..290ce79622 100644 --- a/templates/ruby/lib/container/services/service.rb.twig +++ b/templates/ruby/lib/container/services/service.rb.twig @@ -27,13 +27,16 @@ module {{spec.title | caseUcfirst}} def {{ method.name | caseSnake }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseSnake | escapeKeyword }}:{% if not parameter.required %} nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress: nil{% endif %}) path = '{{ method.path }}' + {{ include('ruby/base/params.twig')}} {% if 'multipart/form-data' in method.consumes %} {{ include('ruby/base/requests/file.twig')}} {% else %} {{ include('ruby/base/requests/api.twig')}} - end {% endif %} + end + + {% endfor %} end end \ No newline at end of file From a9ebfefb5b7707f0188c4bb105204aa3d7d0a76f Mon Sep 17 00:00:00 2001 From: Wen Yu Ge Date: Mon, 4 Jul 2022 15:47:02 -0400 Subject: [PATCH 157/555] Added parameter for DB constructor to be named constructor --- templates/ruby/docs/example.md.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/ruby/docs/example.md.twig b/templates/ruby/docs/example.md.twig index 88a30f382d..320a7aabba 100644 --- a/templates/ruby/docs/example.md.twig +++ b/templates/ruby/docs/example.md.twig @@ -10,7 +10,7 @@ client {% endfor %} {% endfor %} -{{ service.name | caseSnake }} = {{spec.title | caseUcfirst}}::{{ service.name | caseUcfirst }}.new(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) +{{ service.name | caseSnake }} = {{spec.title | caseUcfirst}}::{{ service.name | caseUcfirst }}.new(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{parameter.name|caseCamel}}:{{ parameter | paramExample }}{% endfor %}{% endif %}) response = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{parameter.name|caseSnake}}: {% if parameter | paramExample == "InputFile.new" %}{{spec.title | caseUcfirst}}::{{ parameter | paramExample }}{% else %}{{ parameter | paramExample }}{% endif %}{% endif %}{% endfor %}) From d5c0b08a014197e3cfa1f47207e918fcdb78a344 Mon Sep 17 00:00:00 2001 From: Wen Yu Ge Date: Mon, 4 Jul 2022 15:49:43 -0400 Subject: [PATCH 158/555] should be snake case --- templates/ruby/docs/example.md.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/ruby/docs/example.md.twig b/templates/ruby/docs/example.md.twig index 320a7aabba..1b0bcd3baa 100644 --- a/templates/ruby/docs/example.md.twig +++ b/templates/ruby/docs/example.md.twig @@ -10,7 +10,7 @@ client {% endfor %} {% endfor %} -{{ service.name | caseSnake }} = {{spec.title | caseUcfirst}}::{{ service.name | caseUcfirst }}.new(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{parameter.name|caseCamel}}:{{ parameter | paramExample }}{% endfor %}{% endif %}) +{{ service.name | caseSnake }} = {{spec.title | caseUcfirst}}::{{ service.name | caseUcfirst }}.new(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{parameter.name|caseSnake}}:{{ parameter | paramExample }}{% endfor %}{% endif %}) response = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{parameter.name|caseSnake}}: {% if parameter | paramExample == "InputFile.new" %}{{spec.title | caseUcfirst}}::{{ parameter | paramExample }}{% else %}{{ parameter | paramExample }}{% endif %}{% endif %}{% endfor %}) From 00306beb7055515ed87e31c82258e40979b2a925 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 5 Jul 2022 18:11:23 +1200 Subject: [PATCH 159/555] Import input files where required for docs --- templates/android/docs/java/example.md.twig | 3 +++ templates/android/docs/kotlin/example.md.twig | 3 +++ templates/kotlin/docs/java/example.md.twig | 3 +++ templates/kotlin/docs/kotlin/example.md.twig | 3 +++ templates/php/docs/example.md.twig | 3 +++ templates/python/docs/example.md.twig | 3 +++ templates/ruby/docs/example.md.twig | 2 +- 7 files changed, 19 insertions(+), 1 deletion(-) diff --git a/templates/android/docs/java/example.md.twig b/templates/android/docs/java/example.md.twig index a707e98b09..6c53999bdb 100644 --- a/templates/android/docs/java/example.md.twig +++ b/templates/android/docs/java/example.md.twig @@ -3,6 +3,9 @@ import android.os.Bundle import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import {{ sdk.namespace | caseDot }}.Client +{% if method.parameters.all | filter((param) => param.type == 'file') | length > 0 %} +import {{ sdk.namespace | caseDot }}.models.InputFile +{% endif %} import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} public class MainActivity extends AppCompatActivity { diff --git a/templates/android/docs/kotlin/example.md.twig b/templates/android/docs/kotlin/example.md.twig index 1a070db999..b0b8ad8f4c 100644 --- a/templates/android/docs/kotlin/example.md.twig +++ b/templates/android/docs/kotlin/example.md.twig @@ -3,6 +3,9 @@ import android.os.Bundle import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import {{ sdk.namespace | caseDot }}.Client +{% if method.parameters.all | filter((param) => param.type == 'file') | length > 0 %} +import {{ sdk.namespace | caseDot }}.models.InputFile +{% endif %} import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} class MainActivity : AppCompatActivity() { diff --git a/templates/kotlin/docs/java/example.md.twig b/templates/kotlin/docs/java/example.md.twig index 0267d3e877..22ffafc277 100644 --- a/templates/kotlin/docs/java/example.md.twig +++ b/templates/kotlin/docs/java/example.md.twig @@ -1,4 +1,7 @@ import {{ sdk.namespace | caseDot }}.Client +{% if method.parameters.all | filter((param) => param.type == 'file') | length > 0 %} +import {{ sdk.namespace | caseDot }}.models.InputFile +{% endif %} import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} public void main() { diff --git a/templates/kotlin/docs/kotlin/example.md.twig b/templates/kotlin/docs/kotlin/example.md.twig index a084647bb2..5c35a9fc6d 100644 --- a/templates/kotlin/docs/kotlin/example.md.twig +++ b/templates/kotlin/docs/kotlin/example.md.twig @@ -1,4 +1,7 @@ import {{ sdk.namespace | caseDot }}.Client +{% if method.parameters.all | filter((param) => param.type == 'file') | length > 0 %} +import {{ sdk.namespace | caseDot }}.models.InputFile +{% endif %} import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} suspend fun main() { diff --git a/templates/php/docs/example.md.twig b/templates/php/docs/example.md.twig index 030226d219..64a92dc41d 100644 --- a/templates/php/docs/example.md.twig +++ b/templates/php/docs/example.md.twig @@ -1,6 +1,9 @@ param.type == 'file') | length > 0 %} +use {{ spec.title | caseUcfirst }}\InputFile; +{% endif %} use {{ spec.title | caseUcfirst }}\Services\{{ service.name | caseUcfirst }}; $client = new Client(); diff --git a/templates/python/docs/example.md.twig b/templates/python/docs/example.md.twig index 141b29ebc8..328789969c 100644 --- a/templates/python/docs/example.md.twig +++ b/templates/python/docs/example.md.twig @@ -1,4 +1,7 @@ from {{ spec.title | caseSnake }}.client import Client +{% if method.parameters.all | filter((param) => param.type == 'file') | length > 0 %} +from {{ spec.title | caseSnake }}.input_file import InputFile +{% endif %} from {{ spec.title | caseSnake }}.services.{{ service.name | caseSnake }} import {{ service.name | caseUcfirst }} client = Client() diff --git a/templates/ruby/docs/example.md.twig b/templates/ruby/docs/example.md.twig index 88a30f382d..7dfb48089a 100644 --- a/templates/ruby/docs/example.md.twig +++ b/templates/ruby/docs/example.md.twig @@ -12,6 +12,6 @@ client {{ service.name | caseSnake }} = {{spec.title | caseUcfirst}}::{{ service.name | caseUcfirst }}.new(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) -response = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{parameter.name|caseSnake}}: {% if parameter | paramExample == "InputFile.new" %}{{spec.title | caseUcfirst}}::{{ parameter | paramExample }}{% else %}{{ parameter | paramExample }}{% endif %}{% endif %}{% endfor %}) +response = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{parameter.name|caseSnake}}: {% if parameter.type == 'file' %}{{spec.title | caseUcfirst}}::{{ parameter | paramExample }}{% else %}{{ parameter | paramExample }}{% endif %}{% endif %}{% endfor %}) puts response.inspect \ No newline at end of file From 32c316aab1309c441a498d890a4038086c968892 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 5 Jul 2022 14:01:58 +0000 Subject: [PATCH 160/555] refactor go templates --- templates/go/base/params.twig | 14 ++++++++++++++ templates/go/base/requests/api.twig | 1 + templates/go/services/service.go.twig | 20 ++++---------------- 3 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 templates/go/base/params.twig create mode 100644 templates/go/base/requests/api.twig diff --git a/templates/go/base/params.twig b/templates/go/base/params.twig new file mode 100644 index 0000000000..cc62c584b4 --- /dev/null +++ b/templates/go/base/params.twig @@ -0,0 +1,14 @@ + params := map[string]interface{}{ +{% for parameter in method.parameters.query %} + "{{ parameter.name }}": {{ parameter.name | caseUcfirst }}, +{% endfor %} +{% for parameter in method.parameters.body %} + "{{ parameter.name }}": {{ parameter.name | caseUcfirst }}, +{% endfor %} + } + + headers := map[string]interface{}{ +{% for key, header in method.headers %} + "{{ key }}": "{{ header }}", +{% endfor %} + } \ No newline at end of file diff --git a/templates/go/base/requests/api.twig b/templates/go/base/requests/api.twig new file mode 100644 index 0000000000..034a836805 --- /dev/null +++ b/templates/go/base/requests/api.twig @@ -0,0 +1 @@ + return srv.client.Call("{{ method.method | caseUpper }}", path, headers, params) \ No newline at end of file diff --git a/templates/go/services/service.go.twig b/templates/go/services/service.go.twig index ced53f707c..b787071aea 100644 --- a/templates/go/services/service.go.twig +++ b/templates/go/services/service.go.twig @@ -30,24 +30,12 @@ func (srv *{{ service.name | caseUcfirst }}) {{ method.name | caseUcfirst }}({% {% if method.parameters.path|length > 0 %} r := strings.NewReplacer({% for parameter in method.parameters.path %}"{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}", {{ parameter.name | caseUcfirst }}{% if not loop.last %}, {% endif %}{% endfor %}) path := r.Replace("{{ method.path }}") + {% else %} path := "{{ method.path }}" + {% endif %} - - params := map[string]interface{}{ -{% for parameter in method.parameters.query %} - "{{ parameter.name }}": {{ parameter.name | caseUcfirst }}, -{% endfor %} -{% for parameter in method.parameters.body %} - "{{ parameter.name }}": {{ parameter.name | caseUcfirst }}, -{% endfor %} - } - - headers := map[string]interface{}{ -{% for key, header in method.headers %} - "{{ key }}": "{{ header }}", -{% endfor %} - } - return srv.client.Call("{{ method.method | caseUpper }}", path, headers, params) +{{include('go/base/params.twig')}} +{{include('go/base/requests/api.twig')}} } {% endfor %} \ No newline at end of file From e4d4d98e9e20129f3a3ec6063f3cbc72a943fca6 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 5 Jul 2022 11:09:04 -0400 Subject: [PATCH 161/555] Formatting change in template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matej Bačo --- templates/ruby/docs/example.md.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/ruby/docs/example.md.twig b/templates/ruby/docs/example.md.twig index 1b0bcd3baa..a4fadb2dfb 100644 --- a/templates/ruby/docs/example.md.twig +++ b/templates/ruby/docs/example.md.twig @@ -10,7 +10,7 @@ client {% endfor %} {% endfor %} -{{ service.name | caseSnake }} = {{spec.title | caseUcfirst}}::{{ service.name | caseUcfirst }}.new(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{parameter.name|caseSnake}}:{{ parameter | paramExample }}{% endfor %}{% endif %}) +{{ service.name | caseSnake }} = {{spec.title | caseUcfirst}}::{{ service.name | caseUcfirst }}.new(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{parameter.name | caseSnake}}:{{ parameter | paramExample }}{% endfor %}{% endif %}) response = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{parameter.name|caseSnake}}: {% if parameter | paramExample == "InputFile.new" %}{{spec.title | caseUcfirst}}::{{ parameter | paramExample }}{% else %}{{ parameter | paramExample }}{% endif %}{% endif %}{% endfor %}) From db23207eaf5e2ea73441b183399b6a9038456c61 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 13 Jul 2022 11:00:55 +0100 Subject: [PATCH 162/555] Update init.js.twig --- templates/cli/lib/commands/init.js.twig | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index 01c82a2117..fd584db2a7 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -50,14 +50,15 @@ const initProject = async () => { const initFunction = async () => { // TODO: Add CI/CD support (ID, name, runtime) let answers = await inquirer.prompt(questionsInitFunction) + let functionFolder = path.join(process.cwd(), 'functions'); - if (!fs.existsSync(path.join(process.cwd(), 'functions'))) { - fs.mkdirSync(path.join(process.cwd(), 'functions'), { + if (!fs.existsSync(functionFolder)) { + fs.mkdirSync(functionFolder, { recursive: true }); } - const functionDir = path.join(process.cwd(), 'functions', answers.name); + const functionDir = path.join(functionFolder, answers.name); if (fs.existsSync(functionDir)) { throw new Error(`( ${answers.name} ) already exists in the current directory. Please choose another name.`); @@ -80,19 +81,19 @@ const initFunction = async () => { let gitPullCommands = `git sparse-checkout add ${answers.runtime.id}`; - // Force use CMD as powershell does not support && + /* Force use CMD as powershell does not support && */ if (process.platform == 'win32') { gitInitCommands = 'cmd /c "' + gitInitCommands + '"'; gitPullCommands = 'cmd /c "' + gitPullCommands + '"'; } - // Execute the child process but do not print any std output + /* Execute the child process but do not print any std output */ try { childProcess.execSync(gitInitCommands, { stdio: 'pipe', cwd: functionDir }); childProcess.execSync(gitPullCommands, { stdio: 'pipe', cwd: functionDir }); } catch (error) { - // Specialised errors with recommended actions to take + /* Specialised errors with recommended actions to take */ if (error.message.includes('error: unknown option')) { throw new Error(`${error.message} \n\nSuggestion: Try updating your git to the latest version, then trying to run this command again.`) } else if (error.message.includes('is not recognized as an internal or external command,') || error.message.includes('command not found')) { From c9821b70c0b45cd1e8363f6a7f5aed656b293aa4 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 13 Jul 2022 11:01:11 +0100 Subject: [PATCH 163/555] Update templates/cli/lib/commands/init.js.twig Co-authored-by: Christy Jacob --- templates/cli/lib/commands/init.js.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index fd584db2a7..42e606ae1e 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -90,7 +90,6 @@ const initFunction = async () => { /* Execute the child process but do not print any std output */ try { childProcess.execSync(gitInitCommands, { stdio: 'pipe', cwd: functionDir }); - childProcess.execSync(gitPullCommands, { stdio: 'pipe', cwd: functionDir }); } catch (error) { /* Specialised errors with recommended actions to take */ From cbebb6393876a0ce8a8a33b3b8a6772ce77f3c90 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 17 Jul 2022 10:41:36 +0000 Subject: [PATCH 164/555] flutter and python dependency upgrades --- templates/flutter/pubspec.yaml.twig | 2 +- templates/python/requirements.txt.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 0ee2f23ad7..da671fecd0 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -11,7 +11,7 @@ dependencies: flutter: sdk: flutter cookie_jar: ^3.0.1 - device_info_plus: ^3.2.2 + device_info_plus: ^4.0.0 flutter_web_auth: ^0.4.1 http: ^0.13.4 package_info_plus: 1.4.2 diff --git a/templates/python/requirements.txt.twig b/templates/python/requirements.txt.twig index 9cdfca0c2e..5e77405687 100644 --- a/templates/python/requirements.txt.twig +++ b/templates/python/requirements.txt.twig @@ -1 +1 @@ -requests==2.27.1 \ No newline at end of file +requests==2.28.1 \ No newline at end of file From 56cd9f6646f694f541b700ef16e5f6ded4d5d633 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 21 Jul 2022 17:28:12 +1200 Subject: [PATCH 165/555] Use packed header --- .../src/main/java/io/appwrite/services/ServiceTemplate.kt.twig | 3 +++ .../main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig | 3 +++ 2 files changed, 6 insertions(+) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index ab2d8c22d4..79e48fe00f 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -127,6 +127,9 @@ class {{ service.name | caseUcfirst }} : Service { {% else %} val headers = mutableMapOf( {{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} +{% if method.type == "graphql" %} + "x-{{ spec.title | caseLower }}-graphql-packed" to true +{% endif %} ) {% if method.responseModel %} val converter: (Map) -> {{ _self.resultType(sdk.namespace, method) }} = { diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index cf8997519f..d3db4c649f 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -125,6 +125,9 @@ class {{ service.name | caseUcfirst }} : Service { {% else %} val headers = mutableMapOf( {{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} +{% if method.type == "graphql" %} + "x-{{ spec.title | caseLower }}-graphql-packed" to true +{% endif %} ) {% if method.responseModel %} val converter: (Map) -> {{ _self.resultType(sdk.namespace, method) }} = { From 16d867e756cc7202b07ad7d6bb0ebd7c7437b737 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 21 Jul 2022 17:58:00 +1200 Subject: [PATCH 166/555] Add packed header for other sdks --- .../io/appwrite/services/ServiceTemplate.kt.twig | 2 +- templates/dart/base/requests/graphql.twig | 14 ++++++++++++++ templates/dart/lib/services/service.dart.twig | 4 +++- templates/deno/src/services/service.ts.twig | 3 +++ templates/flutter/base/requests/graphql.twig | 14 ++++++++++++++ templates/go/services/service.go.twig | 3 +++ .../io/appwrite/services/ServiceTemplate.kt.twig | 2 +- templates/node/lib/services/service.js.twig | 3 +++ templates/php/base/requests/graphql.twig | 11 +++++++++++ templates/python/package/services/service.py.twig | 6 ++++++ .../ruby/lib/container/services/service.rb.twig | 3 +++ .../swift/Sources/Services/Service.swift.twig | 6 ++++-- templates/web/src/services/template.ts.twig | 3 +++ 13 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 templates/dart/base/requests/graphql.twig create mode 100644 templates/flutter/base/requests/graphql.twig create mode 100644 templates/php/base/requests/graphql.twig diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index 79e48fe00f..3b7bd4542b 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -126,7 +126,7 @@ class {{ service.name | caseUcfirst }} : Service { ) {% else %} val headers = mutableMapOf( -{{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} +{{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }}, {% if method.type == "graphql" %} "x-{{ spec.title | caseLower }}-graphql-packed" to true {% endif %} diff --git a/templates/dart/base/requests/graphql.twig b/templates/dart/base/requests/graphql.twig new file mode 100644 index 0000000000..4a5262fea3 --- /dev/null +++ b/templates/dart/base/requests/graphql.twig @@ -0,0 +1,14 @@ +{% import 'dart/base/utils.twig' as utils %} + final Map params = { + {{ utils.map_parameter(method.parameters.query) }} + {{ utils.map_parameter(method.parameters.body) }} + }; + + final Map headers = { + {{ utils.map_headers(method.headers) }}, + "x-{{ spec.title | caseLower }}-graphql-packed: true, + }}; + + final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); + + return res.data; diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index b0bc553e23..e824ea21cf 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -32,10 +32,12 @@ class {{ service.name | caseUcfirst }} extends Service { {{ include('dart/base/requests/file.twig') }} {% elseif method.type == 'location' %} {{ include('dart/base/requests/location.twig') }} +{% elseif method.type == 'graphql' %} +{{ include('dart/base/requests/graphql.twig') }} {% else %} {{ include('dart/base/requests/api.twig') }} {% endif %} - } + }} {% endfor %} } \ No newline at end of file diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index ed0ce24890..00b2f5edc0 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -114,6 +114,9 @@ export class {{ service.name | caseUcfirst }} extends Service { {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} +{% if method.type == 'grahpql' %} + 'x-{{ spec.title }}-graphql-packed': 'true', +{% endif %} }; let id: string | undefined = undefined; diff --git a/templates/flutter/base/requests/graphql.twig b/templates/flutter/base/requests/graphql.twig new file mode 100644 index 0000000000..d27a2c085a --- /dev/null +++ b/templates/flutter/base/requests/graphql.twig @@ -0,0 +1,14 @@ +{% import 'flutter/base/utils.twig' as utils %} + final Map params = { + {{ utils.map_parameter(method.parameters.query) }} + {{ utils.map_parameter(method.parameters.body) }} + }; + + final Map headers = { + {{ utils.map_headers(method.headers) }}, + "x-{{ spec.title | caseLower }}-graphql-packed: true, + }}; + + final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); + + return res.data; diff --git a/templates/go/services/service.go.twig b/templates/go/services/service.go.twig index ced53f707c..5237ae514f 100644 --- a/templates/go/services/service.go.twig +++ b/templates/go/services/service.go.twig @@ -47,6 +47,9 @@ func (srv *{{ service.name | caseUcfirst }}) {{ method.name | caseUcfirst }}({% {% for key, header in method.headers %} "{{ key }}": "{{ header }}", {% endfor %} +{% if method.type == 'grahpql' %} + "x-{{ spec.title }}-graphql-packed": "true", +{% endif %} } return srv.client.Call("{{ method.method | caseUpper }}", path, headers, params) } diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index d3db4c649f..edbdd21e9b 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -124,7 +124,7 @@ class {{ service.name | caseUcfirst }} : Service { ) {% else %} val headers = mutableMapOf( -{{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} +{{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }}, {% if method.type == "graphql" %} "x-{{ spec.title | caseLower }}-graphql-packed" to true {% endif %} diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 03443422b1..16d15be8f4 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -91,6 +91,9 @@ class {{ service.name | caseUcfirst }} extends Service { {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} +{% if method.type == 'grahpql' %} + 'x-{{ spec.title }}-graphql-packed': 'true', +{% endif %} }; let id = undefined; diff --git a/templates/php/base/requests/graphql.twig b/templates/php/base/requests/graphql.twig new file mode 100644 index 0000000000..8703baf76e --- /dev/null +++ b/templates/php/base/requests/graphql.twig @@ -0,0 +1,11 @@ + return $this->client->call(Client::METHOD_{{ method.method | caseUpper }}, $path, [ +{% for parameter in method.parameters.header %} + '{{ parameter.name }}' => ${{ parameter.name | caseCamel | escapeKeyword }}, +{% endfor %} +{% for key, header in method.headers %} + '{{ key }}' => '{{ header }}', +{% endfor %} +{% if method.type == 'grahpql' %} + 'x-{{ spec.title }}-graphql-packed': 'true', +{% endif %} + ], $params); \ No newline at end of file diff --git a/templates/python/package/services/service.py.twig b/templates/python/package/services/service.py.twig index 60a59b832b..bfa927ae08 100644 --- a/templates/python/package/services/service.py.twig +++ b/templates/python/package/services/service.py.twig @@ -72,6 +72,9 @@ class {{ service.name | caseUcfirst }}(Service): {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} +{% if method.type == 'grahpql' %} + 'x-{{ spec.title }}-graphql-packed': 'true', +{% endif %} }, params, param_name, on_progress, upload_id) {% else %} @@ -82,6 +85,9 @@ class {{ service.name | caseUcfirst }}(Service): {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} +{% if method.type == 'grahpql' %} + 'x-{{ spec.title }}-graphql-packed': 'true', +{% endif %} }, params) {% endif %} {% endfor %} diff --git a/templates/ruby/lib/container/services/service.rb.twig b/templates/ruby/lib/container/services/service.rb.twig index bdb9f55049..245f3aecdd 100644 --- a/templates/ruby/lib/container/services/service.rb.twig +++ b/templates/ruby/lib/container/services/service.rb.twig @@ -51,6 +51,9 @@ module {{spec.title | caseUcfirst}} {% for key, header in method.headers %} "{{ key }}": '{{ header }}', {% endfor %} +{% if method.type == 'grahpql' %} + "x-{{ spec.title }}-graphql-packed": "true", +{% endif %} } {% if 'multipart/form-data' in method.consumes %} diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index b5327ab1c9..e90012a0ae 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -100,7 +100,9 @@ open class {{ service.name | caseUcfirst }}: Service { ) {% else %} {% if 'multipart/form-data' in method.consumes %}var{% else %}let{% endif %} headers: [String: String] = [ -{{ method.headers|map((header, key) => " \"#{key}\": \"#{header}\"")|join(',\n')|raw }} +{{ method.headers|map((header, key) => " \"#{key}\": \"#{header}\"")|join(',\n')|raw }}{% if method.type == "graphql" %}, + "x-{{ spec.title }}-graphql-packed": "true" +{% endif %} ] {% if method.responseModel %} let converter: ([String: Any]) -> {{ _self.resultType(spec, method) }} = { dict in @@ -141,7 +143,7 @@ open class {{ service.name | caseUcfirst }}: Service { ) {% endif %} {% endif %} - } + %} {% endfor %} diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index 6f15944953..520c78fd61 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -124,6 +124,9 @@ export class {{ service.name | caseUcfirst }} extends Service { {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} +{% if method.type == 'grahpql' %} + 'x-{{ spec.title }}-graphql-packed': 'true', +{% endif %} } let counter = 0; From e9a173ba781d41134b070788242c4114d207bb2f Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 21 Jul 2022 18:08:20 +1200 Subject: [PATCH 167/555] Fix typo --- templates/deno/src/services/service.ts.twig | 2 +- templates/go/services/service.go.twig | 2 +- templates/node/lib/services/service.js.twig | 2 +- templates/php/base/requests/graphql.twig | 2 +- templates/python/package/services/service.py.twig | 4 ++-- templates/ruby/lib/container/services/service.rb.twig | 2 +- templates/web/src/services/template.ts.twig | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index 00b2f5edc0..269bead7b8 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -114,7 +114,7 @@ export class {{ service.name | caseUcfirst }} extends Service { {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} -{% if method.type == 'grahpql' %} +{% if method.type == 'graphql' %} 'x-{{ spec.title }}-graphql-packed': 'true', {% endif %} }; diff --git a/templates/go/services/service.go.twig b/templates/go/services/service.go.twig index 5237ae514f..4845da566b 100644 --- a/templates/go/services/service.go.twig +++ b/templates/go/services/service.go.twig @@ -47,7 +47,7 @@ func (srv *{{ service.name | caseUcfirst }}) {{ method.name | caseUcfirst }}({% {% for key, header in method.headers %} "{{ key }}": "{{ header }}", {% endfor %} -{% if method.type == 'grahpql' %} +{% if method.type == 'graphql' %} "x-{{ spec.title }}-graphql-packed": "true", {% endif %} } diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 16d15be8f4..99b68ec671 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -91,7 +91,7 @@ class {{ service.name | caseUcfirst }} extends Service { {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} -{% if method.type == 'grahpql' %} +{% if method.type == 'graphql' %} 'x-{{ spec.title }}-graphql-packed': 'true', {% endif %} }; diff --git a/templates/php/base/requests/graphql.twig b/templates/php/base/requests/graphql.twig index 8703baf76e..8beb91600f 100644 --- a/templates/php/base/requests/graphql.twig +++ b/templates/php/base/requests/graphql.twig @@ -5,7 +5,7 @@ {% for key, header in method.headers %} '{{ key }}' => '{{ header }}', {% endfor %} -{% if method.type == 'grahpql' %} +{% if method.type == 'graphql' %} 'x-{{ spec.title }}-graphql-packed': 'true', {% endif %} ], $params); \ No newline at end of file diff --git a/templates/python/package/services/service.py.twig b/templates/python/package/services/service.py.twig index bfa927ae08..56e659be5d 100644 --- a/templates/python/package/services/service.py.twig +++ b/templates/python/package/services/service.py.twig @@ -72,7 +72,7 @@ class {{ service.name | caseUcfirst }}(Service): {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} -{% if method.type == 'grahpql' %} +{% if method.type == 'graphql' %} 'x-{{ spec.title }}-graphql-packed': 'true', {% endif %} }, params, param_name, on_progress, upload_id) @@ -85,7 +85,7 @@ class {{ service.name | caseUcfirst }}(Service): {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} -{% if method.type == 'grahpql' %} +{% if method.type == 'graphql' %} 'x-{{ spec.title }}-graphql-packed': 'true', {% endif %} }, params) diff --git a/templates/ruby/lib/container/services/service.rb.twig b/templates/ruby/lib/container/services/service.rb.twig index 245f3aecdd..2f2209c344 100644 --- a/templates/ruby/lib/container/services/service.rb.twig +++ b/templates/ruby/lib/container/services/service.rb.twig @@ -51,7 +51,7 @@ module {{spec.title | caseUcfirst}} {% for key, header in method.headers %} "{{ key }}": '{{ header }}', {% endfor %} -{% if method.type == 'grahpql' %} +{% if method.type == 'graphql' %} "x-{{ spec.title }}-graphql-packed": "true", {% endif %} } diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index 520c78fd61..a17c747cdd 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -124,7 +124,7 @@ export class {{ service.name | caseUcfirst }} extends Service { {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} -{% if method.type == 'grahpql' %} +{% if method.type == 'graphql' %} 'x-{{ spec.title }}-graphql-packed': 'true', {% endif %} } From 187ad833bf08fdf7d7f35d627bef9785f35999b5 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 22 Jul 2022 12:21:40 +1200 Subject: [PATCH 168/555] Add missing web case for packed header --- templates/web/src/services/template.ts.twig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index a17c747cdd..3289cf9ade 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -184,6 +184,9 @@ export class {{ service.name | caseUcfirst }} extends Service { {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} +{% if method.type == 'graphql' %} + 'x-{{ spec.title }}-graphql-packed': 'true', +{% endif %} }, payload); {% endif %} {% endif %} From d84980424a8c7fc4cada8fa22e6ef8f540a46b87 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 22 Jul 2022 12:30:02 +1200 Subject: [PATCH 169/555] Lower case spec name in header --- templates/deno/src/services/service.ts.twig | 2 +- templates/go/services/service.go.twig | 2 +- templates/node/lib/services/service.js.twig | 2 +- templates/php/base/requests/graphql.twig | 2 +- templates/python/package/services/service.py.twig | 4 ++-- templates/ruby/lib/container/services/service.rb.twig | 2 +- templates/swift/Sources/Services/Service.swift.twig | 2 +- templates/web/src/services/template.ts.twig | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index 269bead7b8..b1beb936e9 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -115,7 +115,7 @@ export class {{ service.name | caseUcfirst }} extends Service { '{{ key }}': '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title }}-graphql-packed': 'true', + 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', {% endif %} }; diff --git a/templates/go/services/service.go.twig b/templates/go/services/service.go.twig index 4845da566b..b422be6308 100644 --- a/templates/go/services/service.go.twig +++ b/templates/go/services/service.go.twig @@ -48,7 +48,7 @@ func (srv *{{ service.name | caseUcfirst }}) {{ method.name | caseUcfirst }}({% "{{ key }}": "{{ header }}", {% endfor %} {% if method.type == 'graphql' %} - "x-{{ spec.title }}-graphql-packed": "true", + "x-{{ spec.title | caseLower }}-graphql-packed": "true", {% endif %} } return srv.client.Call("{{ method.method | caseUpper }}", path, headers, params) diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 99b68ec671..de4fbc8c7f 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -92,7 +92,7 @@ class {{ service.name | caseUcfirst }} extends Service { '{{ key }}': '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title }}-graphql-packed': 'true', + 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', {% endif %} }; diff --git a/templates/php/base/requests/graphql.twig b/templates/php/base/requests/graphql.twig index 8beb91600f..e9da38eac8 100644 --- a/templates/php/base/requests/graphql.twig +++ b/templates/php/base/requests/graphql.twig @@ -6,6 +6,6 @@ '{{ key }}' => '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title }}-graphql-packed': 'true', + 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', {% endif %} ], $params); \ No newline at end of file diff --git a/templates/python/package/services/service.py.twig b/templates/python/package/services/service.py.twig index 56e659be5d..31078b0874 100644 --- a/templates/python/package/services/service.py.twig +++ b/templates/python/package/services/service.py.twig @@ -73,7 +73,7 @@ class {{ service.name | caseUcfirst }}(Service): '{{ key }}': '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title }}-graphql-packed': 'true', + 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', {% endif %} }, params, param_name, on_progress, upload_id) {% else %} @@ -86,7 +86,7 @@ class {{ service.name | caseUcfirst }}(Service): '{{ key }}': '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title }}-graphql-packed': 'true', + 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', {% endif %} }, params) {% endif %} diff --git a/templates/ruby/lib/container/services/service.rb.twig b/templates/ruby/lib/container/services/service.rb.twig index 2f2209c344..9d208e0909 100644 --- a/templates/ruby/lib/container/services/service.rb.twig +++ b/templates/ruby/lib/container/services/service.rb.twig @@ -52,7 +52,7 @@ module {{spec.title | caseUcfirst}} "{{ key }}": '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - "x-{{ spec.title }}-graphql-packed": "true", + "x-{{ spec.title | caseLower }}-graphql-packed": "true", {% endif %} } diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index e90012a0ae..7efc55ec86 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -101,7 +101,7 @@ open class {{ service.name | caseUcfirst }}: Service { {% else %} {% if 'multipart/form-data' in method.consumes %}var{% else %}let{% endif %} headers: [String: String] = [ {{ method.headers|map((header, key) => " \"#{key}\": \"#{header}\"")|join(',\n')|raw }}{% if method.type == "graphql" %}, - "x-{{ spec.title }}-graphql-packed": "true" + "x-{{ spec.title | caseLower }}-graphql-packed": "true" {% endif %} ] {% if method.responseModel %} diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index 3289cf9ade..3532262f27 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -125,7 +125,7 @@ export class {{ service.name | caseUcfirst }} extends Service { '{{ key }}': '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title }}-graphql-packed': 'true', + 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', {% endif %} } @@ -185,7 +185,7 @@ export class {{ service.name | caseUcfirst }} extends Service { '{{ key }}': '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title }}-graphql-packed': 'true', + 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', {% endif %} }, payload); {% endif %} From 08adce2b207da7382b844474af97b867dfdcecc5 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 22 Jul 2022 12:37:19 +1200 Subject: [PATCH 170/555] Change header name --- .../main/java/io/appwrite/services/ServiceTemplate.kt.twig | 2 +- templates/dart/base/requests/graphql.twig | 2 +- templates/deno/src/services/service.ts.twig | 2 +- templates/flutter/base/requests/graphql.twig | 2 +- templates/go/services/service.go.twig | 2 +- .../main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig | 2 +- templates/node/lib/services/service.js.twig | 2 +- templates/php/base/requests/graphql.twig | 2 +- templates/python/package/services/service.py.twig | 4 ++-- templates/ruby/lib/container/services/service.rb.twig | 2 +- templates/swift/Sources/Services/Service.swift.twig | 2 +- templates/web/src/services/template.ts.twig | 4 ++-- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index 3b7bd4542b..fb0deaba5c 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -128,7 +128,7 @@ class {{ service.name | caseUcfirst }} : Service { val headers = mutableMapOf( {{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }}, {% if method.type == "graphql" %} - "x-{{ spec.title | caseLower }}-graphql-packed" to true + "x-sdk-graphql" to true {% endif %} ) {% if method.responseModel %} diff --git a/templates/dart/base/requests/graphql.twig b/templates/dart/base/requests/graphql.twig index 4a5262fea3..9c39b4192c 100644 --- a/templates/dart/base/requests/graphql.twig +++ b/templates/dart/base/requests/graphql.twig @@ -6,7 +6,7 @@ final Map headers = { {{ utils.map_headers(method.headers) }}, - "x-{{ spec.title | caseLower }}-graphql-packed: true, + "x-sdk-graphql: true, }}; final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index b1beb936e9..7bd0c6cd30 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -115,7 +115,7 @@ export class {{ service.name | caseUcfirst }} extends Service { '{{ key }}': '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', + 'x-sdk-graphql': 'true', {% endif %} }; diff --git a/templates/flutter/base/requests/graphql.twig b/templates/flutter/base/requests/graphql.twig index d27a2c085a..a023376268 100644 --- a/templates/flutter/base/requests/graphql.twig +++ b/templates/flutter/base/requests/graphql.twig @@ -6,7 +6,7 @@ final Map headers = { {{ utils.map_headers(method.headers) }}, - "x-{{ spec.title | caseLower }}-graphql-packed: true, + "x-sdk-graphql: true, }}; final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); diff --git a/templates/go/services/service.go.twig b/templates/go/services/service.go.twig index b422be6308..75745b64c7 100644 --- a/templates/go/services/service.go.twig +++ b/templates/go/services/service.go.twig @@ -48,7 +48,7 @@ func (srv *{{ service.name | caseUcfirst }}) {{ method.name | caseUcfirst }}({% "{{ key }}": "{{ header }}", {% endfor %} {% if method.type == 'graphql' %} - "x-{{ spec.title | caseLower }}-graphql-packed": "true", + "x-sdk-graphql": "true", {% endif %} } return srv.client.Call("{{ method.method | caseUpper }}", path, headers, params) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index edbdd21e9b..81f89b7a58 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -126,7 +126,7 @@ class {{ service.name | caseUcfirst }} : Service { val headers = mutableMapOf( {{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }}, {% if method.type == "graphql" %} - "x-{{ spec.title | caseLower }}-graphql-packed" to true + "x-sdk-graphql" to true {% endif %} ) {% if method.responseModel %} diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index de4fbc8c7f..6c81777377 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -92,7 +92,7 @@ class {{ service.name | caseUcfirst }} extends Service { '{{ key }}': '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', + 'x-sdk-graphql': 'true', {% endif %} }; diff --git a/templates/php/base/requests/graphql.twig b/templates/php/base/requests/graphql.twig index e9da38eac8..92664e52ec 100644 --- a/templates/php/base/requests/graphql.twig +++ b/templates/php/base/requests/graphql.twig @@ -6,6 +6,6 @@ '{{ key }}' => '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', + 'x-sdk-graphql': 'true', {% endif %} ], $params); \ No newline at end of file diff --git a/templates/python/package/services/service.py.twig b/templates/python/package/services/service.py.twig index 31078b0874..5fe32c90d7 100644 --- a/templates/python/package/services/service.py.twig +++ b/templates/python/package/services/service.py.twig @@ -73,7 +73,7 @@ class {{ service.name | caseUcfirst }}(Service): '{{ key }}': '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', + 'x-sdk-graphql': 'true', {% endif %} }, params, param_name, on_progress, upload_id) {% else %} @@ -86,7 +86,7 @@ class {{ service.name | caseUcfirst }}(Service): '{{ key }}': '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', + 'x-sdk-graphql': 'true', {% endif %} }, params) {% endif %} diff --git a/templates/ruby/lib/container/services/service.rb.twig b/templates/ruby/lib/container/services/service.rb.twig index 9d208e0909..30c13c6e85 100644 --- a/templates/ruby/lib/container/services/service.rb.twig +++ b/templates/ruby/lib/container/services/service.rb.twig @@ -52,7 +52,7 @@ module {{spec.title | caseUcfirst}} "{{ key }}": '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - "x-{{ spec.title | caseLower }}-graphql-packed": "true", + "x-sdk-graphql": "true", {% endif %} } diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index 7efc55ec86..09cd49223e 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -101,7 +101,7 @@ open class {{ service.name | caseUcfirst }}: Service { {% else %} {% if 'multipart/form-data' in method.consumes %}var{% else %}let{% endif %} headers: [String: String] = [ {{ method.headers|map((header, key) => " \"#{key}\": \"#{header}\"")|join(',\n')|raw }}{% if method.type == "graphql" %}, - "x-{{ spec.title | caseLower }}-graphql-packed": "true" + "x-sdk-graphql": "true" {% endif %} ] {% if method.responseModel %} diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index 3532262f27..ceb285b130 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -125,7 +125,7 @@ export class {{ service.name | caseUcfirst }} extends Service { '{{ key }}': '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', + 'x-sdk-graphql': 'true', {% endif %} } @@ -185,7 +185,7 @@ export class {{ service.name | caseUcfirst }} extends Service { '{{ key }}': '{{ header }}', {% endfor %} {% if method.type == 'graphql' %} - 'x-{{ spec.title | caseLower }}-graphql-packed': 'true', + 'x-sdk-graphql': 'true', {% endif %} }, payload); {% endif %} From 167c30f673e8138d59ff7f09043b76a1a26525b0 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 22 Jul 2022 14:32:29 +1200 Subject: [PATCH 171/555] JSON encode nested object parameters --- templates/web/src/services/template.ts.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index ceb285b130..87fb196bc3 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -59,13 +59,13 @@ export class {{ service.name | caseUcfirst }} extends Service { {% for parameter in method.parameters.query %} if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; - } + payload['{{ parameter.name }}'] = {% if method.type == 'graphql' %}JSON.stringify({% endif %}{% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if method.type == 'graphql' %}){% endif %}; + %} {% endfor %} {% for parameter in method.parameters.body %} if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; + payload['{{ parameter.name }}'] = {% if method.type == 'graphql' %}JSON.stringify({% endif %}{% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if method.type == 'graphql' %}){% endif %}; } {% endfor %} From aba457b62749d89f46b742af12f3bc8df4390fe1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 22 Jul 2022 14:37:10 +1200 Subject: [PATCH 172/555] Fix wrong brace --- templates/web/src/services/template.ts.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index 87fb196bc3..054092d87f 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -60,7 +60,7 @@ export class {{ service.name | caseUcfirst }} extends Service { {% for parameter in method.parameters.query %} if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { payload['{{ parameter.name }}'] = {% if method.type == 'graphql' %}JSON.stringify({% endif %}{% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if method.type == 'graphql' %}){% endif %}; - %} + } {% endfor %} {% for parameter in method.parameters.body %} From 556d759447fe0bf22bf89661591716b2a57f06e8 Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 22 Jul 2022 20:10:51 +0000 Subject: [PATCH 173/555] Fix alignment and spacing issues for Flutter SDK --- src/SDK/Language/Dart.php | 2 +- templates/flutter/base/requests/api.twig | 6 +++--- templates/flutter/base/requests/file.twig | 8 ++++---- templates/flutter/base/utils.twig | 18 +++++++++--------- .../flutter/lib/services/service.dart.twig | 13 ++++++------- 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index f83474de02..6a45c0a5f4 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -430,7 +430,7 @@ public function getFilters(): array new TwigFilter('dartComment', function ($value) { $value = explode("\n", $value); foreach ($value as $key => $line) { - $value[$key] = " /// " . wordwrap($value[$key], 75, "\n /// "); + $value[$key] = " /// " . wordwrap($value[$key], 75, "\n /// "); } return implode("\n", $value); }, ['is_safe' => ['html']]), diff --git a/templates/flutter/base/requests/api.twig b/templates/flutter/base/requests/api.twig index 44229d7202..233b53490a 100644 --- a/templates/flutter/base/requests/api.twig +++ b/templates/flutter/base/requests/api.twig @@ -1,11 +1,11 @@ {% import 'flutter/base/utils.twig' as utils %} final Map params = { - {{ utils.map_parameter(method.parameters.query) }} - {{ utils.map_parameter(method.parameters.body) }} + {{- utils.map_parameter(method.parameters.query) -}} + {{~ utils.map_parameter(method.parameters.body) }} }; final Map headers = { - {{ utils.map_headers(method.headers) }} + {{~ utils.map_headers(method.headers) }} }; final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); diff --git a/templates/flutter/base/requests/file.twig b/templates/flutter/base/requests/file.twig index bc41436c01..7a5777115e 100644 --- a/templates/flutter/base/requests/file.twig +++ b/templates/flutter/base/requests/file.twig @@ -1,11 +1,11 @@ - {% import 'flutter/base/utils.twig' as utils %} +{% import 'flutter/base/utils.twig' as utils %} final Map params = { - {{ utils.map_parameter(method.parameters.query) }} - {{ utils.map_parameter(method.parameters.body) }} + {{~ utils.map_parameter(method.parameters.query) }} + {{~ utils.map_parameter(method.parameters.body) }} }; final Map headers = { - {{ utils.map_headers(method.headers) }} + {{~ utils.map_headers(method.headers) }} }; {% if 'multipart/form-data' in method.consumes %} diff --git a/templates/flutter/base/utils.twig b/templates/flutter/base/utils.twig index cfd3c8e727..73a0fe950b 100644 --- a/templates/flutter/base/utils.twig +++ b/templates/flutter/base/utils.twig @@ -1,11 +1,11 @@ -{% macro map_parameter(parameters) %} -{% for parameter in parameters %} -'{{ parameter.name }}': {{ parameter.name | caseCamel | overrideIdentifier }}, -{% endfor %} -{% endmacro %} +{%- macro map_parameter(parameters) -%} +{%- for parameter in parameters ~%} + '{{ parameter.name }}': {{ parameter.name | caseCamel | overrideIdentifier }}, +{%- endfor ~%} +{%- endmacro ~%} -{% macro map_headers(headers) %} -{% for key, header in headers %} +{% macro map_headers(headers) -%} +{%- for key, header in headers %} '{{ key }}': '{{ header }}', -{% endfor %} -{% endmacro %} \ No newline at end of file +{%- endfor -%} +{%- endmacro -%} \ No newline at end of file diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index 2da2fe3165..94ee1eb940 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -8,7 +8,7 @@ part of {{ language.params.packageName }}; {% endmacro %} {%if service.description %} -{{ service.description|dartComment}} +{{- service.description|dartComment}} {% endif %} class {{ service.name | caseUcfirst }} extends Service { {{ service.name | caseUcfirst }}(Client client{{ _self.service_params(service.globalParams) }}): super(client); @@ -19,13 +19,13 @@ class {{ service.name | caseUcfirst }} extends Service { {% endif %} {% for method in service.methods %} - /// {{ method.title }} -{% if method.description %} - /// + /// {{ method.title }} +{%~ if method.description %} + /// {{ method.description|dartComment }} - /// + /// {% endif %} - {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all | filter((param) => not param.isGlobal), method.consumes) }}) async { + {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %}Future{% else %}{% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all | filter((param) => not param.isGlobal), method.consumes) }}) async { {% if method.parameters.path | length > 0 %}final{% else %}const{% endif %} String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | overrideIdentifier }}){% endfor %}; {% if 'multipart/form-data' in method.consumes %} @@ -37,7 +37,6 @@ class {{ service.name | caseUcfirst }} extends Service { {% else %} {{ include('flutter/base/requests/api.twig') }} {% endif %} - } {% endfor %} } \ No newline at end of file From 1204829d434f5e89253dbdf3e4c016438cebe97b Mon Sep 17 00:00:00 2001 From: Wen Yu Ge Date: Mon, 25 Jul 2022 14:57:49 -0400 Subject: [PATCH 174/555] Fix twig templates to add InputFile imports --- src/SDK/Language/Ruby.php | 4 ++-- templates/kotlin/docs/java/example.md.twig | 3 +++ templates/kotlin/docs/kotlin/example.md.twig | 3 +++ templates/python/docs/example.md.twig | 3 +++ templates/ruby/docs/example.md.twig | 3 +++ 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/SDK/Language/Ruby.php b/src/SDK/Language/Ruby.php index 84ed7f6bc1..f11c11b8f7 100644 --- a/src/SDK/Language/Ruby.php +++ b/src/SDK/Language/Ruby.php @@ -281,7 +281,7 @@ public function getParamExample(array $param) $output .= '{}'; break; case self::TYPE_FILE: - $output .= "InputFile.fromPath('dir/file.png')"; + $output .= "InputFile.from_path('dir/file.png')"; break; } } @@ -302,7 +302,7 @@ public function getParamExample(array $param) $output .= "'{$example}'"; break; case self::TYPE_FILE: - $output .= "InputFile.fromPath('dir/file.png')"; + $output .= "InputFile.from_path('dir/file.png')"; break; } } diff --git a/templates/kotlin/docs/java/example.md.twig b/templates/kotlin/docs/java/example.md.twig index 0267d3e877..143140b8b1 100644 --- a/templates/kotlin/docs/java/example.md.twig +++ b/templates/kotlin/docs/java/example.md.twig @@ -1,5 +1,8 @@ import {{ sdk.namespace | caseDot }}.Client import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} +{% if method.type == "upload" %} +import {{ sdk.namespace | caseDot }}.models.InputFile +{% endif %} public void main() { Client client = Client(context) diff --git a/templates/kotlin/docs/kotlin/example.md.twig b/templates/kotlin/docs/kotlin/example.md.twig index a084647bb2..fe84de068c 100644 --- a/templates/kotlin/docs/kotlin/example.md.twig +++ b/templates/kotlin/docs/kotlin/example.md.twig @@ -1,5 +1,8 @@ import {{ sdk.namespace | caseDot }}.Client import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} +{% if method.type == "upload" %} +import {{ sdk.namespace | caseDot }}.models.InputFile +{% endif %} suspend fun main() { val client = Client(context) diff --git a/templates/python/docs/example.md.twig b/templates/python/docs/example.md.twig index 141b29ebc8..b1de7a7c86 100644 --- a/templates/python/docs/example.md.twig +++ b/templates/python/docs/example.md.twig @@ -1,5 +1,8 @@ from {{ spec.title | caseSnake }}.client import Client from {{ spec.title | caseSnake }}.services.{{ service.name | caseSnake }} import {{ service.name | caseUcfirst }} +{% if method.type == "upload" %} +from {{ spec.title | caseSnake }}.input_file import InputFile +{% endif %} client = Client() diff --git a/templates/ruby/docs/example.md.twig b/templates/ruby/docs/example.md.twig index 88a30f382d..46121cfbf4 100644 --- a/templates/ruby/docs/example.md.twig +++ b/templates/ruby/docs/example.md.twig @@ -1,6 +1,9 @@ require 'appwrite' client = Appwrite::Client.new +{% if method.type == "upload" %} +InputFile = Appwrite::InputFile +{% endif %} client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint From 45bf402f3a99d5785212c8af0a8993254fa26393 Mon Sep 17 00:00:00 2001 From: Wen Yu Ge Date: Mon, 25 Jul 2022 15:14:58 -0400 Subject: [PATCH 175/555] Add InputFile in android --- templates/android/docs/java/example.md.twig | 3 +++ templates/android/docs/kotlin/example.md.twig | 3 +++ 2 files changed, 6 insertions(+) diff --git a/templates/android/docs/java/example.md.twig b/templates/android/docs/java/example.md.twig index a707e98b09..3631a2ca97 100644 --- a/templates/android/docs/java/example.md.twig +++ b/templates/android/docs/java/example.md.twig @@ -4,6 +4,9 @@ import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import {{ sdk.namespace | caseDot }}.Client import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} +{% if method.type == "upload" %} +import {{ sdk.namespace | caseDot }}.models.InputFile +{% endif %} public class MainActivity extends AppCompatActivity { diff --git a/templates/android/docs/kotlin/example.md.twig b/templates/android/docs/kotlin/example.md.twig index 1a070db999..abc38c9485 100644 --- a/templates/android/docs/kotlin/example.md.twig +++ b/templates/android/docs/kotlin/example.md.twig @@ -4,6 +4,9 @@ import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import {{ sdk.namespace | caseDot }}.Client import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} +{% if method.type == "upload" %} +import {{ sdk.namespace | caseDot }}.models.InputFile +{% endif %} class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { From 508fb1dfd83f582e85e4e8a18f1a38001487535d Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 26 Jul 2022 14:46:38 +0000 Subject: [PATCH 176/555] Initial push --- templates/swift/Sources/Services/Service.swift.twig | 9 +-------- templates/swift/base/requests/OAuth.twig | 12 ++++++++++++ templates/swift/base/requests/api.twig | 8 ++++++++ 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 templates/swift/base/requests/OAuth.twig create mode 100644 templates/swift/base/requests/api.twig diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index b5327ab1c9..e9b60002cf 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -131,14 +131,7 @@ open class {{ service.name | caseUcfirst }}: Service { onProgress: onProgress ) {% else %} - return try await client.call( - method: "{{ method.method | caseUpper }}", - path: path, - headers: headers, - params: params{% if method.responseModel %}, - converter: converter -{% endif %} - ) +{{include('swift/base/requests/api.twig')}} {% endif %} {% endif %} } diff --git a/templates/swift/base/requests/OAuth.twig b/templates/swift/base/requests/OAuth.twig new file mode 100644 index 0000000000..a0d0b5c7a7 --- /dev/null +++ b/templates/swift/base/requests/OAuth.twig @@ -0,0 +1,12 @@ + let query = "?\(client.parametersToQueryString(params: params))" + let url = URL(string: client.endPoint + path + query)! + let callbackScheme = "appwrite-callback-\(client.config["project"] ?? "")" + let group = DispatchGroup() + + group.enter() + WebAuthComponent.authenticate(url: url, callbackScheme: callbackScheme) { result in + group.leave() + } + group.wait() + + return true diff --git a/templates/swift/base/requests/api.twig b/templates/swift/base/requests/api.twig new file mode 100644 index 0000000000..1798b60bc2 --- /dev/null +++ b/templates/swift/base/requests/api.twig @@ -0,0 +1,8 @@ + return try await client.call( + method: "{{ method.method | caseUpper }}", + path: path, + headers: headers, + params: params{% if method.responseModel %}, + converter: converter +{% endif %} + ) \ No newline at end of file From 136909a83598bbbf361f33db36ef31ccbf9e45de Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Wed, 27 Jul 2022 13:27:59 +0000 Subject: [PATCH 177/555] merge changes from Jake --- templates/android/docs/java/example.md.twig | 3 --- templates/android/docs/kotlin/example.md.twig | 3 --- templates/kotlin/docs/java/example.md.twig | 3 --- templates/kotlin/docs/kotlin/example.md.twig | 3 --- templates/python/docs/example.md.twig | 3 --- 5 files changed, 15 deletions(-) diff --git a/templates/android/docs/java/example.md.twig b/templates/android/docs/java/example.md.twig index 3220a249c9..6c53999bdb 100644 --- a/templates/android/docs/java/example.md.twig +++ b/templates/android/docs/java/example.md.twig @@ -7,9 +7,6 @@ import {{ sdk.namespace | caseDot }}.Client import {{ sdk.namespace | caseDot }}.models.InputFile {% endif %} import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} -{% if method.type == "upload" %} -import {{ sdk.namespace | caseDot }}.models.InputFile -{% endif %} public class MainActivity extends AppCompatActivity { diff --git a/templates/android/docs/kotlin/example.md.twig b/templates/android/docs/kotlin/example.md.twig index 381de8dc31..b0b8ad8f4c 100644 --- a/templates/android/docs/kotlin/example.md.twig +++ b/templates/android/docs/kotlin/example.md.twig @@ -7,9 +7,6 @@ import {{ sdk.namespace | caseDot }}.Client import {{ sdk.namespace | caseDot }}.models.InputFile {% endif %} import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} -{% if method.type == "upload" %} -import {{ sdk.namespace | caseDot }}.models.InputFile -{% endif %} class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { diff --git a/templates/kotlin/docs/java/example.md.twig b/templates/kotlin/docs/java/example.md.twig index 20568b37ed..22ffafc277 100644 --- a/templates/kotlin/docs/java/example.md.twig +++ b/templates/kotlin/docs/java/example.md.twig @@ -3,9 +3,6 @@ import {{ sdk.namespace | caseDot }}.Client import {{ sdk.namespace | caseDot }}.models.InputFile {% endif %} import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} -{% if method.type == "upload" %} -import {{ sdk.namespace | caseDot }}.models.InputFile -{% endif %} public void main() { Client client = Client(context) diff --git a/templates/kotlin/docs/kotlin/example.md.twig b/templates/kotlin/docs/kotlin/example.md.twig index 4ceebb45a4..5c35a9fc6d 100644 --- a/templates/kotlin/docs/kotlin/example.md.twig +++ b/templates/kotlin/docs/kotlin/example.md.twig @@ -3,9 +3,6 @@ import {{ sdk.namespace | caseDot }}.Client import {{ sdk.namespace | caseDot }}.models.InputFile {% endif %} import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} -{% if method.type == "upload" %} -import {{ sdk.namespace | caseDot }}.models.InputFile -{% endif %} suspend fun main() { val client = Client(context) diff --git a/templates/python/docs/example.md.twig b/templates/python/docs/example.md.twig index ff892ca7c9..328789969c 100644 --- a/templates/python/docs/example.md.twig +++ b/templates/python/docs/example.md.twig @@ -3,9 +3,6 @@ from {{ spec.title | caseSnake }}.client import Client from {{ spec.title | caseSnake }}.input_file import InputFile {% endif %} from {{ spec.title | caseSnake }}.services.{{ service.name | caseSnake }} import {{ service.name | caseUcfirst }} -{% if method.type == "upload" %} -from {{ spec.title | caseSnake }}.input_file import InputFile -{% endif %} client = Client() From 127267e2a01c89112c05ea60b635956524e34b79 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 28 Jul 2022 13:15:51 +0000 Subject: [PATCH 178/555] push changes --- .../swift/Sources/Services/Service.swift.twig | 70 ++----------------- templates/swift/base/params.twig | 28 ++++++++ templates/swift/base/requests/file.twig | 18 +++++ templates/swift/base/requests/location.twig | 5 ++ 4 files changed, 55 insertions(+), 66 deletions(-) create mode 100644 templates/swift/base/params.twig create mode 100644 templates/swift/base/requests/file.twig create mode 100644 templates/swift/base/requests/location.twig diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index e9b60002cf..1048e51920 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -1,6 +1,3 @@ -{% macro methodNeedsSecurityParameters(method) %} -{% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} -{% endmacro %} {% macro resultType(spec, method) %} {% if method.type == "webAuth" %}Bool{% elseif method.type == "location" %}ByteBuffer{% elseif not method.responseModel or method.responseModel == 'any' %}Any{% else %}{{spec.title | caseUcfirst}}Models.{{method.responseModel | caseUcfirst}}{% endif %} {% endmacro %} @@ -51,53 +48,11 @@ open class {{ service.name | caseUcfirst }}: Service { onProgress: ((UploadProgress) -> Void)? = nil {% endif %} ) async throws -> {{ _self.resultType(spec, method) }} { -{% if method.parameters.path %} var{% else %} let{% endif %} path: String = "{{ method.path }}" -{% for parameter in method.parameters.path %} - path = path.replacingOccurrences( - of: "{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}", - with: {% if method.parameters.path %}{% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% else %}""{% endif %} - - ) -{% endfor %} -{% if method.parameters.query or method.parameters.body or method.parameters.formData or _self.methodNeedsSecurityParameters(method) %} - {% if 'multipart/form-data' in method.consumes %}var{% else %}let{% endif %} params: [String: Any?] = [ -{% else %} - let params: [String: Any?] = [:] -{% endif %} -{% for parameter in method.parameters.query | merge(method.parameters.body) %} - "{{ parameter.name }}": {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last or _self.methodNeedsSecurityParameters(method) %},{% endif %} - -{% endfor %} -{% if _self.methodNeedsSecurityParameters(method) %} -{% for node in method.security %} -{% for key,header in node|keys %} - "{{header|caseLower}}": client.config["{{header|caseLower}}"]{% if not loop.last %},{% endif %} - -{% endfor %} -{% endfor %} -{% endif %} -{% if method.parameters.query or method.parameters.body or method.parameters.formData or _self.methodNeedsSecurityParameters(method) %} - ] -{% endif %} +{{include('swift/base/params.twig')}} {% if method.type == 'webAuth' %} - let query = "?\(client.parametersToQueryString(params: params))" - let url = URL(string: client.endPoint + path + query)! - let callbackScheme = "appwrite-callback-\(client.config["project"] ?? "")" - let group = DispatchGroup() - - group.enter() - WebAuthComponent.authenticate(url: url, callbackScheme: callbackScheme) { result in - group.leave() - } - group.wait() - - return true +{{include('swift/base/requests/OAuth.twig')}} {% elseif method.type == 'location' %} - return try await client.call( - method: "{{ method.method | caseUpper }}", - path: path, - params: params - ) +{{include('swift/base/requests/location.twig')}} {% else %} {% if 'multipart/form-data' in method.consumes %}var{% else %}let{% endif %} headers: [String: String] = [ {{ method.headers|map((header, key) => " \"#{key}\": \"#{header}\"")|join(',\n')|raw }} @@ -112,24 +67,7 @@ open class {{ service.name | caseUcfirst }}: Service { } {% endif %} {% if 'multipart/form-data' in method.consumes %} - let idParamName: String? = {% if method.parameters.all | filter(p => p.isUploadID) | length > 0 %}{% for parameter in method.parameters.all | filter(parameter => parameter.isUploadID) %}"{{ parameter.name }}"{% endfor %}{% else %}nil{% endif %} - -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - let paramName = "{{ parameter.name }}" -{% endif %} -{% endfor %} - return try await client.chunkedUpload( - path: path, - headers: &headers, - params: ¶ms, - paramName: paramName, - idParamName: idParamName, -{% if method.responseModel %} - converter: converter, -{% endif %} - onProgress: onProgress - ) +{{include('swift/base/requests/file.twig')}} {% else %} {{include('swift/base/requests/api.twig')}} {% endif %} diff --git a/templates/swift/base/params.twig b/templates/swift/base/params.twig new file mode 100644 index 0000000000..da139a4a1b --- /dev/null +++ b/templates/swift/base/params.twig @@ -0,0 +1,28 @@ +{% macro methodNeedsSecurityParameters(method) %} +{% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} +{% endmacro %} +{% if method.parameters.path %} var{% else %} let{% endif %} path: String = "{{ method.path }}" +{% for parameter in method.parameters.path %} + path = path.replacingOccurrences( + of: "{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}", + with: {% if method.parameters.path %}{% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% else %}""{% endif %} + ) +{% endfor %} +{% if method.parameters.query or method.parameters.body or method.parameters.formData or _self.methodNeedsSecurityParameters(method) %} + {% if 'multipart/form-data' in method.consumes %}var{% else %}let{% endif %} params: [String: Any?] = [ +{% else %} + let params: [String: Any?] = [:] +{% endif %} +{% for parameter in method.parameters.query | merge(method.parameters.body) %} + "{{ parameter.name }}": {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last or _self.methodNeedsSecurityParameters(method) %},{% endif %} +{% endfor %} +{% if _self.methodNeedsSecurityParameters(method) %} +{% for node in method.security %} +{% for key,header in node|keys %} + "{{header|caseLower}}": client.config["{{header|caseLower}}"]{% if not loop.last %},{% endif %} +{% endfor %} +{% endfor %} +{% endif %} +{% if method.parameters.query or method.parameters.body or method.parameters.formData or _self.methodNeedsSecurityParameters(method) %} + ] +{% endif %} \ No newline at end of file diff --git a/templates/swift/base/requests/file.twig b/templates/swift/base/requests/file.twig new file mode 100644 index 0000000000..594bbe38b0 --- /dev/null +++ b/templates/swift/base/requests/file.twig @@ -0,0 +1,18 @@ + let idParamName: String? = {% if method.parameters.all | filter(p => p.isUploadID) | length > 0 %}{% for parameter in method.parameters.all | filter(parameter => parameter.isUploadID) %}"{{ parameter.name }}"{% endfor %}{% else %}nil{% endif %} + +{% for parameter in method.parameters.all %} +{% if parameter.type == 'file' %} + let paramName = "{{ parameter.name }}" +{% endif %} +{% endfor %} + return try await client.chunkedUpload( + path: path, + headers: &headers, + params: ¶ms, + paramName: paramName, + idParamName: idParamName, +{% if method.responseModel %} + converter: converter, +{% endif %} + onProgress: onProgress + ) \ No newline at end of file diff --git a/templates/swift/base/requests/location.twig b/templates/swift/base/requests/location.twig new file mode 100644 index 0000000000..a115d056da --- /dev/null +++ b/templates/swift/base/requests/location.twig @@ -0,0 +1,5 @@ + return try await client.call( + method: "{{ method.method | caseUpper }}", + path: path, + params: params + ) \ No newline at end of file From dad9037667f87153ac7a5b12f8f8523ba5609b29 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Mon, 1 Aug 2022 15:19:56 +0000 Subject: [PATCH 179/555] refactor kotlin templates --- .../macros/methodNeedsSecurityParameters.twig | 3 + templates/kotlin/base/macros/parameter.twig | 4 ++ templates/kotlin/base/macros/resultType.twig | 3 + templates/kotlin/base/requests/api.twig | 11 ++++ templates/kotlin/base/requests/file.twig | 19 ++++++ templates/kotlin/base/requests/location.twig | 6 ++ .../appwrite/services/ServiceTemplate.kt.twig | 63 ++++--------------- 7 files changed, 58 insertions(+), 51 deletions(-) create mode 100644 templates/kotlin/base/macros/methodNeedsSecurityParameters.twig create mode 100644 templates/kotlin/base/macros/parameter.twig create mode 100644 templates/kotlin/base/macros/resultType.twig create mode 100644 templates/kotlin/base/requests/api.twig create mode 100644 templates/kotlin/base/requests/file.twig create mode 100644 templates/kotlin/base/requests/location.twig diff --git a/templates/kotlin/base/macros/methodNeedsSecurityParameters.twig b/templates/kotlin/base/macros/methodNeedsSecurityParameters.twig new file mode 100644 index 0000000000..e3df533df5 --- /dev/null +++ b/templates/kotlin/base/macros/methodNeedsSecurityParameters.twig @@ -0,0 +1,3 @@ +{% macro methodNeedsSecurityParameters(method) %} +{% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} +{% endmacro %} \ No newline at end of file diff --git a/templates/kotlin/base/macros/parameter.twig b/templates/kotlin/base/macros/parameter.twig new file mode 100644 index 0000000000..52445bccfe --- /dev/null +++ b/templates/kotlin/base/macros/parameter.twig @@ -0,0 +1,4 @@ +{% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter.type | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} +{% macro method_parameters(parameters, consumes) %} +{% if parameters.all|length > 0 %}{% for parameter in parameters.all | filter((param) => not param.isGlobal) %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} +{% endmacro %} \ No newline at end of file diff --git a/templates/kotlin/base/macros/resultType.twig b/templates/kotlin/base/macros/resultType.twig new file mode 100644 index 0000000000..1125be27ff --- /dev/null +++ b/templates/kotlin/base/macros/resultType.twig @@ -0,0 +1,3 @@ +{% macro resultType(namespace, method) %} +{% if method.type == "webAuth" %}Bool{% elseif method.type == "location" %}ByteArray{% elseif not method.responseModel or method.responseModel == 'any' %}Any{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} +{% endmacro %} \ No newline at end of file diff --git a/templates/kotlin/base/requests/api.twig b/templates/kotlin/base/requests/api.twig new file mode 100644 index 0000000000..5ab352ec45 --- /dev/null +++ b/templates/kotlin/base/requests/api.twig @@ -0,0 +1,11 @@ +{% import 'kotlin/base/macros/resultType.twig' as result%} + return client.call( + "{{ method.method | caseUpper }}", + path, + headers, + params, + responseType = {{ result.resultType(sdk.namespace, method) }}::class.java, +{% if method.responseModel %} + converter, +{% endif %} + ) \ No newline at end of file diff --git a/templates/kotlin/base/requests/file.twig b/templates/kotlin/base/requests/file.twig new file mode 100644 index 0000000000..fb5f31d84e --- /dev/null +++ b/templates/kotlin/base/requests/file.twig @@ -0,0 +1,19 @@ + val idParamName: String? = {% if method.parameters.all | filter(p => p.isUploadID) | length > 0 %}{% for parameter in method.parameters.all | filter(parameter => parameter.isUploadID) %}"{{ parameter.name }}"{% endfor %}{% else %}null{% endif %} + +{% for parameter in method.parameters.all %} +{% if parameter.type == 'file' %} + val paramName = "{{ parameter.name }}" +{% endif %} +{% endfor %} + return client.chunkedUpload( + path, + headers, + params, + responseType = {{ result.resultType(sdk.namespace, method) }}::class.java, +{% if method.responseModel %} + converter, +{% endif %} + paramName, + idParamName, + onProgress, + ) \ No newline at end of file diff --git a/templates/kotlin/base/requests/location.twig b/templates/kotlin/base/requests/location.twig new file mode 100644 index 0000000000..1bc46a598f --- /dev/null +++ b/templates/kotlin/base/requests/location.twig @@ -0,0 +1,6 @@ + return client.call( + "{{ method.method | caseUpper }}", + path, + params = params, + responseType = {{ result.resultType(sdk.namespace, method) }}::class.java + ) \ No newline at end of file diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index cf8997519f..e8b34ad8a4 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -1,13 +1,6 @@ -{% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter.type | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} -{% macro method_parameters(parameters, consumes) %} -{% if parameters.all|length > 0 %}{% for parameter in parameters.all | filter((param) => not param.isGlobal) %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} -{% endmacro %} -{% macro methodNeedsSecurityParameters(method) %} -{% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} -{% endmacro %} -{% macro resultType(namespace, method) %} -{% if method.type == "webAuth" %}Bool{% elseif method.type == "location" %}ByteArray{% elseif not method.responseModel or method.responseModel == 'any' %}Any{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} -{% endmacro %} +{% import 'kotlin/base/macros/parameter.twig' as parameters %} +{% import 'kotlin/base/macros/methodNeedsSecurityParameters.twig' as securityParameters %} +{% import 'kotlin/base/macros/resultType.twig' as result %} package {{ sdk.namespace | caseDot }}.services import {{ sdk.namespace | caseDot }}.Client import {{ sdk.namespace | caseDot }}.models.* @@ -52,20 +45,20 @@ class {{ service.name | caseUcfirst }} : Service { {% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} * @param {{ parameter.name | caseCamel }} {{ parameter.description }} {% endfor %} - * {% if method.type != "webAuth" %}@return [{{ _self.resultType(sdk.namespace, method) }}]{% endif %} + * {% if method.type != "webAuth" %}@return [{{ result.resultType(sdk.namespace, method) }}]{% endif %} */ @JvmOverloads @Throws({{ spec.title | caseUcfirst }}Exception::class) - suspend fun {{ method.name | caseCamel }}({% if method.type == "webAuth" %}{{ '\n\t\t' }}activity: ComponentActivity{% if method.parameters.all | length > 0 %}, {% endif %}{% endif %}{{ _self.method_parameters(method.parameters, method.consumes) }}{% if method.parameters.all|length > 0 %}{{ '\n\t' }}{% endif %}){% if method.type != "webAuth" %}: {{ _self.resultType(sdk.namespace, method) }}{% endif %} { + suspend fun {{ method.name | caseCamel }}({% if method.type == "webAuth" %}{{ '\n\t\t' }}activity: ComponentActivity{% if method.parameters.all | length > 0 %}, {% endif %}{% endif %}{{ parameters.method_parameters(method.parameters, method.consumes) }}{% if method.parameters.all|length > 0 %}{{ '\n\t' }}{% endif %}){% if method.type != "webAuth" %}: {{ result.resultType(sdk.namespace, method) }}{% endif %} { val path = "{{ method.path }}"{% for parameter in method.parameters.path %}.replace("{{ '{' ~ parameter.name | caseCamel ~ '}' }}", {{ parameter.name | caseCamel }}){% endfor %} val params = mutableMapOf( {% for parameter in method.parameters.query | merge(method.parameters.body) %} - "{{ parameter.name }}" to {{ parameter.name | caseCamel }}{% if not loop.last or _self.methodNeedsSecurityParameters(method) %},{% endif %} + "{{ parameter.name }}" to {{ parameter.name | caseCamel }}{% if not loop.last or securityParameters.methodNeedsSecurityParameters(method) %},{% endif %} {% endfor %} -{% if _self.methodNeedsSecurityParameters(method) %} +{% if securityParameters.methodNeedsSecurityParameters(method) %} {% for node in method.security %} {% for key,header in node|keys %} "{{header|caseLower}}" to client.config["{{header|caseLower}}"]{% if not loop.last %},{% endif %} @@ -116,56 +109,24 @@ class {{ service.name | caseUcfirst }} : Service { ) } {% elseif method.type == 'location' %} - return client.call( - "{{ method.method | caseUpper }}", - path, - params = params, - responseType = {{ _self.resultType(sdk.namespace, method) }}::class.java - ) +{{ include('kotlin/base/requests/location.twig') }} {% else %} val headers = mutableMapOf( {{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} ) {% if method.responseModel %} - val converter: (Map) -> {{ _self.resultType(sdk.namespace, method) }} = { + val converter: (Map) -> {{ result.resultType(sdk.namespace, method) }} = { {% if method.responseModel == 'any' %} it {% else %} - {{ _self.resultType(sdk.namespace, method) }}.from(map = it) + {{ result.resultType(sdk.namespace, method) }}.from(map = it) {% endif %} } {% endif %} {% if 'multipart/form-data' in method.consumes %} - val idParamName: String? = {% if method.parameters.all | filter(p => p.isUploadID) | length > 0 %}{% for parameter in method.parameters.all | filter(parameter => parameter.isUploadID) %}"{{ parameter.name }}"{% endfor %}{% else %}null{% endif %} - -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} - val paramName = "{{ parameter.name }}" -{% endif %} -{% endfor %} - return client.chunkedUpload( - path, - headers, - params, - responseType = {{ _self.resultType(sdk.namespace, method) }}::class.java, -{% if method.responseModel %} - converter, -{% endif %} - paramName, - idParamName, - onProgress, - ) +{{include('kotlin/base/requests/file.twig')}} {% else %} - return client.call( - "{{ method.method | caseUpper }}", - path, - headers, - params, - responseType = {{ _self.resultType(sdk.namespace, method) }}::class.java, -{% if method.responseModel %} - converter, -{% endif %} - ) +{{include('kotlin/base/requests/api.twig')}} {% endif %} {% endif %} } From 7d39b0b8e8f901db385555d1baef92ea1dca8263 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 2 Aug 2022 10:52:51 +0200 Subject: [PATCH 180/555] fix: web SDK removing global params --- composer.json | 6 +-- composer.lock | 56 ++++++++++----------- specs/swagger2-latest-console.json | 2 +- templates/web/src/models.ts.twig | 2 +- templates/web/src/services/template.ts.twig | 41 ++++----------- 5 files changed, 43 insertions(+), 64 deletions(-) diff --git a/composer.json b/composer.json index cca3500474..6a66ae8d94 100644 --- a/composer.json +++ b/composer.json @@ -23,11 +23,11 @@ "ext-curl": "*", "ext-mbstring": "*", "ext-json": "*", - "twig/twig": "^3.3", - "matthiasmullie/minify": "^1.3" + "twig/twig": "^3.4.1", + "matthiasmullie/minify": "^1.3.68" }, "require-dev": { - "phpunit/phpunit": "^9.5.13", + "phpunit/phpunit": "^9.5.21", "brianium/paratest": "^6.4" }, "minimum-stability": "dev", diff --git a/composer.lock b/composer.lock index b9935887aa..d878fe79e5 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": "007d124489decbc914d4a6a4d34e2a79", + "content-hash": "2d23d511c41193e87e2bf387370c4082", "packages": [ { "name": "matthiasmullie/minify", @@ -374,16 +374,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v6.5.1", + "version": "v6.6.1", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9" + "reference": "ae5803ce4558f855c7d955baa2d90b93ec40c4b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9", - "reference": "41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/ae5803ce4558f855c7d955baa2d90b93ec40c4b7", + "reference": "ae5803ce4558f855c7d955baa2d90b93ec40c4b7", "shasum": "" }, "require": { @@ -398,18 +398,18 @@ "phpunit/php-timer": "^5.0.3", "phpunit/phpunit": "^9.5.21", "sebastian/environment": "^5.1.4", - "symfony/console": "^5.4.9 || ^6.1.1", + "symfony/console": "^5.4.9 || ^6.1.2", "symfony/process": "^5.4.8 || ^6.1.0" }, "require-dev": { "doctrine/coding-standard": "^9.0.0", "ext-pcov": "*", "ext-posix": "*", - "infection/infection": "^0.26.12", + "infection/infection": "^0.26.13", "malukenho/mcbumpface": "^1.1.5", "squizlabs/php_codesniffer": "^3.7.1", "symfony/filesystem": "^5.4.9 || ^6.1.0", - "vimeo/psalm": "^4.23.0" + "vimeo/psalm": "^4.24.0" }, "bin": [ "bin/paratest", @@ -450,7 +450,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v6.5.1" + "source": "https://github.com/paratestphp/paratest/tree/v6.6.1" }, "funding": [ { @@ -462,7 +462,7 @@ "type": "paypal" } ], - "time": "2022-06-24T16:02:27+00:00" + "time": "2022-07-22T14:07:17+00:00" }, { "name": "doctrine/instantiator", @@ -2485,16 +2485,16 @@ }, { "name": "symfony/console", - "version": "v6.1.2", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7" + "reference": "43fcb5c5966b43c56bcfa481368d90d748936ab8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7a86c1c42fbcb69b59768504c7bca1d3767760b7", - "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7", + "url": "https://api.github.com/repos/symfony/console/zipball/43fcb5c5966b43c56bcfa481368d90d748936ab8", + "reference": "43fcb5c5966b43c56bcfa481368d90d748936ab8", "shasum": "" }, "require": { @@ -2561,7 +2561,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.2" + "source": "https://github.com/symfony/console/tree/v6.1.3" }, "funding": [ { @@ -2577,7 +2577,7 @@ "type": "tidelift" } ], - "time": "2022-06-26T13:01:30+00:00" + "time": "2022-07-22T14:17:57+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2813,16 +2813,16 @@ }, { "name": "symfony/process", - "version": "v6.1.0", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "318718453c2be58266f1a9e74063d13cb8dd4165" + "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/318718453c2be58266f1a9e74063d13cb8dd4165", - "reference": "318718453c2be58266f1a9e74063d13cb8dd4165", + "url": "https://api.github.com/repos/symfony/process/zipball/a6506e99cfad7059b1ab5cab395854a0a0c21292", + "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292", "shasum": "" }, "require": { @@ -2854,7 +2854,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.1.0" + "source": "https://github.com/symfony/process/tree/v6.1.3" }, "funding": [ { @@ -2870,7 +2870,7 @@ "type": "tidelift" } ], - "time": "2022-05-11T12:12:29+00:00" + "time": "2022-06-27T17:24:16+00:00" }, { "name": "symfony/service-contracts", @@ -2959,16 +2959,16 @@ }, { "name": "symfony/string", - "version": "v6.1.2", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "1903f2879875280c5af944625e8246d81c2f0604" + "reference": "f35241f45c30bcd9046af2bb200a7086f70e1d6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/1903f2879875280c5af944625e8246d81c2f0604", - "reference": "1903f2879875280c5af944625e8246d81c2f0604", + "url": "https://api.github.com/repos/symfony/string/zipball/f35241f45c30bcd9046af2bb200a7086f70e1d6b", + "reference": "f35241f45c30bcd9046af2bb200a7086f70e1d6b", "shasum": "" }, "require": { @@ -3024,7 +3024,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.2" + "source": "https://github.com/symfony/string/tree/v6.1.3" }, "funding": [ { @@ -3040,7 +3040,7 @@ "type": "tidelift" } ], - "time": "2022-06-26T16:35:04+00:00" + "time": "2022-07-27T15:50:51+00:00" }, { "name": "theseer/tokenizer", diff --git a/specs/swagger2-latest-console.json b/specs/swagger2-latest-console.json index bf56610532..a3c749bc4d 100644 --- a/specs/swagger2-latest-console.json +++ b/specs/swagger2-latest-console.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"version":"0.15.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":"HOSTNAME","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":52,"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":40,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":59,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":51,"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":100,"rate-time":3600,"rate-key":"url:{url},userId:{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":55,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":57,"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, Team Invites and Magic URL, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":58,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/phone":{"patch":{"summary":"Update Account Phone","operationId":"accountUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account phone number. After changing phone number, the user confirmation status will get reset. A new confirmation SMS is not sent automatically however you can use the phone confirmation endpoint again to send the confirmation SMS.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":60,"cookies":false,"type":"","demo":"account\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["number","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":53,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":61,"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":{},"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":66,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":67,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":54,"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":[]}]},"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":65,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":50,"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\/email":{"post":{"summary":"Create Account Session with Email","operationId":"accountCreateEmailSession","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":"createEmailSession","weight":41,"cookies":false,"type":"","demo":"account\/create-email-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email.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 at least 8 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/sessions\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":46,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":47,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":42,"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, auth0, bitbucket, bitly, box, dailymotion, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, notion, okta, paypal, paypalSandbox, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoom.","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":"","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":"","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/phone":{"post":{"summary":"Create Phone session","operationId":"accountCreatePhoneSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user a SMS with a secret key for creating a session. Use the returned user ID and the secret to submit a request to the [PUT \/account\/sessions\/phone](\/docs\/client\/account#accountUpdatePhoneSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneSession","weight":48,"cookies":false,"type":"","demo":"account\/create-phone-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"number":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null}},"required":["userId","number"]}}]},"put":{"summary":"Create Phone session (confirmation)","operationId":"accountUpdatePhoneSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updatePhoneSession","weight":49,"cookies":false,"type":"","demo":"account\/update-phone-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/sessions\/{sessionId}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":56,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to \"refresh\" the access token.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":64,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":63,"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 ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/status":{"patch":{"summary":"Update Account Status","operationId":"accountUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":62,"cookies":false,"type":"","demo":"account\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/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#accountUpdateEmailVerification). 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":68,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":69,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/verification\/phone":{"post":{"summary":"Create Phone Verification","operationId":"accountCreatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification message to your user's phone number to confirm they are the valid owners of that address. The provided secret should 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#accountUpdatePhoneVerification). The verification link sent to the user's phone number is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneVerification","weight":70,"cookies":false,"type":"","demo":"account\/create-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]},"put":{"summary":"Create Phone Verification (confirmation)","operationId":"accountUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":71,"cookies":false,"type":"","demo":"account\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"avatarsGetBrowser","consumes":["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 [GET \/account\/sessions](\/docs\/client\/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":73,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":72,"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":76,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":74,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":75,"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. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":78,"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.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":77,"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 1 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":1,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/databases":{"get":{"summary":"List Databases","operationId":"databasesList","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Databases List","schema":{"$ref":"#\/definitions\/databaseList"}}},"x-appwrite":{"method":"list","weight":80,"cookies":false,"type":"","demo":"databases\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 Database","operationId":"databasesCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"create","weight":79,"cookies":false,"type":"","demo":"databases\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"databaseId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DATABASE_ID]","x-global":true},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["databaseId","name"]}}]}},"\/databases\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databasesGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageDatabases","schema":{"$ref":"#\/definitions\/usageDatabases"}}},"x-appwrite":{"method":"getUsage","weight":112,"cookies":false,"type":"","demo":"databases\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"`Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/databases\/{databaseId}":{"get":{"summary":"Get Database","operationId":"databasesGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"get","weight":81,"cookies":false,"type":"","demo":"databases\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]},"put":{"summary":"Update Database","operationId":"databasesUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"update","weight":83,"cookies":false,"type":"","demo":"databases\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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]"}},"required":["name"]}}]},"delete":{"summary":"Delete Database","operationId":"databasesDelete","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":84,"cookies":false,"type":"","demo":"databases\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections":{"get":{"summary":"List Collections","operationId":"databasesListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":86,"cookies":false,"type":"","demo":"databases\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"databasesCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":85,"cookies":false,"type":"","demo":"databases\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[COLLECTION_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Specifies the permissions model used in this collection, which accepts either 'collection' or 'document'. For 'collection' level permission, the permissions specified in read and write params are applied to all documents in the collection. For 'document' level permissions, read and write permissions are specified in each document. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databasesGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"getCollection","weight":87,"cookies":false,"type":"","demo":"databases\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databasesUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":89,"cookies":false,"type":"","demo":"databases\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Collection","operationId":"databasesDeleteCollection","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteCollection","weight":90,"cookies":false,"type":"","demo":"databases\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databasesListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":99,"cookies":false,"type":"","demo":"databases\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databasesCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":98,"cookies":false,"type":"","demo":"databases\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databasesCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":92,"cookies":false,"type":"","demo":"databases\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databasesCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":93,"cookies":false,"type":"","demo":"databases\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 4096 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databasesCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":97,"cookies":false,"type":"","demo":"databases\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"number","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"number","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databasesCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":96,"cookies":false,"type":"","demo":"databases\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databasesCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":94,"cookies":false,"type":"","demo":"databases\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databasesCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":91,"cookies":false,"type":"","demo":"databases\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databasesCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":95,"cookies":false,"type":"","demo":"databases\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databasesGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":100,"cookies":false,"type":"","demo":"databases\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databasesDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":101,"cookies":false,"type":"","demo":"databases\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databasesListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":107,"cookies":false,"type":"","demo":"databases\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/database#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results. Maximum of 100 order attributes are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order. Maximum of 100 order types are allowed.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]},"post":{"summary":"Create Document","operationId":"databasesCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":106,"cookies":false,"type":"","demo":"databases\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","data"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databasesGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"getDocument","weight":108,"cookies":false,"type":"","demo":"databases\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databasesUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"updateDocument","weight":110,"cookies":false,"type":"","demo":"databases\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object. Include only attribute and value pairs to be updated.","default":[],"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete Document","operationId":"databasesDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":111,"cookies":false,"type":"","demo":"databases\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databasesListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":109,"cookies":false,"type":"","demo":"databases\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databasesListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":103,"cookies":false,"type":"","demo":"databases\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databasesCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":102,"cookies":false,"type":"","demo":"databases\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders. Maximum of 100 orders are allowed.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databasesGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":104,"cookies":false,"type":"","demo":"databases\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databasesDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":105,"cookies":false,"type":"","demo":"databases\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databasesListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":88,"cookies":false,"type":"","demo":"databases\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databasesGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":114,"cookies":false,"type":"","demo":"databases\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databasesListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":82,"cookies":false,"type":"","demo":"databases\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/databases\/{databaseId}\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databasesGetDatabaseUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getDatabaseUsage","weight":113,"cookies":false,"type":"","demo":"databases\/get-database-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"range","description":"`Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/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":212,"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":"Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":211,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[FUNCTION_ID]"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Function maximum execution time in seconds.","default":15,"x-example":1}},"required":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List runtimes","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active on your instance.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":213,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":214,"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 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":216,"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 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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Maximum execution time in seconds.","default":15,"x-example":1}},"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":218,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments":{"get":{"summary":"List Deployments","operationId":"functionsListDeployments","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code deployments. You can use the query params to filter your results.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"listDeployments","weight":220,"cookies":false,"type":"","demo":"functions\/list-deployments.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-deployments.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 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":"Maximum number of deployments to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 Deployment","operationId":"functionsCreateDeployment","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"createDeployment","weight":219,"cookies":false,"type":"","demo":"functions\/create-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"entrypoint","description":"Entrypoint File.","required":true,"type":"string","x-example":"[ENTRYPOINT]","in":"formData"},{"name":"code","description":"Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.","required":true,"type":"file","in":"formData"},{"name":"activate","description":"Automatically activate the deployment when it is finished building.","required":true,"type":"boolean","x-example":false,"in":"formData"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}":{"get":{"summary":"Get Deployment","operationId":"functionsGetDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code deployment by its unique ID.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"getDeployment","weight":221,"cookies":false,"type":"","demo":"functions\/get-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"patch":{"summary":"Update Function Deployment","operationId":"functionsUpdateDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateDeployment","weight":217,"cookies":false,"type":"","demo":"functions\/update-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"delete":{"summary":"Delete Deployment","operationId":"functionsDeleteDeployment","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code deployment by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDeployment","weight":222,"cookies":false,"type":"","demo":"functions\/delete-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":226,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":224,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":223,"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 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]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":225,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":215,"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 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":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":122,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":132,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":125,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":124,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":129,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":130,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":128,"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\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":127,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":131,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":126,"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":115,"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":119,"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":116,"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":117,"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":118,"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":120,"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":121,"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":135,"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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":134,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[PROJECT_ID]"},"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":["projectId","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":136,"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":138,"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":143,"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 at least 8 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":141,"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":"integer","description":"Set the max number of users allowed in this project. Use 0 for unlimited.","default":null,"x-example":0}},"required":["limit"]}}]}},"\/projects\/{projectId}\/auth\/{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":142,"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,magic-url,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":161,"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":160,"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":162,"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":164,"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":163,"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":151,"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":150,"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. Maximum of 100 scopes are allowed.","default":null,"x-example":null,"items":{"type":"string"}},"expire":{"type":"integer","description":"Key expiration time in Unix timestamp. Use 0 for unlimited expiration.","default":0,"x-example":null}},"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":152,"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":153,"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. Maximum of 100 events are allowed.","default":null,"x-example":null,"items":{"type":"string"}},"expire":{"type":"integer","description":"Key expiration time in Unix timestamp. Use 0 for unlimited expiration.","default":0,"x-example":null}},"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":154,"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":140,"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":156,"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":155,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":null}},"required":["type","name"]}}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"projectsGetPlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"getPlatform","weight":157,"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":158,"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":null}},"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":159,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":139,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":137,"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":145,"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":144,"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. Maximum of 100 events are allowed.","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":146,"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":147,"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. Maximum of 100 events are allowed.","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":149,"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"}]}},"\/projects\/{projectId}\/webhooks\/{webhookId}\/signature":{"patch":{"summary":"Update Webhook Signature Key","operationId":"projectsUpdateWebhookSignature","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"updateWebhookSignature","weight":148,"cookies":false,"type":"","demo":"projects\/update-webhook-signature.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\/buckets":{"get":{"summary":"List buckets","operationId":"storageListBuckets","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the storage buckets. You can use the query params to filter your results.","responses":{"200":{"description":"Buckets List","schema":{"$ref":"#\/definitions\/bucketList"}}},"x-appwrite":{"method":"listBuckets","weight":166,"cookies":false,"type":"","demo":"storage\/list-buckets.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"cursor","description":"ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 bucket","operationId":"storageCreateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new storage bucket.","responses":{"201":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"createBucket","weight":165,"cookies":false,"type":"","demo":"storage\/create-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"bucketId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[BUCKET_ID]"},"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":30000000,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["bucketId","name","permission"]}}]}},"\/storage\/buckets\/{bucketId}":{"get":{"summary":"Get Bucket","operationId":"storageGetBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"getBucket","weight":167,"cookies":false,"type":"","demo":"storage\/get-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]},"put":{"summary":"Update Bucket","operationId":"storageUpdateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a storage bucket by its unique ID.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"updateBucket","weight":168,"cookies":false,"type":"","demo":"storage\/update-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":null,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Bucket","operationId":"storageDeleteBucket","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a storage bucket by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteBucket","weight":169,"cookies":false,"type":"","demo":"storage\/delete-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["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":171,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":170,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/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":172,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":176,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":177,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":174,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":173,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":175,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":178,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":179,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":181,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":180,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":182,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":183,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":184,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/logs":{"get":{"summary":"List Team Logs","operationId":"teamsListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get the team activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":191,"cookies":false,"type":"","demo":"teams\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":186,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":185,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"URL to redirect the user back to your app from the invitation email. 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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":187,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":188,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["roles"]}}]},"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteMembership","weight":190,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":189,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":193,"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":"Maximum number of users to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":192,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":210,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":194,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"usersDelete","consumes":["application\/json"],"produces":[],"tags":["users"],"description":"Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](\/docs\/server\/users#usersUpdateStatus) endpoint instead.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":209,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":204,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":198,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/users\/{userId}\/memberships":{"get":{"summary":"Get User Memberships","operationId":"usersGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user membership list by its unique ID.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":197,"cookies":false,"type":"","demo":"users\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-memberships.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":202,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":203,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/users\/{userId}\/phone":{"patch":{"summary":"Update Phone","operationId":"usersUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":205,"cookies":false,"type":"","demo":"users\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"User phone number.","default":null,"x-example":null}},"required":["number"]}}]}},"\/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":195,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"usersUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":206,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":196,"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 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":208,"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 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":207,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":199,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateEmailVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmailVerification","weight":200,"cookies":false,"type":"","demo":"users\/update-email-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}},"\/users\/{userId}\/verification\/phone":{"patch":{"summary":"Update Phone Verification","operationId":"usersUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":201,"cookies":false,"type":"","demo":"users\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"phoneVerification":{"type":"boolean","description":"User phone verification status.","default":null,"x-example":false}},"required":["phoneVerification"]}}]}}},"tags":[{"name":"account","description":"The Account service allows you to authenticate and manage a user account.","x-globalAttributes":[]},{"name":"avatars","description":"The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.","x-globalAttributes":[]},{"name":"databases","description":"The Databases service allows you to create structured collections of documents, query and filter lists of documents","x-globalAttributes":["databaseId"]},{"name":"locale","description":"The Locale service allows you to customize your app based on your users' location.","x-globalAttributes":[]},{"name":"health","description":"The Health service allows you to both validate and monitor your Appwrite server's health.","x-globalAttributes":[]},{"name":"projects","description":"The Project service allows you to manage all the projects in your Appwrite server.","x-globalAttributes":[]},{"name":"storage","description":"The Storage service allows you to manage your project files.","x-globalAttributes":[]},{"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","x-globalAttributes":[]},{"name":"users","description":"The Users service allows you to manage your project users.","x-globalAttributes":[]},{"name":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions.","x-globalAttributes":[]}],"definitions":{"documentList":{"description":"Documents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of documents documents that matched your query.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["total","documents"]},"collectionList":{"description":"Collections List","type":"object","properties":{"total":{"type":"integer","description":"Total number of collections documents that matched your query.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["total","collections"]},"databaseList":{"description":"Databases List","type":"object","properties":{"total":{"type":"integer","description":"Total number of databases documents that matched your query.","x-example":5,"format":"int32"},"databases":{"type":"array","description":"List of databases.","items":{"type":"object","$ref":"#\/definitions\/database"},"x-example":""}},"required":["total","databases"]},"indexList":{"description":"Indexes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of indexes documents that matched your query.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["total","indexes"]},"userList":{"description":"Users List","type":"object","properties":{"total":{"type":"integer","description":"Total number of users documents that matched your query.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["total","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of sessions documents that matched your query.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["total","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"total":{"type":"integer","description":"Total number of logs documents that matched your query.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["total","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"total":{"type":"integer","description":"Total number of files documents that matched your query.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["total","files"]},"bucketList":{"description":"Buckets List","type":"object","properties":{"total":{"type":"integer","description":"Total number of buckets documents that matched your query.","x-example":5,"format":"int32"},"buckets":{"type":"array","description":"List of buckets.","items":{"type":"object","$ref":"#\/definitions\/bucket"},"x-example":""}},"required":["total","buckets"]},"teamList":{"description":"Teams List","type":"object","properties":{"total":{"type":"integer","description":"Total number of teams documents that matched your query.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["total","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"total":{"type":"integer","description":"Total number of memberships documents that matched your query.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["total","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of functions documents that matched your query.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["total","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of runtimes documents that matched your query.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["total","runtimes"]},"deploymentList":{"description":"Deployments List","type":"object","properties":{"total":{"type":"integer","description":"Total number of deployments documents that matched your query.","x-example":5,"format":"int32"},"deployments":{"type":"array","description":"List of deployments.","items":{"type":"object","$ref":"#\/definitions\/deployment"},"x-example":""}},"required":["total","deployments"]},"executionList":{"description":"Executions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of executions documents that matched your query.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["total","executions"]},"projectList":{"description":"Projects List","type":"object","properties":{"total":{"type":"integer","description":"Total number of projects documents that matched your query.","x-example":5,"format":"int32"},"projects":{"type":"array","description":"List of projects.","items":{"type":"object","$ref":"#\/definitions\/project"},"x-example":""}},"required":["total","projects"]},"webhookList":{"description":"Webhooks List","type":"object","properties":{"total":{"type":"integer","description":"Total number of webhooks documents that matched your query.","x-example":5,"format":"int32"},"webhooks":{"type":"array","description":"List of webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"},"x-example":""}},"required":["total","webhooks"]},"keyList":{"description":"API Keys List","type":"object","properties":{"total":{"type":"integer","description":"Total number of keys documents that matched your query.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["total","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"total":{"type":"integer","description":"Total number of platforms documents that matched your query.","x-example":5,"format":"int32"},"platforms":{"type":"array","description":"List of platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"},"x-example":""}},"required":["total","platforms"]},"domainList":{"description":"Domains List","type":"object","properties":{"total":{"type":"integer","description":"Total number of domains documents that matched your query.","x-example":5,"format":"int32"},"domains":{"type":"array","description":"List of domains.","items":{"type":"object","$ref":"#\/definitions\/domain"},"x-example":""}},"required":["total","domains"]},"countryList":{"description":"Countries List","type":"object","properties":{"total":{"type":"integer","description":"Total number of countries documents that matched your query.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["total","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of continents documents that matched your query.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["total","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"total":{"type":"integer","description":"Total number of languages documents that matched your query.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["total","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"total":{"type":"integer","description":"Total number of currencies documents that matched your query.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["total","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"total":{"type":"integer","description":"Total number of phones documents that matched your query.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["total","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"total":{"type":"integer","description":"Total number of metrics documents that matched your query.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["total","metrics"]},"database":{"description":"Database","type":"object","properties":{"$id":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Database name.","x-example":"My Database"}},"required":["$id","name"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Collection update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"databaseId":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$createdAt","$updatedAt","$read","$write","databaseId","name","enabled","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of attributes in the given collection.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["total","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"integer","description":"Attribute size.","x-example":128,"format":"int32"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"count"},"type":{"type":"string","description":"Attribute type.","x-example":"integer"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"percentageCompleted"},"type":{"type":"string","description":"Attribute type.","x-example":"double"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"isEnabled"},"type":{"type":"string","description":"Attribute type.","x-example":"boolean"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"userEmail"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"status"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"ipAddress"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"githubUrl"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":"primary"},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$createdAt":{"type":"integer","description":"Document creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Document update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$createdAt","$updatedAt","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"User creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"User update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"phone":{"type":"string","description":"User phone number in E.164 format.","x-example":"+4930901820"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"phoneVerification":{"type":"boolean","description":"Phone verification status.","x-example":true},"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","$createdAt","$updatedAt","name","registration","status","passwordUpdate","email","phone","emailVerification","phoneVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Session creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"integer","description":"Date, the Unix timestamp of when the access token expires.","x-example":1592981250,"format":"int32"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","$createdAt","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"$createdAt":{"type":"integer","description":"Token creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"File update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"signature":{"type":"string","description":"File MD5 signature.","x-example":"5d529fd02b544198ae075bd57c1762bb"},"mimeType":{"type":"string","description":"File mime type.","x-example":"image\/png"},"sizeOriginal":{"type":"integer","description":"File original size in bytes.","x-example":17890,"format":"int32"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$createdAt","$updatedAt","$read","$write","name","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"bucket":{"description":"Bucket","type":"object","properties":{"$id":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Bucket creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Bucket update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":["role:all"]},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":["user:608f9da25e7e1"]},"permission":{"type":"string","description":"Bucket permission model. Possible values: `bucket` or `file`","x-example":"file"},"name":{"type":"string","description":"Bucket name.","x-example":"Documents"},"enabled":{"type":"boolean","description":"Bucket enabled.","x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size supported.","x-example":100,"format":"int32"},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions.","items":{"type":"string"},"x-example":["jpg","png"]},"encryption":{"type":"boolean","description":"Bucket is encrypted.","x-example":false},"antivirus":{"type":"boolean","description":"Virus scanning is enabled.","x-example":false}},"required":["$id","$createdAt","$updatedAt","$read","$write","permission","name","enabled","maximumFileSize","allowedFileExtensions","encryption","antivirus"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Team update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"total":{"type":"integer","description":"Total number of team members.","x-example":7,"format":"int32"}},"required":["$id","$createdAt","$updatedAt","name","total"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Membership creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Membership update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"userName":{"type":"string","description":"User name.","x-example":"John Doe"},"userEmail":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"teamName":{"type":"string","description":"Team name.","x-example":"VIP"},"invited":{"type":"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","$createdAt","$updatedAt","userId","userName","userEmail","teamId","teamName","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"execute":{"type":"array","description":"Execution permissions.","items":{"type":"string"},"x-example":"role:member"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"status":{"type":"string","description":"Function status. Possible values: `disabled`, `enabled`","x-example":"enabled"},"runtime":{"type":"string","description":"Function execution runtime.","x-example":"python-3.8"},"deployment":{"type":"string","description":"Function's active deployment ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"object","additionalProperties":true,"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","$createdAt","$updatedAt","execute","name","status","runtime","deployment","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"deployment":{"description":"Deployment","type":"object","properties":{"$id":{"type":"string","description":"Deployment ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Deployment creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Deployment update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"resourceId":{"type":"string","description":"Resource ID.","x-example":"5e5ea6g16897e"},"resourceType":{"type":"string","description":"Resource type.","x-example":"functions"},"entrypoint":{"type":"string","description":"The entrypoint file to use to execute the deployment code.","x-example":"enabled"},"size":{"type":"integer","description":"The code size in bytes.","x-example":128,"format":"int32"},"buildId":{"type":"string","description":"The current build ID.","x-example":"5e5ea5c16897e"},"activate":{"type":"boolean","description":"Whether the deployment should be automatically activated.","x-example":true},"status":{"type":"string","description":"The deployment status.","x-example":"enabled"},"buildStdout":{"type":"string","description":"The build stdout.","x-example":"enabled"},"buildStderr":{"type":"string","description":"The build stderr.","x-example":"enabled"}},"required":["$id","$createdAt","$updatedAt","resourceId","resourceType","entrypoint","size","buildId","activate","status","buildStdout","buildStderr"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Execution update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"response":{"type":"string","description":"The script response output string. Logs the last 4,000 characters of the execution response output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$createdAt","$updatedAt","$read","functionId","trigger","status","statusCode","response","stderr","time"]},"project":{"description":"Project","type":"object","properties":{"$id":{"type":"string","description":"Project ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Project creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Project update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAuth0Appid":{"type":"string","description":"Auth0 OAuth app ID.","x-example":"123247283472834787438"},"providerAuth0Secret":{"type":"string","description":"Auth0 OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDailymotionAppid":{"type":"string","description":"Dailymotion OAuth app ID.","x-example":"123247283472834787438"},"providerDailymotionSecret":{"type":"string","description":"Dailymotion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerNotionAppid":{"type":"string","description":"Notion OAuth app ID.","x-example":"123247283472834787438"},"providerNotionSecret":{"type":"string","description":"Notion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerOktaAppid":{"type":"string","description":"Okta OAuth app ID.","x-example":"123247283472834787438"},"providerOktaSecret":{"type":"string","description":"Okta OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerStripeAppid":{"type":"string","description":"Stripe OAuth app ID.","x-example":"123247283472834787438"},"providerStripeSecret":{"type":"string","description":"Stripe OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYammerAppid":{"type":"string","description":"Yammer OAuth app ID.","x-example":"123247283472834787438"},"providerYammerSecret":{"type":"string","description":"Yammer OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerZoomAppid":{"type":"string","description":"Zoom OAuth app ID.","x-example":"123247283472834787438"},"providerZoomSecret":{"type":"string","description":"Zoom OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabases":{"type":"boolean","description":"Databases service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","$createdAt","$updatedAt","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerAuth0Appid","providerAuth0Secret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDailymotionAppid","providerDailymotionSecret","providerDiscordAppid","providerDiscordSecret","providerDropboxAppid","providerDropboxSecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerNotionAppid","providerNotionSecret","providerOktaAppid","providerOktaSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerStripeAppid","providerStripeSecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerWordpressAppid","providerWordpressSecret","providerYahooAppid","providerYahooSecret","providerYammerAppid","providerYammerSecret","providerYandexAppid","providerYandexSecret","providerZoomAppid","providerZoomSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabases","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"webhook":{"description":"Webhook","type":"object","properties":{"$id":{"type":"string","description":"Webhook ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Webhook creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Webhook update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Webhook name.","x-example":"My Webhook"},"url":{"type":"string","description":"Webhook URL endpoint.","x-example":"https:\/\/example.com\/webhook"},"events":{"type":"array","description":"Webhook trigger events.","items":{"type":"string"},"x-example":"database.collections.update"},"security":{"type":"boolean","description":"Indicated if SSL \/ TLS Certificate verification is enabled.","x-example":true},"httpUser":{"type":"string","description":"HTTP basic authentication username.","x-example":"username"},"httpPass":{"type":"string","description":"HTTP basic authentication password.","x-example":"password"},"signatureKey":{"type":"string","description":"Signature key which can be used to validated incoming","x-example":"ad3d581ca230e2b7059c545e5a"}},"required":["$id","$createdAt","$updatedAt","name","url","events","security","httpUser","httpPass","signatureKey"]},"key":{"description":"Key","type":"object","properties":{"$id":{"type":"string","description":"Key ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Key creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Key update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Key name.","x-example":"My API Key"},"expire":{"type":"integer","description":"Key expiration in Unix timestamp.","x-example":"1653990687","format":"int32"},"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","$createdAt","$updatedAt","name","expire","scopes","secret"]},"domain":{"description":"Domain","type":"object","properties":{"$id":{"type":"string","description":"Domain ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Domain creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Domain update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","$updatedAt","domain","registerable","tld","verification","certificateId"]},"platform":{"description":"Platform","type":"object","properties":{"$id":{"type":"string","description":"Platform ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Project creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Project update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","$updatedAt","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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]},"usageDatabases":{"description":"UsageDatabases","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"databasesCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesDelete":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","databasesCount","documentsCount","collectionsCount","databasesCreate","databasesRead","databasesUpdate","databasesDelete","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by files (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"tagsStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by tags (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCount":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCount":{"type":"array","description":"Aggregated stats for total number of buckets.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCreate":{"type":"array","description":"Aggregated stats for buckets created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsRead":{"type":"array","description":"Aggregated stats for buckets read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsUpdate":{"type":"array","description":"Aggregated stats for buckets updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsDelete":{"type":"array","description":"Aggregated stats for buckets deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesStorage","tagsStorage","filesCount","bucketsCount","bucketsCreate","bucketsRead","bucketsUpdate","bucketsDelete","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesStorage":{"type":"array","description":"Aggregated stats for total storage of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesStorage","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"functionsExecutions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsFailures":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsCompute":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","functionsExecutions","functionsFailures","functionsCompute"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","functions","documents","collections","users","storage"]}},"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.15.2","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@appwrite.io"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"HOSTNAME","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":52,"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":40,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":59,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":51,"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":100,"rate-time":3600,"rate-key":"url:{url},userId:{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":55,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":57,"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, Team Invites and Magic URL, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":58,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/phone":{"patch":{"summary":"Update Account Phone","operationId":"accountUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](\/docs\/client\/account#accountCreatePhoneVerification) endpoint to send a confirmation SMS.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":60,"cookies":false,"type":"","demo":"account\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["number","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":53,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":61,"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":{},"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":66,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":67,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":54,"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":[]}]},"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":65,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":50,"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\/email":{"post":{"summary":"Create Account Session with Email","operationId":"accountCreateEmailSession","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":"createEmailSession","weight":41,"cookies":false,"type":"","demo":"account\/create-email-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email.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 at least 8 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/sessions\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":46,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":47,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":42,"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, auth0, autodesk, bitbucket, bitly, box, dailymotion, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, notion, okta, paypal, paypalSandbox, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoom.","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":"","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":"","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/phone":{"post":{"summary":"Create Phone session","operationId":"accountCreatePhoneSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [PUT \/account\/sessions\/phone](\/docs\/client\/account#accountUpdatePhoneSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneSession","weight":48,"cookies":false,"type":"","demo":"account\/create-phone-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"number":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null}},"required":["userId","number"]}}]},"put":{"summary":"Create Phone session (confirmation)","operationId":"accountUpdatePhoneSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating a session with SMS. Use the **userId** from the [createPhoneSession](\/docs\/client\/account#accountCreatePhoneSession) endpoint and the **secret** received via SMS to successfully update and confirm the phone session.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updatePhoneSession","weight":49,"cookies":false,"type":"","demo":"account\/update-phone-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/sessions\/{sessionId}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":56,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to \"refresh\" the access token.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":64,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":63,"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 ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/status":{"patch":{"summary":"Update Account Status","operationId":"accountUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":62,"cookies":false,"type":"","demo":"account\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/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#accountUpdateEmailVerification). 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":68,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":69,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/verification\/phone":{"post":{"summary":"Create Phone Verification","operationId":"accountCreatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](\/docs\/client\/account#accountUpdatePhone) endpoint. Learn more about how to [complete the verification process](\/docs\/client\/account#accountUpdatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneVerification","weight":70,"cookies":false,"type":"","demo":"account\/create-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]},"put":{"summary":"Create Phone Verification (confirmation)","operationId":"accountUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":71,"cookies":false,"type":"","demo":"account\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"avatarsGetBrowser","consumes":["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 [GET \/account\/sessions](\/docs\/client\/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":73,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":72,"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":76,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":74,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":75,"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. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":78,"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.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":77,"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 1 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":1,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/databases":{"get":{"summary":"List Databases","operationId":"databasesList","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.","responses":{"200":{"description":"Databases List","schema":{"$ref":"#\/definitions\/databaseList"}}},"x-appwrite":{"method":"list","weight":80,"cookies":false,"type":"","demo":"databases\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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 Database","operationId":"databasesCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a new Database.\n","responses":{"201":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"create","weight":79,"cookies":false,"type":"","demo":"databases\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"databaseId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DATABASE_ID]","x-global":true},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["databaseId","name"]}}]}},"\/databases\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databasesGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageDatabases","schema":{"$ref":"#\/definitions\/usageDatabases"}}},"x-appwrite":{"method":"getUsage","weight":112,"cookies":false,"type":"","demo":"databases\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"`Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/databases\/{databaseId}":{"get":{"summary":"Get Database","operationId":"databasesGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.","responses":{"200":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"get","weight":81,"cookies":false,"type":"","demo":"databases\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]},"put":{"summary":"Update Database","operationId":"databasesUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Update a database by its unique ID.","responses":{"200":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"update","weight":83,"cookies":false,"type":"","demo":"databases\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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]"}},"required":["name"]}}]},"delete":{"summary":"Delete Database","operationId":"databasesDelete","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":84,"cookies":false,"type":"","demo":"databases\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections":{"get":{"summary":"List Collections","operationId":"databasesListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":86,"cookies":false,"type":"","demo":"databases\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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":"databasesCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](\/docs\/server\/database#databaseCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":85,"cookies":false,"type":"","demo":"databases\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[COLLECTION_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Specifies the permissions model used in this collection, which accepts either 'collection' or 'document'. For 'collection' level permission, the permissions specified in read and write params are applied to all documents in the collection. For 'document' level permissions, read and write permissions are specified in each document. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databasesGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"getCollection","weight":87,"cookies":false,"type":"","demo":"databases\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databasesUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Update a collection by its unique ID.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":89,"cookies":false,"type":"","demo":"databases\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Collection","operationId":"databasesDeleteCollection","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteCollection","weight":90,"cookies":false,"type":"","demo":"databases\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databasesListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":99,"cookies":false,"type":"","demo":"databases\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databasesCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a boolean attribute.\n","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":98,"cookies":false,"type":"","demo":"databases\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databasesCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create an email attribute.\n","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":92,"cookies":false,"type":"","demo":"databases\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databasesCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":93,"cookies":false,"type":"","demo":"databases\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 4096 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databasesCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":97,"cookies":false,"type":"","demo":"databases\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"number","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"number","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databasesCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":96,"cookies":false,"type":"","demo":"databases\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databasesCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create IP address attribute.\n","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":94,"cookies":false,"type":"","demo":"databases\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databasesCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a string attribute.\n","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":91,"cookies":false,"type":"","demo":"databases\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databasesCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a URL attribute.\n","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":95,"cookies":false,"type":"","demo":"databases\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databasesGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":100,"cookies":false,"type":"","demo":"databases\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databasesDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":101,"cookies":false,"type":"","demo":"databases\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databasesListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a list of all the user's documents in a given collection. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of documents belonging to the provided collectionId. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":107,"cookies":false,"type":"","demo":"databases\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/database#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results. Maximum of 100 order attributes are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order. Maximum of 100 order types are allowed.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]},"post":{"summary":"Create Document","operationId":"databasesCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database#databaseCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":106,"cookies":false,"type":"","demo":"databases\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","data"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databasesGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a document by its unique ID. This endpoint response returns a JSON object with the document data.","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"getDocument","weight":108,"cookies":false,"type":"","demo":"databases\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databasesUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"updateDocument","weight":110,"cookies":false,"type":"","demo":"databases\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object. Include only attribute and value pairs to be updated.","default":[],"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete Document","operationId":"databasesDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"Delete a document by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":111,"cookies":false,"type":"","demo":"databases\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databasesListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get the document activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":109,"cookies":false,"type":"","demo":"databases\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databasesListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":103,"cookies":false,"type":"","demo":"databases\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databasesCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":102,"cookies":false,"type":"","demo":"databases\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders. Maximum of 100 orders are allowed.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databasesGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":104,"cookies":false,"type":"","demo":"databases\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databasesDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":105,"cookies":false,"type":"","demo":"databases\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databasesListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":88,"cookies":false,"type":"","demo":"databases\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databasesGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":114,"cookies":false,"type":"","demo":"databases\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databasesListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":82,"cookies":false,"type":"","demo":"databases\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/databases\/{databaseId}\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databasesGetDatabaseUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getDatabaseUsage","weight":113,"cookies":false,"type":"","demo":"databases\/get-database-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"range","description":"`Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/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":212,"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":"Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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":211,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[FUNCTION_ID]"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Function maximum execution time in seconds.","default":15,"x-example":1}},"required":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List runtimes","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active on your instance.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":213,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":214,"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 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":216,"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 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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Maximum execution time in seconds.","default":15,"x-example":1}},"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":218,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments":{"get":{"summary":"List Deployments","operationId":"functionsListDeployments","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code deployments. You can use the query params to filter your results.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"listDeployments","weight":220,"cookies":false,"type":"","demo":"functions\/list-deployments.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-deployments.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 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":"Maximum number of deployments to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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 Deployment","operationId":"functionsCreateDeployment","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"createDeployment","weight":219,"cookies":false,"type":"","demo":"functions\/create-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"entrypoint","description":"Entrypoint File.","required":true,"type":"string","x-example":"[ENTRYPOINT]","in":"formData"},{"name":"code","description":"Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.","required":true,"type":"file","in":"formData"},{"name":"activate","description":"Automatically activate the deployment when it is finished building.","required":true,"type":"boolean","x-example":false,"in":"formData"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}":{"get":{"summary":"Get Deployment","operationId":"functionsGetDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code deployment by its unique ID.","responses":{"200":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"getDeployment","weight":221,"cookies":false,"type":"","demo":"functions\/get-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"patch":{"summary":"Update Function Deployment","operationId":"functionsUpdateDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateDeployment","weight":217,"cookies":false,"type":"","demo":"functions\/update-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"delete":{"summary":"Delete Deployment","operationId":"functionsDeleteDeployment","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code deployment by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDeployment","weight":222,"cookies":false,"type":"","demo":"functions\/delete-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":226,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":224,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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":223,"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 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]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":225,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":215,"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 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":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":122,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":132,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":125,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":124,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":129,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":130,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":128,"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\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":127,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":131,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":126,"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":115,"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":119,"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":116,"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":117,"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":118,"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":120,"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":121,"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":135,"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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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":134,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[PROJECT_ID]"},"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":["projectId","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":136,"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":138,"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":143,"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 at least 8 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":141,"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":"integer","description":"Set the max number of users allowed in this project. Use 0 for unlimited.","default":null,"x-example":0}},"required":["limit"]}}]}},"\/projects\/{projectId}\/auth\/{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":142,"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,magic-url,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":161,"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":160,"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":162,"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":164,"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":163,"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":151,"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":150,"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. Maximum of 100 scopes are allowed.","default":null,"x-example":null,"items":{"type":"string"}},"expire":{"type":"integer","description":"Key expiration time in Unix timestamp. Use 0 for unlimited expiration.","default":0,"x-example":null}},"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":152,"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":153,"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. Maximum of 100 events are allowed.","default":null,"x-example":null,"items":{"type":"string"}},"expire":{"type":"integer","description":"Key expiration time in Unix timestamp. Use 0 for unlimited expiration.","default":0,"x-example":null}},"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":154,"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":140,"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":156,"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":155,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":null}},"required":["type","name"]}}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"projectsGetPlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"getPlatform","weight":157,"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":158,"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":null}},"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":159,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":139,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":137,"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":145,"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":144,"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. Maximum of 100 events are allowed.","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":146,"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":147,"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. Maximum of 100 events are allowed.","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":149,"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"}]}},"\/projects\/{projectId}\/webhooks\/{webhookId}\/signature":{"patch":{"summary":"Update Webhook Signature Key","operationId":"projectsUpdateWebhookSignature","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"updateWebhookSignature","weight":148,"cookies":false,"type":"","demo":"projects\/update-webhook-signature.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\/buckets":{"get":{"summary":"List buckets","operationId":"storageListBuckets","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the storage buckets. You can use the query params to filter your results.","responses":{"200":{"description":"Buckets List","schema":{"$ref":"#\/definitions\/bucketList"}}},"x-appwrite":{"method":"listBuckets","weight":166,"cookies":false,"type":"","demo":"storage\/list-buckets.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"cursor","description":"ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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 bucket","operationId":"storageCreateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new storage bucket.","responses":{"201":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"createBucket","weight":165,"cookies":false,"type":"","demo":"storage\/create-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"bucketId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[BUCKET_ID]"},"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":30000000,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["bucketId","name","permission"]}}]}},"\/storage\/buckets\/{bucketId}":{"get":{"summary":"Get Bucket","operationId":"storageGetBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"getBucket","weight":167,"cookies":false,"type":"","demo":"storage\/get-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]},"put":{"summary":"Update Bucket","operationId":"storageUpdateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a storage bucket by its unique ID.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"updateBucket","weight":168,"cookies":false,"type":"","demo":"storage\/update-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":null,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Bucket","operationId":"storageDeleteBucket","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a storage bucket by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteBucket","weight":169,"cookies":false,"type":"","demo":"storage\/delete-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["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":171,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":170,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/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":172,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":176,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":177,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":174,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":173,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":175,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":178,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":179,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":181,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":180,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":182,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":183,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":184,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/logs":{"get":{"summary":"List Team Logs","operationId":"teamsListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get the team activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":191,"cookies":false,"type":"","demo":"teams\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":186,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":185,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"URL to redirect the user back to your app from the invitation email. 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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":187,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":188,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["roles"]}}]},"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteMembership","weight":190,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":189,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":193,"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":"Maximum number of users to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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":192,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":210,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":194,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"usersDelete","consumes":["application\/json"],"produces":[],"tags":["users"],"description":"Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](\/docs\/server\/users#usersUpdateStatus) endpoint instead.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":209,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":204,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":198,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/users\/{userId}\/memberships":{"get":{"summary":"Get User Memberships","operationId":"usersGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user membership list by its unique ID.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":197,"cookies":false,"type":"","demo":"users\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-memberships.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":202,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":203,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/users\/{userId}\/phone":{"patch":{"summary":"Update Phone","operationId":"usersUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":205,"cookies":false,"type":"","demo":"users\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"User phone number.","default":null,"x-example":null}},"required":["number"]}}]}},"\/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":195,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"usersUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":206,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":196,"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 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":208,"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 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":207,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":199,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateEmailVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmailVerification","weight":200,"cookies":false,"type":"","demo":"users\/update-email-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}},"\/users\/{userId}\/verification\/phone":{"patch":{"summary":"Update Phone Verification","operationId":"usersUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":201,"cookies":false,"type":"","demo":"users\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"phoneVerification":{"type":"boolean","description":"User phone verification status.","default":null,"x-example":false}},"required":["phoneVerification"]}}]}}},"tags":[{"name":"account","description":"The Account service allows you to authenticate and manage a user account.","x-globalAttributes":[]},{"name":"avatars","description":"The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.","x-globalAttributes":[]},{"name":"databases","description":"The Databases service allows you to create structured collections of documents, query and filter lists of documents","x-globalAttributes":["databaseId"]},{"name":"locale","description":"The Locale service allows you to customize your app based on your users' location.","x-globalAttributes":[]},{"name":"health","description":"The Health service allows you to both validate and monitor your Appwrite server's health.","x-globalAttributes":[]},{"name":"projects","description":"The Project service allows you to manage all the projects in your Appwrite server.","x-globalAttributes":[]},{"name":"storage","description":"The Storage service allows you to manage your project files.","x-globalAttributes":[]},{"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","x-globalAttributes":[]},{"name":"users","description":"The Users service allows you to manage your project users.","x-globalAttributes":[]},{"name":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions.","x-globalAttributes":[]}],"definitions":{"documentList":{"description":"Documents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of documents documents that matched your query.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["total","documents"]},"collectionList":{"description":"Collections List","type":"object","properties":{"total":{"type":"integer","description":"Total number of collections documents that matched your query.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["total","collections"]},"databaseList":{"description":"Databases List","type":"object","properties":{"total":{"type":"integer","description":"Total number of databases documents that matched your query.","x-example":5,"format":"int32"},"databases":{"type":"array","description":"List of databases.","items":{"type":"object","$ref":"#\/definitions\/database"},"x-example":""}},"required":["total","databases"]},"indexList":{"description":"Indexes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of indexes documents that matched your query.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["total","indexes"]},"userList":{"description":"Users List","type":"object","properties":{"total":{"type":"integer","description":"Total number of users documents that matched your query.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["total","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of sessions documents that matched your query.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["total","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"total":{"type":"integer","description":"Total number of logs documents that matched your query.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["total","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"total":{"type":"integer","description":"Total number of files documents that matched your query.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["total","files"]},"bucketList":{"description":"Buckets List","type":"object","properties":{"total":{"type":"integer","description":"Total number of buckets documents that matched your query.","x-example":5,"format":"int32"},"buckets":{"type":"array","description":"List of buckets.","items":{"type":"object","$ref":"#\/definitions\/bucket"},"x-example":""}},"required":["total","buckets"]},"teamList":{"description":"Teams List","type":"object","properties":{"total":{"type":"integer","description":"Total number of teams documents that matched your query.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["total","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"total":{"type":"integer","description":"Total number of memberships documents that matched your query.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["total","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of functions documents that matched your query.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["total","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of runtimes documents that matched your query.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["total","runtimes"]},"deploymentList":{"description":"Deployments List","type":"object","properties":{"total":{"type":"integer","description":"Total number of deployments documents that matched your query.","x-example":5,"format":"int32"},"deployments":{"type":"array","description":"List of deployments.","items":{"type":"object","$ref":"#\/definitions\/deployment"},"x-example":""}},"required":["total","deployments"]},"executionList":{"description":"Executions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of executions documents that matched your query.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["total","executions"]},"projectList":{"description":"Projects List","type":"object","properties":{"total":{"type":"integer","description":"Total number of projects documents that matched your query.","x-example":5,"format":"int32"},"projects":{"type":"array","description":"List of projects.","items":{"type":"object","$ref":"#\/definitions\/project"},"x-example":""}},"required":["total","projects"]},"webhookList":{"description":"Webhooks List","type":"object","properties":{"total":{"type":"integer","description":"Total number of webhooks documents that matched your query.","x-example":5,"format":"int32"},"webhooks":{"type":"array","description":"List of webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"},"x-example":""}},"required":["total","webhooks"]},"keyList":{"description":"API Keys List","type":"object","properties":{"total":{"type":"integer","description":"Total number of keys documents that matched your query.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["total","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"total":{"type":"integer","description":"Total number of platforms documents that matched your query.","x-example":5,"format":"int32"},"platforms":{"type":"array","description":"List of platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"},"x-example":""}},"required":["total","platforms"]},"domainList":{"description":"Domains List","type":"object","properties":{"total":{"type":"integer","description":"Total number of domains documents that matched your query.","x-example":5,"format":"int32"},"domains":{"type":"array","description":"List of domains.","items":{"type":"object","$ref":"#\/definitions\/domain"},"x-example":""}},"required":["total","domains"]},"countryList":{"description":"Countries List","type":"object","properties":{"total":{"type":"integer","description":"Total number of countries documents that matched your query.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["total","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of continents documents that matched your query.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["total","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"total":{"type":"integer","description":"Total number of languages documents that matched your query.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["total","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"total":{"type":"integer","description":"Total number of currencies documents that matched your query.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["total","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"total":{"type":"integer","description":"Total number of phones documents that matched your query.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["total","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"total":{"type":"integer","description":"Total number of metrics documents that matched your query.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["total","metrics"]},"database":{"description":"Database","type":"object","properties":{"$id":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Database name.","x-example":"My Database"},"$createdAt":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Collection update date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","name","$createdAt","$updatedAt"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Collection update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"databaseId":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$createdAt","$updatedAt","$read","$write","databaseId","name","enabled","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of attributes in the given collection.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["total","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"integer","description":"Attribute size.","x-example":128,"format":"int32"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"count"},"type":{"type":"string","description":"Attribute type.","x-example":"integer"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"percentageCompleted"},"type":{"type":"string","description":"Attribute type.","x-example":"double"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"isEnabled"},"type":{"type":"string","description":"Attribute type.","x-example":"boolean"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"userEmail"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"status"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"ipAddress"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"githubUrl"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":"primary"},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$createdAt":{"type":"integer","description":"Document creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Document update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$createdAt","$updatedAt","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"User creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"User update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"phone":{"type":"string","description":"User phone number in E.164 format.","x-example":"+4930901820"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"phoneVerification":{"type":"boolean","description":"Phone verification status.","x-example":true},"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","$createdAt","$updatedAt","name","registration","status","passwordUpdate","email","phone","emailVerification","phoneVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Session creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"integer","description":"Date, the Unix timestamp of when the access token expires.","x-example":1592981250,"format":"int32"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","$createdAt","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"$createdAt":{"type":"integer","description":"Token creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"File update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"signature":{"type":"string","description":"File MD5 signature.","x-example":"5d529fd02b544198ae075bd57c1762bb"},"mimeType":{"type":"string","description":"File mime type.","x-example":"image\/png"},"sizeOriginal":{"type":"integer","description":"File original size in bytes.","x-example":17890,"format":"int32"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$createdAt","$updatedAt","$read","$write","name","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"bucket":{"description":"Bucket","type":"object","properties":{"$id":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Bucket creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Bucket update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":["role:all"]},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":["user:608f9da25e7e1"]},"permission":{"type":"string","description":"Bucket permission model. Possible values: `bucket` or `file`","x-example":"file"},"name":{"type":"string","description":"Bucket name.","x-example":"Documents"},"enabled":{"type":"boolean","description":"Bucket enabled.","x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size supported.","x-example":100,"format":"int32"},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions.","items":{"type":"string"},"x-example":["jpg","png"]},"encryption":{"type":"boolean","description":"Bucket is encrypted.","x-example":false},"antivirus":{"type":"boolean","description":"Virus scanning is enabled.","x-example":false}},"required":["$id","$createdAt","$updatedAt","$read","$write","permission","name","enabled","maximumFileSize","allowedFileExtensions","encryption","antivirus"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Team update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"total":{"type":"integer","description":"Total number of team members.","x-example":7,"format":"int32"}},"required":["$id","$createdAt","$updatedAt","name","total"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Membership creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Membership update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"userName":{"type":"string","description":"User name.","x-example":"John Doe"},"userEmail":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"teamName":{"type":"string","description":"Team name.","x-example":"VIP"},"invited":{"type":"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","$createdAt","$updatedAt","userId","userName","userEmail","teamId","teamName","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"execute":{"type":"array","description":"Execution permissions.","items":{"type":"string"},"x-example":"role:member"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"status":{"type":"string","description":"Function status. Possible values: `disabled`, `enabled`","x-example":"enabled"},"runtime":{"type":"string","description":"Function execution runtime.","x-example":"python-3.8"},"deployment":{"type":"string","description":"Function's active deployment ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"object","additionalProperties":true,"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","$createdAt","$updatedAt","execute","name","status","runtime","deployment","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"deployment":{"description":"Deployment","type":"object","properties":{"$id":{"type":"string","description":"Deployment ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Deployment creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Deployment update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"resourceId":{"type":"string","description":"Resource ID.","x-example":"5e5ea6g16897e"},"resourceType":{"type":"string","description":"Resource type.","x-example":"functions"},"entrypoint":{"type":"string","description":"The entrypoint file to use to execute the deployment code.","x-example":"enabled"},"size":{"type":"integer","description":"The code size in bytes.","x-example":128,"format":"int32"},"buildId":{"type":"string","description":"The current build ID.","x-example":"5e5ea5c16897e"},"activate":{"type":"boolean","description":"Whether the deployment should be automatically activated.","x-example":true},"status":{"type":"string","description":"The deployment status.","x-example":"enabled"},"buildStdout":{"type":"string","description":"The build stdout.","x-example":"enabled"},"buildStderr":{"type":"string","description":"The build stderr.","x-example":"enabled"}},"required":["$id","$createdAt","$updatedAt","resourceId","resourceType","entrypoint","size","buildId","activate","status","buildStdout","buildStderr"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Execution update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"response":{"type":"string","description":"The script response output string. Logs the last 4,000 characters of the execution response output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$createdAt","$updatedAt","$read","functionId","trigger","status","statusCode","response","stderr","time"]},"project":{"description":"Project","type":"object","properties":{"$id":{"type":"string","description":"Project ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Project creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Project update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAuth0Appid":{"type":"string","description":"Auth0 OAuth app ID.","x-example":"123247283472834787438"},"providerAuth0Secret":{"type":"string","description":"Auth0 OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAutodeskAppid":{"type":"string","description":"Autodesk OAuth app ID.","x-example":"123247283472834787438"},"providerAutodeskSecret":{"type":"string","description":"Autodesk OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDailymotionAppid":{"type":"string","description":"Dailymotion OAuth app ID.","x-example":"123247283472834787438"},"providerDailymotionSecret":{"type":"string","description":"Dailymotion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerNotionAppid":{"type":"string","description":"Notion OAuth app ID.","x-example":"123247283472834787438"},"providerNotionSecret":{"type":"string","description":"Notion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerOktaAppid":{"type":"string","description":"Okta OAuth app ID.","x-example":"123247283472834787438"},"providerOktaSecret":{"type":"string","description":"Okta OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerStripeAppid":{"type":"string","description":"Stripe OAuth app ID.","x-example":"123247283472834787438"},"providerStripeSecret":{"type":"string","description":"Stripe OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYammerAppid":{"type":"string","description":"Yammer OAuth app ID.","x-example":"123247283472834787438"},"providerYammerSecret":{"type":"string","description":"Yammer OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerZoomAppid":{"type":"string","description":"Zoom OAuth app ID.","x-example":"123247283472834787438"},"providerZoomSecret":{"type":"string","description":"Zoom OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabases":{"type":"boolean","description":"Databases service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","$createdAt","$updatedAt","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerAuth0Appid","providerAuth0Secret","providerAutodeskAppid","providerAutodeskSecret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDailymotionAppid","providerDailymotionSecret","providerDiscordAppid","providerDiscordSecret","providerDropboxAppid","providerDropboxSecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerNotionAppid","providerNotionSecret","providerOktaAppid","providerOktaSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerStripeAppid","providerStripeSecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerWordpressAppid","providerWordpressSecret","providerYahooAppid","providerYahooSecret","providerYammerAppid","providerYammerSecret","providerYandexAppid","providerYandexSecret","providerZoomAppid","providerZoomSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabases","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"webhook":{"description":"Webhook","type":"object","properties":{"$id":{"type":"string","description":"Webhook ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Webhook creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Webhook update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Webhook name.","x-example":"My Webhook"},"url":{"type":"string","description":"Webhook URL endpoint.","x-example":"https:\/\/example.com\/webhook"},"events":{"type":"array","description":"Webhook trigger events.","items":{"type":"string"},"x-example":"database.collections.update"},"security":{"type":"boolean","description":"Indicated if SSL \/ TLS Certificate verification is enabled.","x-example":true},"httpUser":{"type":"string","description":"HTTP basic authentication username.","x-example":"username"},"httpPass":{"type":"string","description":"HTTP basic authentication password.","x-example":"password"},"signatureKey":{"type":"string","description":"Signature key which can be used to validated incoming","x-example":"ad3d581ca230e2b7059c545e5a"}},"required":["$id","$createdAt","$updatedAt","name","url","events","security","httpUser","httpPass","signatureKey"]},"key":{"description":"Key","type":"object","properties":{"$id":{"type":"string","description":"Key ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Key creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Key update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Key name.","x-example":"My API Key"},"expire":{"type":"integer","description":"Key expiration in Unix timestamp.","x-example":"1653990687","format":"int32"},"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","$createdAt","$updatedAt","name","expire","scopes","secret"]},"domain":{"description":"Domain","type":"object","properties":{"$id":{"type":"string","description":"Domain ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Domain creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Domain update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","$updatedAt","domain","registerable","tld","verification","certificateId"]},"platform":{"description":"Platform","type":"object","properties":{"$id":{"type":"string","description":"Platform ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Project creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Project update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","$updatedAt","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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]},"metric":{"description":"Metric","type":"object","properties":{"value":{"type":"integer","description":"The value of this metric at the timestamp.","x-example":1,"format":"int32"},"timestamp":{"type":"integer","description":"The UNIX timestamp at which this metric was aggregated.","x-example":1592981250,"format":"int32"}},"required":["value","timestamp"]},"usageDatabases":{"description":"UsageDatabases","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"databasesCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesDelete":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","databasesCount","documentsCount","collectionsCount","databasesCreate","databasesRead","databasesUpdate","databasesDelete","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by files (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"tagsStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by tags (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCount":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCount":{"type":"array","description":"Aggregated stats for total number of buckets.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCreate":{"type":"array","description":"Aggregated stats for buckets created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsRead":{"type":"array","description":"Aggregated stats for buckets read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsUpdate":{"type":"array","description":"Aggregated stats for buckets updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsDelete":{"type":"array","description":"Aggregated stats for buckets deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesStorage","tagsStorage","filesCount","bucketsCount","bucketsCreate","bucketsRead","bucketsUpdate","bucketsDelete","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesStorage":{"type":"array","description":"Aggregated stats for total storage of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesStorage","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"functionsExecutions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsFailures":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsCompute":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","functionsExecutions","functionsFailures","functionsCompute"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","functions","documents","collections","users","storage"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file diff --git a/templates/web/src/models.ts.twig b/templates/web/src/models.ts.twig index 749faf765a..4b0f63f8bd 100644 --- a/templates/web/src/models.ts.twig +++ b/templates/web/src/models.ts.twig @@ -8,7 +8,7 @@ export namespace Models { /** * {{ property.description }} */ - {{ property.name | escapeKeyword }}{% if not property.required %}?{% endif %}: {{ property | getSubSchema(spec) | raw }}; + {{ property.name }}{% if not property.required %}?{% endif %}: {{ property | getSubSchema(spec) | raw }}; {% endfor %} {% if definition.additionalProperties %} [key: string]: any; {% endif %} diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index 6f15944953..4f3fe71085 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -1,34 +1,13 @@ import { Service } from '../service'; import { {{ spec.title | caseUcfirst}}Exception, Client } from '../client'; import type { Models } from '../models'; -import type { UploadProgress } from '../client'; - -type Payload = { - [key: string]: any; -} +import type { UploadProgress, Payload } from '../client'; export class {{ service.name | caseUcfirst }} extends Service { -{% if service.globalParams | length %} -{% for parameter in service.globalParams %} - protected {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}; - public set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}): void - { - this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; - } - public get{{ parameter.name | caseUcfirst | escapeKeyword }}(): {{ parameter.type | typeName }} - { - return this.{{ parameter.name | caseCamel | escapeKeyword }}; - } -{% endfor %} - constructor(client: Client, {% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}:{{ parameter.type | typeName }}{% if not parameter.required %}|null = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + constructor(client: Client) { super(client); - -{% for parameter in service.globalParams %} - this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; -{% endfor %} } -{% endif %} {% for method in service.methods %} /** @@ -38,15 +17,15 @@ export class {{ service.name | caseUcfirst }} extends Service { {{ method.description|comment3 }} {% endif %} * -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} * @param {{ '{' }}{{ parameter.type | getPropertyType(method) | raw }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {% if method.type == 'webAuth' %}{void|string}{% elseif method.type == 'location' %}{URL}{% else %}{Promise}{% endif %} */ - {% if method.type != 'location' and method.type != 'webAuth'%}async {% endif %}{{ method.name | caseCamel }}{{ method.responseModel | getGenerics(spec) | raw }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | getPropertyType(method) | raw }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): {{ method | getReturn(spec) | raw }} { -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} + {% if method.type != 'location' and method.type != 'webAuth'%}async {% endif %}{{ method.name | caseCamel }}{{ method.responseModel | getGenerics(spec) | raw }}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | getPropertyType(method) | raw }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): {{ method | getReturn(spec) | raw }} { +{% for parameter in method.parameters.all %} {% if parameter.required %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); @@ -54,18 +33,18 @@ export class {{ service.name | caseUcfirst }} extends Service { {% endif %} {% endfor %} - let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel | escapeKeyword }}{{ '}' }}', {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; + let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel | escapeKeyword }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; let payload: Payload = {}; {% for parameter in method.parameters.query %} - if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; + if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}; } {% endfor %} {% for parameter in method.parameters.body %} - if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; + if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}; } {% endfor %} From e1b841918bfdf842bfad7a8f121a0e3f38f4f5d0 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 2 Aug 2022 11:12:23 +0200 Subject: [PATCH 181/555] fix: web tests --- tests/languages/web/index.html | 12 ++++++------ tests/languages/web/node.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index e614a892ae..79abf18829 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -22,7 +22,7 @@ // Init SDK const { Client, Foo, Bar, General } = Appwrite; const client = new Client(); - const foo = new Foo(client, 'string'); + const foo = new Foo(client); const bar = new Bar(client); const general = new General(client); @@ -34,19 +34,19 @@ }); // Foo - response = await foo.get(123, ["string in array"]); + response = await foo.get('string', 123, ["string in array"]); console.log(response.result); - response = await foo.post(123, ["string in array"]); + response = await foo.post('string', 123, ["string in array"]); console.log(response.result); - response = await foo.put(123, ["string in array"]); + response = await foo.put('string', 123, ["string in array"]); console.log(response.result); - response = await foo.patch(123, ["string in array"]); + response = await foo.patch('string', 123, ["string in array"]); console.log(response.result); - response = await foo.delete(123, ["string in array"]); + response = await foo.delete('string', 123, ["string in array"]); console.log(response.result); // Bar diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js index b2de9a4c8f..e5fccb359f 100644 --- a/tests/languages/web/node.js +++ b/tests/languages/web/node.js @@ -5,23 +5,23 @@ async function start() { console.log('\nTest Started'); const client = new Client(); - const foo = new Foo(client, 'string'); + const foo = new Foo(client); const bar = new Bar(client); const general = new General(client); // Foo - response = await foo.get(123, ['string in array']); + response = await foo.get('string', 123, ['string in array']); console.log(response.result); - response = await foo.post(123, ['string in array']); + response = await foo.post('string', 123, ['string in array']); console.log(response.result); - response = await foo.put(123, ['string in array']); + response = await foo.put('string', 123, ['string in array']); console.log(response.result); - response = await foo.patch(123, ['string in array']); + response = await foo.patch('string', 123, ['string in array']); console.log(response.result); - response = await foo.delete(123, ['string in array']); + response = await foo.delete('string', 123, ['string in array']); console.log(response.result); // Bar From faccb45a056a99db05ba3b08497f21b84caa9095 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 2 Aug 2022 10:56:29 +0000 Subject: [PATCH 182/555] dart: use super in constructor param --- templates/dart/lib/services/service.dart.twig | 2 +- templates/flutter/lib/services/service.dart.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index b0bc553e23..31e91adae9 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -11,7 +11,7 @@ part of {{ language.params.packageName }}; {{ service.description|dartComment}} {% endif %} class {{ service.name | caseUcfirst }} extends Service { - {{ service.name | caseUcfirst }}(Client client{{ _self.service_params(service.globalParams) }}): super(client); + {{ service.name | caseUcfirst }}(super.client{{ _self.service_params(service.globalParams) }}); {% if service.globalParams | length %} {% for parameter in service.globalParams %} {{ parameter.type | typeName }}{% if not parameter.required %}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}; diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index 2da2fe3165..5d9a0aab69 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -11,7 +11,7 @@ part of {{ language.params.packageName }}; {{ service.description|dartComment}} {% endif %} class {{ service.name | caseUcfirst }} extends Service { - {{ service.name | caseUcfirst }}(Client client{{ _self.service_params(service.globalParams) }}): super(client); + {{ service.name | caseUcfirst }}(super.client{{ _self.service_params(service.globalParams) }}); {% if service.globalParams | length %} {% for parameter in service.globalParams %} {{ parameter.type | typeName }}{% if not parameter.required %}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}; From 37215ee0ddd935c1ed299f6b2c6db143769b1330 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 2 Aug 2022 10:58:15 +0000 Subject: [PATCH 183/555] commented out service params --- src/Spec/Swagger2.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Spec/Swagger2.php b/src/Spec/Swagger2.php index 94f86bc8b9..e4cddba7b6 100644 --- a/src/Spec/Swagger2.php +++ b/src/Spec/Swagger2.php @@ -112,7 +112,7 @@ public function getServices() $list[$tag] = [ 'name' => $tag, 'methods' => $methods, - 'globalParams' => $this->serviceParams[$tag] ?? [], + // 'globalParams' => $this->serviceParams[$tag] ?? [], ]; } } @@ -210,7 +210,7 @@ public function getMethods($service) 'default' => $parameter['default'] ?? null, 'example' => $parameter['x-example'] ?? null, 'isUploadID' => $parameter['x-upload-id'] ?? false, - 'isGlobal' => $parameter['x-global'] ?? false, + // 'isGlobal' => $parameter['x-global'] ?? false, 'array' => [ 'type' => $parameter['items']['type'] ?? '', ], @@ -250,7 +250,7 @@ public function getMethods($service) $param['required'] = (in_array($key, $bodyRequired)); $param['default'] = $value['default'] ?? null; $param['example'] = $value['x-example'] ?? null; - $param['isGlobal'] = $value['x-global'] ?? false; + // $param['isGlobal'] = $value['x-global'] ?? false; $param['isUploadID'] = $value['x-upload-id'] ?? false; $param['array'] = [ 'type' => $value['items']['type'] ?? '', From cfc5f7b2959aeb81eea9914b002ee509ed831ad0 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 2 Aug 2022 10:59:50 +0000 Subject: [PATCH 184/555] commenting service params reference --- src/Spec/Swagger2.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Spec/Swagger2.php b/src/Spec/Swagger2.php index e4cddba7b6..26d5070aa1 100644 --- a/src/Spec/Swagger2.php +++ b/src/Spec/Swagger2.php @@ -9,7 +9,7 @@ class Swagger2 extends Spec /** * @var array */ - private array $serviceParams = []; + // private array $serviceParams = []; /** * @return string @@ -138,7 +138,7 @@ public function getServices() public function getMethods($service) { $list = []; - $serviceParams= []; + // $serviceParams= []; $security = $this->getAttribute('securityDefinitions', []); $paths = $this->getAttribute('paths', []); @@ -222,9 +222,9 @@ public function getMethods($service) $param['default'] = (is_array($param['default'])) ? json_encode($param['default']) : $param['default']; - if(($parameter['x-global'] ?? false)) { - $serviceParams[$param['name']] = $param; - } + // if(($parameter['x-global'] ?? false)) { + // $serviceParams[$param['name']] = $param; + // } switch ($parameter['in']) { case 'header': @@ -282,7 +282,7 @@ public function getMethods($service) } } - $this->serviceParams[$service] = $serviceParams; + // $this->serviceParams[$service] = $serviceParams; return $list; } From 58b0b2c46ce6a6631a4910216bcaaca17e9c5e32 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 2 Aug 2022 12:19:30 +0000 Subject: [PATCH 185/555] update the tests without service params --- tests/languages/android/Tests.kt | 12 ++++++------ tests/languages/dart/tests.dart | 12 ++++++------ tests/languages/deno/tests.ts | 12 ++++++------ tests/languages/flutter/tests.dart | 12 ++++++------ tests/languages/kotlin/Tests.kt | 12 ++++++------ tests/languages/node/test.js | 12 ++++++------ tests/languages/php/test.php | 12 ++++++------ tests/languages/python/tests.py | 12 ++++++------ tests/languages/ruby/tests.rb | 12 ++++++------ tests/languages/swift-client/Tests.swift | 12 ++++++------ tests/languages/swift-server/Tests.swift | 12 ++++++------ tests/languages/web/node.js | 12 ++++++------ 12 files changed, 72 insertions(+), 72 deletions(-) diff --git a/tests/languages/android/Tests.kt b/tests/languages/android/Tests.kt index 76d71c4a87..3993e5eda7 100644 --- a/tests/languages/android/Tests.kt +++ b/tests/languages/android/Tests.kt @@ -60,7 +60,7 @@ class ServiceTest { .setProject("console") .addHeader("Origin", "http://localhost") .setSelfSigned(true) - val foo = Foo(client, "string") + val foo = Foo(client) val bar = Bar(client) val general = General(client) val realtime = Realtime(client) @@ -73,15 +73,15 @@ class ServiceTest { runBlocking { var mock: Mock // Foo Tests - mock = foo.get(123, listOf("string in array")) + mock = foo.get("string", 123, listOf("string in array")) writeToFile(mock.result) - mock = foo.post(123, listOf("string in array")) + mock = foo.post("string", 123, listOf("string in array")) writeToFile(mock.result) - mock = foo.put(123, listOf("string in array")) + mock = foo.put("string", 123, listOf("string in array")) writeToFile(mock.result) - mock = foo.patch(123, listOf("string in array")) + mock = foo.patch("string", 123, listOf("string in array")) writeToFile(mock.result) - mock = foo.delete(123, listOf("string in array")) + mock = foo.delete("string", 123, listOf("string in array")) writeToFile(mock.result) // Bar Tests diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 32602ed39a..7aff91edbe 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -3,7 +3,7 @@ import '../lib/models.dart'; void main() async { Client client = Client(); - Foo foo = Foo(client, x: 'string'); + Foo foo = Foo(client); Bar bar = Bar(client); General general = General(client); @@ -14,19 +14,19 @@ void main() async { // Foo Tests Mock response; - response = await foo.get(y: 123, z: ['string in array']); + response = await foo.get(x: 'string', y: 123, z: ['string in array']); print(response.result); - response = await foo.post(y: 123, z: ['string in array']); + response = await foo.post(x: 'string', y: 123, z: ['string in array']); print(response.result); - response = await foo.put(y: 123, z: ['string in array']); + response = await foo.put(x: 'string', y: 123, z: ['string in array']); print(response.result); - response = await foo.patch(y: 123, z: ['string in array']); + response = await foo.patch(x: 'string', y: 123, z: ['string in array']); print(response.result); - response = await foo.delete(y: 123, z: ['string in array']); + response = await foo.delete(x: 'string', y: 123, z: ['string in array']); print(response.result); // Bar Tests diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts index ead1a3cb13..9833e0cea3 100644 --- a/tests/languages/deno/tests.ts +++ b/tests/languages/deno/tests.ts @@ -8,7 +8,7 @@ async function start() { // Init SDK let client = new appwrite.Client() - let foo = new appwrite.Foo(client, 'string') + let foo = new appwrite.Foo(client) let bar = new appwrite.Bar(client) let general = new appwrite.General(client) @@ -18,23 +18,23 @@ async function start() { // Foo - response = await foo.get(123, ['string in array']) + response = await foo.get('string', 123, ['string in array']) // @ts-ignore console.log(response.result) - response = await foo.post(123, ['string in array']) + response = await foo.post('string', 123, ['string in array']) // @ts-ignore console.log(response.result) - response = await foo.put(123, ['string in array']) + response = await foo.put('string', 123, ['string in array']) // @ts-ignore console.log(response.result) - response = await foo.patch(123, ['string in array']) + response = await foo.patch('string', 123, ['string in array']) // @ts-ignore console.log(response.result) - response = await foo.delete(123, ['string in array']) + response = await foo.delete('string', 123, ['string in array']) // @ts-ignore console.log(response.result) diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index 6bf56b1672..b03b3bc585 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -5,7 +5,7 @@ import '../lib/models.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); Client client = Client(); - Foo foo = Foo(client, x: 'string'); + Foo foo = Foo(client); Bar bar = Bar(client); General general = General(client); @@ -23,19 +23,19 @@ void main() async { print('\nTest Started'); Mock response; - response = await foo.get(y: 123, z: ['string in array']); + response = await foo.get(x: 'string', y: 123, z: ['string in array']); print(response.result); - response = await foo.post(y: 123, z: ['string in array']); + response = await foo.post(x: 'string', y: 123, z: ['string in array']); print(response.result); - response = await foo.put(y: 123, z: ['string in array']); + response = await foo.put(x: 'string', y: 123, z: ['string in array']); print(response.result); - response = await foo.patch(y: 123, z: ['string in array']); + response = await foo.patch(x: 'string', y: 123, z: ['string in array']); print(response.result); - response = await foo.delete(y: 123, z: ['string in array']); + response = await foo.delete(x: 'string', y: 123, z: ['string in array']); print(response.result); // Bar Tests diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt index 0e449fef2c..38e55996f2 100644 --- a/tests/languages/kotlin/Tests.kt +++ b/tests/languages/kotlin/Tests.kt @@ -35,22 +35,22 @@ class ServiceTest { val client = Client() .addHeader("Origin", "http://localhost") .setSelfSigned(true) - val foo = Foo(client, "string") + val foo = Foo(client) val bar = Bar(client) val general = General(client) runBlocking { var mock: Mock // Foo Tests - mock = foo.get(123, listOf("string in array")) + mock = foo.get("string", 123, listOf("string in array")) writeToFile(mock.result) - mock = foo.post(123, listOf("string in array")) + mock = foo.post("string", 123, listOf("string in array")) writeToFile(mock.result) - mock = foo.put(123, listOf("string in array")) + mock = foo.put("string", 123, listOf("string in array")) writeToFile(mock.result) - mock = foo.patch(123, listOf("string in array")) + mock = foo.patch("string", 123, listOf("string in array")) writeToFile(mock.result) - mock = foo.delete(123, listOf("string in array")) + mock = foo.delete("string", 123, listOf("string in array")) writeToFile(mock.result) // Bar Tests diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index 7f48708bfa..76a31d2b18 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -9,7 +9,7 @@ async function start() { // Init SDK let client = new appwrite.Client(); - let foo = new appwrite.Foo(client, 'string'); + let foo = new appwrite.Foo(client); let bar = new appwrite.Bar(client); let general = new appwrite.General(client); @@ -19,19 +19,19 @@ async function start() { // Foo - response = await foo.get(123, ['string in array']); + response = await foo.get('string', 123, ['string in array']); console.log(response.result); - response = await foo.post(123, ['string in array']); + response = await foo.post('string', 123, ['string in array']); console.log(response.result); - response = await foo.put(123, ['string in array']); + response = await foo.put('string', 123, ['string in array']); console.log(response.result); - response = await foo.patch(123, ['string in array']); + response = await foo.patch('string', 123, ['string in array']); console.log(response.result); - response = await foo.delete(123, ['string in array']); + response = await foo.delete('string', 123, ['string in array']); console.log(response.result); // Bar diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index 9a6ec906d5..5667b27a2c 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -16,7 +16,7 @@ use Appwrite\Services\General; $client = new Client(); -$foo = new Foo($client, 'string'); +$foo = new Foo($client); $bar = new Bar($client); $general = new General($client); @@ -26,19 +26,19 @@ // Foo Service -$response = $foo->get(123, ['string in array']); +$response = $foo->get('string', 123, ['string in array']); echo "{$response['result']}\n"; -$response = $foo->post(123, ['string in array']); +$response = $foo->post('string', 123, ['string in array']); echo "{$response['result']}\n"; -$response = $foo->put(123, ['string in array']); +$response = $foo->put('string', 123, ['string in array']); echo "{$response['result']}\n"; -$response = $foo->patch(123, ['string in array']); +$response = $foo->patch('string', 123, ['string in array']); echo "{$response['result']}\n"; -$response = $foo->delete(123, ['string in array']); +$response = $foo->delete('string', 123, ['string in array']); echo "{$response['result']}\n"; // Bar Service diff --git a/tests/languages/python/tests.py b/tests/languages/python/tests.py index f0e2744a3e..18dcbb6337 100644 --- a/tests/languages/python/tests.py +++ b/tests/languages/python/tests.py @@ -8,7 +8,7 @@ client = Client() -foo = Foo(client, 'string') +foo = Foo(client) bar = Bar(client) general = General(client) @@ -19,19 +19,19 @@ # Foo Tests -response = foo.get(123, ['string in array']) +response = foo.get('string', 123, ['string in array']) print(response['result']) -response = foo.post( 123, ['string in array']) +response = foo.post('string', 123, ['string in array']) print(response['result']) -response = foo.put( 123, ['string in array']) +response = foo.put('string', 123, ['string in array']) print(response['result']) -response = foo.patch( 123, ['string in array']) +response = foo.patch('string', 123, ['string in array']) print(response['result']) -response = foo.delete( 123, ['string in array']) +response = foo.delete('string', 123, ['string in array']) print(response['result']) # Bar Tests diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index 426ff30242..0a5e860d04 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -3,7 +3,7 @@ client = Appwrite::Client.new client.add_header('Origin', 'http://localhost') -foo = Appwrite::Foo.new(client, x: 'string') +foo = Appwrite::Foo.new(client) bar = Appwrite::Bar.new(client) general = Appwrite::General.new(client) @@ -12,19 +12,19 @@ # Foo -response = foo.get(y: 123, z: ['string in array']) +response = foo.get(x: 'string', y: 123, z: ['string in array']) puts response.result -response = foo.post(y: 123, z: ['string in array']) +response = foo.post(x: 'string', y: 123, z: ['string in array']) puts response.result -response = foo.put(y: 123, z: ['string in array']) +response = foo.put(x: 'string', y: 123, z: ['string in array']) puts response.result -response = foo.patch(y: 123, z: ['string in array']) +response = foo.patch(x: 'string', y: 123, z: ['string in array']) puts response.result -response = foo.delete(y: 123, z: ['string in array']) +response = foo.delete(x: 'string', y: 123, z: ['string in array']) puts response.result # Bar diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/swift-client/Tests.swift index 6af0d6b0f1..cffa3f3550 100644 --- a/tests/languages/swift-client/Tests.swift +++ b/tests/languages/swift-client/Tests.swift @@ -25,7 +25,7 @@ class Tests: XCTestCase { .addHeader(key: "Origin", value: "http://localhost") .setSelfSigned() - let foo = Foo(client, "string") + let foo = Foo(client) let bar = Bar(client) let general = General(client) let realtime = Realtime(client) @@ -41,19 +41,19 @@ class Tests: XCTestCase { var mock: Mock // Foo Tests - mock = try await foo.get(y: 123, z: ["string in array"]) + mock = try await foo.get(x: "string", y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.post(y: 123, z: ["string in array"]) + mock = try await foo.post(x: "string", y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.put(y: 123, z: ["string in array"]) + mock = try await foo.put(x: "string", y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.patch(y: 123, z: ["string in array"]) + mock = try await foo.patch(x: "string", y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.delete(y: 123, z: ["string in array"]) + mock = try await foo.delete(x: "string", y: 123, z: ["string in array"]) print(mock.result) diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index be96bc0029..a5782e2329 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -24,26 +24,26 @@ class Tests: XCTestCase { .addHeader(key: "Origin", value: "http://localhost") .setSelfSigned() - let foo = Foo(client, "string") + let foo = Foo(client) let bar = Bar(client) let general = General(client) var mock: Mock // Foo Tests - mock = try await foo.get(y: 123, z: ["string in array"]) + mock = try await foo.get(x: "string", y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.post(y: 123, z: ["string in array"]) + mock = try await foo.post(x: "string", y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.put(y: 123, z: ["string in array"]) + mock = try await foo.put(x: "string", y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.patch(y: 123, z: ["string in array"]) + mock = try await foo.patch(x: "string", y: 123, z: ["string in array"]) print(mock.result) - mock = try await foo.delete(y: 123, z: ["string in array"]) + mock = try await foo.delete(x: "string", y: 123, z: ["string in array"]) print(mock.result) diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js index b2de9a4c8f..e5fccb359f 100644 --- a/tests/languages/web/node.js +++ b/tests/languages/web/node.js @@ -5,23 +5,23 @@ async function start() { console.log('\nTest Started'); const client = new Client(); - const foo = new Foo(client, 'string'); + const foo = new Foo(client); const bar = new Bar(client); const general = new General(client); // Foo - response = await foo.get(123, ['string in array']); + response = await foo.get('string', 123, ['string in array']); console.log(response.result); - response = await foo.post(123, ['string in array']); + response = await foo.post('string', 123, ['string in array']); console.log(response.result); - response = await foo.put(123, ['string in array']); + response = await foo.put('string', 123, ['string in array']); console.log(response.result); - response = await foo.patch(123, ['string in array']); + response = await foo.patch('string', 123, ['string in array']); console.log(response.result); - response = await foo.delete(123, ['string in array']); + response = await foo.delete('string', 123, ['string in array']); console.log(response.result); // Bar From c439e4fb31cb127a438646763daff4ac4a05a5b7 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 2 Aug 2022 12:40:31 +0000 Subject: [PATCH 186/555] use latest dart sdk version --- templates/dart/pubspec.yaml.twig | 2 +- templates/flutter/pubspec.yaml.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/dart/pubspec.yaml.twig b/templates/dart/pubspec.yaml.twig index f7e8ad2c03..8a4a6c271d 100644 --- a/templates/dart/pubspec.yaml.twig +++ b/templates/dart/pubspec.yaml.twig @@ -6,7 +6,7 @@ repository: https://github.com/{{sdk.gitUserName}}/{{sdk.gitRepoName}} issue_tracker: https://github.com/appwrite/sdk-generator/issues documentation: {{ spec.contactURL }} environment: - sdk: '>=2.14.0 <3.0.0' + sdk: '>=2.17.0 <3.0.0' dependencies: http: ^0.13.4 diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index da671fecd0..fadd87ddf4 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -6,7 +6,7 @@ repository: https://github.com/{{sdk.gitUserName}}/{{sdk.gitRepoName}} issue_tracker: https://github.com/appwrite/sdk-generator/issues documentation: {{ spec.contactURL }} environment: - sdk: '>=2.14.0 <3.0.0' + sdk: '>=2.17.0 <3.0.0' dependencies: flutter: sdk: flutter From 116e0c5f0ead960fcc5b9208b27ea98bc0b4bdfc Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 2 Aug 2022 12:41:19 +0000 Subject: [PATCH 187/555] fix web html --- tests/languages/web/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index e614a892ae..79abf18829 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -22,7 +22,7 @@ // Init SDK const { Client, Foo, Bar, General } = Appwrite; const client = new Client(); - const foo = new Foo(client, 'string'); + const foo = new Foo(client); const bar = new Bar(client); const general = new General(client); @@ -34,19 +34,19 @@ }); // Foo - response = await foo.get(123, ["string in array"]); + response = await foo.get('string', 123, ["string in array"]); console.log(response.result); - response = await foo.post(123, ["string in array"]); + response = await foo.post('string', 123, ["string in array"]); console.log(response.result); - response = await foo.put(123, ["string in array"]); + response = await foo.put('string', 123, ["string in array"]); console.log(response.result); - response = await foo.patch(123, ["string in array"]); + response = await foo.patch('string', 123, ["string in array"]); console.log(response.result); - response = await foo.delete(123, ["string in array"]); + response = await foo.delete('string', 123, ["string in array"]); console.log(response.result); // Bar From 8f31d407db43ea1d1ede0d67f4057b319fef52f7 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 2 Aug 2022 12:56:33 +0000 Subject: [PATCH 188/555] Implement changes from PR reviews --- templates/swift/base/params.twig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/swift/base/params.twig b/templates/swift/base/params.twig index da139a4a1b..3af5686bcf 100644 --- a/templates/swift/base/params.twig +++ b/templates/swift/base/params.twig @@ -15,11 +15,13 @@ {% endif %} {% for parameter in method.parameters.query | merge(method.parameters.body) %} "{{ parameter.name }}": {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last or _self.methodNeedsSecurityParameters(method) %},{% endif %} + {% endfor %} {% if _self.methodNeedsSecurityParameters(method) %} {% for node in method.security %} {% for key,header in node|keys %} "{{header|caseLower}}": client.config["{{header|caseLower}}"]{% if not loop.last %},{% endif %} + {% endfor %} {% endfor %} {% endif %} From 464a26d367dfc66b6120d32eb2b163981451ed3a Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 2 Aug 2022 13:13:11 +0000 Subject: [PATCH 189/555] debug tests --- .../base/macros/methodNeedsSecurityParameters.twig | 3 --- templates/kotlin/base/macros/resultType.twig | 3 --- templates/kotlin/base/requests/api.twig | 4 ++-- templates/kotlin/base/requests/location.twig | 3 ++- .../base/{macros/parameter.twig => utils.twig} | 6 ++++++ .../io/appwrite/services/ServiceTemplate.kt.twig | 12 +++++------- 6 files changed, 15 insertions(+), 16 deletions(-) delete mode 100644 templates/kotlin/base/macros/methodNeedsSecurityParameters.twig delete mode 100644 templates/kotlin/base/macros/resultType.twig rename templates/kotlin/base/{macros/parameter.twig => utils.twig} (52%) diff --git a/templates/kotlin/base/macros/methodNeedsSecurityParameters.twig b/templates/kotlin/base/macros/methodNeedsSecurityParameters.twig deleted file mode 100644 index e3df533df5..0000000000 --- a/templates/kotlin/base/macros/methodNeedsSecurityParameters.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% macro methodNeedsSecurityParameters(method) %} -{% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} -{% endmacro %} \ No newline at end of file diff --git a/templates/kotlin/base/macros/resultType.twig b/templates/kotlin/base/macros/resultType.twig deleted file mode 100644 index 1125be27ff..0000000000 --- a/templates/kotlin/base/macros/resultType.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% macro resultType(namespace, method) %} -{% if method.type == "webAuth" %}Bool{% elseif method.type == "location" %}ByteArray{% elseif not method.responseModel or method.responseModel == 'any' %}Any{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} -{% endmacro %} \ No newline at end of file diff --git a/templates/kotlin/base/requests/api.twig b/templates/kotlin/base/requests/api.twig index 5ab352ec45..14d89c7306 100644 --- a/templates/kotlin/base/requests/api.twig +++ b/templates/kotlin/base/requests/api.twig @@ -1,10 +1,10 @@ -{% import 'kotlin/base/macros/resultType.twig' as result%} +{% import 'kotlin/base/utils.twig' as utils%} return client.call( "{{ method.method | caseUpper }}", path, headers, params, - responseType = {{ result.resultType(sdk.namespace, method) }}::class.java, + responseType = {{ utils.resultType(sdk.namespace, method) }}::class.java, {% if method.responseModel %} converter, {% endif %} diff --git a/templates/kotlin/base/requests/location.twig b/templates/kotlin/base/requests/location.twig index 1bc46a598f..5174981af5 100644 --- a/templates/kotlin/base/requests/location.twig +++ b/templates/kotlin/base/requests/location.twig @@ -1,6 +1,7 @@ +{% import 'kotlin/base/utils.twig' as utils%} return client.call( "{{ method.method | caseUpper }}", path, params = params, - responseType = {{ result.resultType(sdk.namespace, method) }}::class.java + responseType = {{ utils.resultType(sdk.namespace, method) }}::class.java ) \ No newline at end of file diff --git a/templates/kotlin/base/macros/parameter.twig b/templates/kotlin/base/utils.twig similarity index 52% rename from templates/kotlin/base/macros/parameter.twig rename to templates/kotlin/base/utils.twig index 52445bccfe..21e22e929c 100644 --- a/templates/kotlin/base/macros/parameter.twig +++ b/templates/kotlin/base/utils.twig @@ -1,4 +1,10 @@ {% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter.type | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} {% macro method_parameters(parameters, consumes) %} {% if parameters.all|length > 0 %}{% for parameter in parameters.all | filter((param) => not param.isGlobal) %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} +{% endmacro %} +{% macro methodNeedsSecurityParameters(method) %} +{% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} +{% endmacro %} +{% macro resultType(namespace, method) %} +{% if method.type == "webAuth" %}Bool{% elseif method.type == "location" %}ByteArray{% elseif not method.responseModel or method.responseModel == 'any' %}Any{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} {% endmacro %} \ No newline at end of file diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index e8b34ad8a4..a0c8645dc2 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -1,6 +1,4 @@ -{% import 'kotlin/base/macros/parameter.twig' as parameters %} -{% import 'kotlin/base/macros/methodNeedsSecurityParameters.twig' as securityParameters %} -{% import 'kotlin/base/macros/resultType.twig' as result %} +{% import 'kotlin/base/utils.twig' as utils %} package {{ sdk.namespace | caseDot }}.services import {{ sdk.namespace | caseDot }}.Client import {{ sdk.namespace | caseDot }}.models.* @@ -55,10 +53,10 @@ class {{ service.name | caseUcfirst }} : Service { val params = mutableMapOf( {% for parameter in method.parameters.query | merge(method.parameters.body) %} - "{{ parameter.name }}" to {{ parameter.name | caseCamel }}{% if not loop.last or securityParameters.methodNeedsSecurityParameters(method) %},{% endif %} + "{{ parameter.name }}" to {{ parameter.name | caseCamel }}{% if not loop.last or utils.methodNeedsSecurityParameters(method) %},{% endif %} {% endfor %} -{% if securityParameters.methodNeedsSecurityParameters(method) %} +{% if utils.methodNeedsSecurityParameters(method) %} {% for node in method.security %} {% for key,header in node|keys %} "{{header|caseLower}}" to client.config["{{header|caseLower}}"]{% if not loop.last %},{% endif %} @@ -115,11 +113,11 @@ class {{ service.name | caseUcfirst }} : Service { {{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} ) {% if method.responseModel %} - val converter: (Map) -> {{ result.resultType(sdk.namespace, method) }} = { + val converter: (Map) -> {{ utils.resultType(sdk.namespace, method) }} = { {% if method.responseModel == 'any' %} it {% else %} - {{ result.resultType(sdk.namespace, method) }}.from(map = it) + {{ utils.resultType(sdk.namespace, method) }}.from(map = it) {% endif %} } {% endif %} From 60f742e50d92cc89b5cf529edee98d8b5b4896b3 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 3 Aug 2022 15:46:31 +1200 Subject: [PATCH 190/555] Pass root parameter object to `getTypeName` to allow setting collection types in typed langauges --- src/SDK/Language.php | 4 ++-- src/SDK/Language/Dart.php | 22 +++++++++---------- src/SDK/Language/Deno.php | 19 +++++++--------- src/SDK/Language/DotNet.php | 15 +++++-------- src/SDK/Language/Go.php | 12 +++++----- src/SDK/Language/HTTP.php | 20 ++++++++--------- src/SDK/Language/JS.php | 14 +++++++----- src/SDK/Language/Kotlin.php | 15 ++++++++----- src/SDK/Language/Node.php | 14 +++++++----- src/SDK/Language/PHP.php | 10 ++++++--- src/SDK/Language/Python.php | 5 +++-- src/SDK/Language/Ruby.php | 22 ++++++++++++++----- src/SDK/Language/Swift.php | 13 ++++++----- src/SDK/Language/Web.php | 17 +++++++------- .../java/io/appwrite/models/Model.kt.twig | 2 +- .../appwrite/services/ServiceTemplate.kt.twig | 6 ++--- templates/cli/lib/commands/command.js.twig | 4 ++-- templates/dart/lib/services/service.dart.twig | 4 ++-- templates/dart/lib/src/models/model.dart.twig | 2 +- templates/deno/src/models.d.ts.twig | 2 +- templates/deno/src/services/service.ts.twig | 12 +++++----- .../Appwrite/Services/ServiceTemplate.cs.twig | 2 +- .../flutter/lib/services/service.dart.twig | 4 ++-- .../flutter/lib/src/models/model.dart.twig | 2 +- templates/go/services/service.go.twig | 2 +- .../kotlin/io/appwrite/models/Model.kt.twig | 2 +- .../appwrite/services/ServiceTemplate.kt.twig | 6 ++--- templates/node/index.d.ts.twig | 16 +++++++------- templates/node/lib/services/service.js.twig | 6 ++--- templates/php/src/Services/Service.php.twig | 12 +++++----- .../ruby/lib/container/models/model.rb.twig | 2 +- .../lib/container/services/service.rb.twig | 2 +- .../swift/Sources/Models/Model.swift.twig | 2 +- .../swift/Sources/Services/Service.swift.twig | 12 +++++----- templates/web/src/services/template.ts.twig | 4 ++-- 35 files changed, 161 insertions(+), 147 deletions(-) diff --git a/src/SDK/Language.php b/src/SDK/Language.php index 3b6ef10c2f..e8f5d23eb8 100644 --- a/src/SDK/Language.php +++ b/src/SDK/Language.php @@ -38,10 +38,10 @@ abstract public function getIdentifierOverrides(); abstract public function getFiles(); /** - * @param $type + * @param array $parameter * @return string */ - abstract public function getTypeName($type); + abstract public function getTypeName(array $parameter): string; /** * @param array $param diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index f83474de02..f19d90c870 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -116,34 +116,32 @@ public function getIdentifierOverrides() } /** - * @param $type + * @param array $parameter * @return string */ - public function getTypeName($type) + public function getTypeName(array $parameter): string { - switch ($type) { + switch ($parameter['type']) { case self::TYPE_INTEGER: return 'int'; - break; case self::TYPE_STRING: return 'String'; - break; case self::TYPE_FILE: return 'InputFile'; - break; case self::TYPE_BOOLEAN: return 'bool'; - break; case self::TYPE_ARRAY: - return 'List'; - case self::TYPE_OBJECT: - return 'Map'; + if (!empty($parameter['array']['type'])) { + return 'List<' . $this->getTypeName($parameter['array']) . '>'; + } + return 'List'; + case self::TYPE_OBJECT: + return 'Map'; case self::TYPE_NUMBER: return 'double'; - break; } - return $type; + return $parameter['type']; } /** diff --git a/src/SDK/Language/Deno.php b/src/SDK/Language/Deno.php index 31ddbb7a8c..56d05068c7 100644 --- a/src/SDK/Language/Deno.php +++ b/src/SDK/Language/Deno.php @@ -93,34 +93,31 @@ public function getFiles() ]; } - /** - * @param $type + /** + * @param array $parameter * @return string */ - public function getTypeName($type) + public function getTypeName(array $parameter): string { - switch ($type) { + switch ($parameter['type']) { case self::TYPE_INTEGER: return 'number'; - break; case self::TYPE_STRING: return 'string'; - break; case self::TYPE_FILE: return 'InputFile'; - break; case self::TYPE_BOOLEAN: return 'boolean'; - break; case self::TYPE_ARRAY: + if (!empty($parameter['array']['type'])) { + return $this->getTypeName($parameter['array']) . '[]'; + } return 'string[]'; - break; case self::TYPE_OBJECT: return 'object'; - break; } - return $type; + return $parameter['type']; } /** diff --git a/src/SDK/Language/DotNet.php b/src/SDK/Language/DotNet.php index 374e9f373c..d7d4718427 100644 --- a/src/SDK/Language/DotNet.php +++ b/src/SDK/Language/DotNet.php @@ -147,30 +147,27 @@ public function getIdentifierOverrides() * @param $type * @return string */ - public function getTypeName($type) + public function getTypeName(array $parameter): string { - switch ($type) { + switch ($parameter['type']) { case self::TYPE_INTEGER: return 'int'; - break; case self::TYPE_STRING: return 'string'; - break; case self::TYPE_FILE: return 'FileInfo'; - break; case self::TYPE_BOOLEAN: return 'bool'; - break; case self::TYPE_ARRAY: + if (!empty($parameter['array']['type'])) { + return 'List<' . $this->getTypeName($parameter['array']) . '>'; + } return 'List'; - break; case self::TYPE_OBJECT: return 'object'; - break; } - return $type; + return $parameter['type']; } /** diff --git a/src/SDK/Language/Go.php b/src/SDK/Language/Go.php index d480a3122a..faece9dd02 100644 --- a/src/SDK/Language/Go.php +++ b/src/SDK/Language/Go.php @@ -110,20 +110,20 @@ public function getFiles() } /** - * @param $type + * @param array $parameter + * @param array $nestedTypes * @return string */ - public function getTypeName($type) + public function getTypeName(array $parameter): string { - switch ($type) { + switch ($parameter['type']) { case self::TYPE_INTEGER: return 'int'; case self::TYPE_NUMBER: return 'float64'; + case self::TYPE_FILE: case self::TYPE_STRING: return 'string'; - case self::TYPE_FILE: - return 'string'; // '*os.File'; case self::TYPE_BOOLEAN: return 'bool'; case self::TYPE_OBJECT: @@ -132,7 +132,7 @@ public function getTypeName($type) return '[]interface{}'; } - return $type; + return $parameter['type']; } /** diff --git a/src/SDK/Language/HTTP.php b/src/SDK/Language/HTTP.php index fa384484c7..a91a849f32 100644 --- a/src/SDK/Language/HTTP.php +++ b/src/SDK/Language/HTTP.php @@ -36,29 +36,27 @@ public function getIdentifierOverrides() * @param $type * @return string */ - public function getTypeName($type) + public function getTypeName(array $parameter): string { - switch ($type) { + switch ($parameter['type']) { case self::TYPE_INTEGER: return 'int'; - break; case self::TYPE_STRING: return 'String'; - break; case self::TYPE_FILE: return 'MultipartFile'; - break; case self::TYPE_BOOLEAN: return 'bool'; - break; case self::TYPE_ARRAY: - return 'List'; - case self::TYPE_OBJECT: - return 'dynamic'; - break; + if (!empty($parameter['array']['type'])) { + return 'List<' . $this->getTypeName($parameter['array']) . '>'; + } + return 'List'; + case self::TYPE_OBJECT: + return 'dynamic'; } - return $type; + return $parameter['type']; } /** diff --git a/src/SDK/Language/JS.php b/src/SDK/Language/JS.php index 41ebf28021..a6412125a4 100644 --- a/src/SDK/Language/JS.php +++ b/src/SDK/Language/JS.php @@ -117,24 +117,26 @@ public function getIdentifierOverrides() } /** - * @param $type + * @param array $parameter + * @param array $nestedTypes * @return string */ - public function getTypeName($type) + public function getTypeName(array $parameter): string { - switch ($type) { + switch ($parameter['type']) { case self::TYPE_INTEGER: case self::TYPE_NUMBER: return 'number'; - break; case self::TYPE_ARRAY: + if (!empty($parameter['array']['type'])) { + return $this->getTypeName($parameter['array']) . '[]'; + } return 'string[]'; case self::TYPE_FILE: return 'File'; - break; } - return $type; + return $parameter['type']; } /** diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index d00cc30184..9cd239ac28 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -101,9 +101,9 @@ public function getIdentifierOverrides() * @param $type * @return string */ - public function getTypeName($type) + public function getTypeName(array $parameter): string { - switch ($type) { + switch ($parameter['type']) { case self::TYPE_INTEGER: return 'Long'; case self::TYPE_NUMBER: @@ -115,12 +115,15 @@ public function getTypeName($type) case self::TYPE_BOOLEAN: return 'Boolean'; case self::TYPE_ARRAY: - return 'List'; - case self::TYPE_OBJECT: - return 'Any'; + if (!empty($parameter['array']['type'])) { + return 'List<' . $this->getTypeName($parameter['array']) . '>'; + } + return 'List'; + case self::TYPE_OBJECT: + return 'Any'; } - return $type; + return $parameter['type']; } /** diff --git a/src/SDK/Language/Node.php b/src/SDK/Language/Node.php index 62f9ea5ffc..ce4e84c424 100644 --- a/src/SDK/Language/Node.php +++ b/src/SDK/Language/Node.php @@ -13,24 +13,26 @@ public function getName() } /** - * @param $type + * @param array $parameter + * @param array $nestedTypes * @return string */ - public function getTypeName($type) + public function getTypeName(array $parameter): string { - switch ($type) { + switch ($parameter['type']) { case self::TYPE_INTEGER: case self::TYPE_NUMBER: return 'number'; - break; case self::TYPE_ARRAY: + if (!empty($parameter['array']['type'])) { + return $this->getTypeName($parameter['array']) . '[]'; + } return 'string[]'; case self::TYPE_FILE: return 'InputFile'; - break; } - return $type; + return $parameter['type']; } /** diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index fd7b94db1d..d1f140bde8 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -212,12 +212,15 @@ public function getFiles() } /** - * @param $type + * @param array $parameter + * @param array $nestedTypes * @return string */ - public function getTypeName($type) + public function getTypeName(array $parameter): string { - switch ($type) { + switch ($parameter['type']) { + case self::TYPE_STRING: + return 'string'; case self::TYPE_BOOLEAN: $type = 'bool'; break; @@ -225,6 +228,7 @@ public function getTypeName($type) case self::TYPE_INTEGER: $type = 'int'; break; + case self::TYPE_ARRAY: case self::TYPE_OBJECT: $type = 'array'; break; diff --git a/src/SDK/Language/Python.php b/src/SDK/Language/Python.php index 969aaed88d..962ed52485 100644 --- a/src/SDK/Language/Python.php +++ b/src/SDK/Language/Python.php @@ -207,10 +207,11 @@ public function getFiles() } /** - * @param $type + * @param array $parameter * @return string + * @throws Exception */ - public function getTypeName($type) + public function getTypeName(array $parameter): string { throw new Exception('Method not supported for Python SDKs'); } diff --git a/src/SDK/Language/Ruby.php b/src/SDK/Language/Ruby.php index f11c11b8f7..3cedfe608e 100644 --- a/src/SDK/Language/Ruby.php +++ b/src/SDK/Language/Ruby.php @@ -185,18 +185,28 @@ public function getFiles() } /** - * @param $type + * @param array $parameter + * @param array $nestedTypes * @return string */ - public function getTypeName($type) + public function getTypeName(array $parameter): string { - switch ($type) { + switch ($parameter['type']) { case self::TYPE_INTEGER: + return 'Integer'; case self::TYPE_NUMBER: - return 'number'; + return 'Float'; + case self::TYPE_STRING: + return 'String'; + case self::TYPE_ARRAY: + return 'Array'; + case self::TYPE_OBJECT: + return 'Hash'; + case self::TYPE_BOOLEAN: + return ''; + default: + return $parameter['type']; } - - return $type; } /** diff --git a/src/SDK/Language/Swift.php b/src/SDK/Language/Swift.php index 398adc62ff..aa3f2c224d 100644 --- a/src/SDK/Language/Swift.php +++ b/src/SDK/Language/Swift.php @@ -294,12 +294,12 @@ public function getFiles() } /** - * @param $type + * @param array $parameter * @return string */ - public function getTypeName($type) + public function getTypeName(array $parameter): string { - switch ($type) { + switch ($parameter['type']) { case self::TYPE_INTEGER: return 'Int'; case self::TYPE_NUMBER: @@ -311,12 +311,15 @@ public function getTypeName($type) case self::TYPE_BOOLEAN: return 'Bool'; case self::TYPE_ARRAY: - return '[Any]'; + if (!empty($parameter['array']['type'])) { + return '[' . $this->getTypeName($parameter['array']) . ']'; + } + return '[Any]'; case self::TYPE_OBJECT: return 'Any'; } - return $type; + return $parameter['type']; } /** diff --git a/src/SDK/Language/Web.php b/src/SDK/Language/Web.php index 4484147782..bca6f4e6fd 100644 --- a/src/SDK/Language/Web.php +++ b/src/SDK/Language/Web.php @@ -175,26 +175,26 @@ public function getParamExample(array $param) return $output; } - public function getTypeName($type, $method = []): string + public function getTypeName(array $parameter, array $method = []): string { - switch ($type) { + switch ($parameter['type']) { case self::TYPE_INTEGER: case self::TYPE_NUMBER: return 'number'; - break; case self::TYPE_ARRAY: + if (!empty($parameter['array']['type'])) { + return $this->getTypeName($parameter['array']) . '[]'; + } return 'string[]'; case self::TYPE_FILE: return 'File'; case self::TYPE_OBJECT: if (empty($method)) { - return $type; + return $parameter['type']; } - switch ($method['responseModel']) { case 'user': return "Partial"; - break; case 'document': if ($method['method'] === 'post') { return "Omit"; @@ -203,10 +203,9 @@ public function getTypeName($type, $method = []): string return "Partial>"; } } - break; } - return $type; + return $parameter['type']; } protected function populateGenerics(string $model, array $spec, array &$generics, bool $skipFirst = false) @@ -320,7 +319,7 @@ public function getSubSchema(array $property, array $spec): string return $ret; } - return $this->getTypeName($property['type']); + return $this->getTypeName($property); } public function getFilters(): array diff --git a/templates/android/library/src/main/java/io/appwrite/models/Model.kt.twig b/templates/android/library/src/main/java/io/appwrite/models/Model.kt.twig index 90775de2cf..e7803dbfba 100644 --- a/templates/android/library/src/main/java/io/appwrite/models/Model.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/models/Model.kt.twig @@ -1,4 +1,4 @@ -{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst}}>{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}Map{% else %}{{property.type | typeName}}{% endif %}{% endif %}{% endmacro %} +{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst}}>{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}Map{% else %}{{property | typeName}}{% endif %}{% endif %}{% endmacro %} package {{ sdk.namespace | caseDot }}.models import com.google.gson.annotations.SerializedName diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index ab2d8c22d4..7dbe60358a 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -1,4 +1,4 @@ -{% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter.type | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} +{% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} {% macro method_parameters(parameters, consumes) %} {% if parameters.all|length > 0 %}{% for parameter in parameters.all | filter((param) => not param.isGlobal) %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} {% endmacro %} @@ -30,11 +30,11 @@ class {{ service.name | caseUcfirst }} : Service { {% if service.globalParams | length %} {% for parameter in service.globalParams %} - val {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | overrideIdentifier }}{% if not parameter.required %}?{% endif %} + val {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | overrideIdentifier }}{% if not parameter.required %}?{% endif %} {% endfor %} - public constructor(client: Client,{% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | overrideIdentifier }}{% if not parameter.required %}? = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) : super(client) { + public constructor(client: Client,{% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | overrideIdentifier }}{% if not parameter.required %}? = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) : super(client) { {% for parameter in service.globalParams %} this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} diff --git a/templates/cli/lib/commands/command.js.twig b/templates/cli/lib/commands/command.js.twig index df4b4c548a..ad9155b37a 100644 --- a/templates/cli/lib/commands/command.js.twig +++ b/templates/cli/lib/commands/command.js.twig @@ -15,7 +15,7 @@ const {{ service.name | caseLower }} = new Command("{{ service.name | caseLower {% for method in service.methods %} const {{ service.name | caseLower }}{{ method.name | caseUcfirst }} = async ({ {% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}, {% endfor %}parseOutput = true, sdk = undefined{% if 'multipart/form-data' in method.consumes %}, onProgress = () => {}{% endif %}{% if method.type == 'location' %}, destination{% endif %}}) => { {% for parameter in method.parameters.all %} - /* @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} */ + /* @param {{ '{' }}{{ parameter | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} */ {% endfor %} let client = !sdk ? await {% if service.name == "projects" %}sdkForConsole(){% else %}sdkForProject(){% endif %} : sdk; @@ -222,7 +222,7 @@ const {{ service.name | caseLower }}{{ method.name | caseUcfirst }} = async ({ { {% autoescape false %} .description(`{{ method.description | replace({'`':'\''}) | replace({'\n':' '}) | replace({'\n \n':' '}) }}`) {% for parameter in method.parameters.all %} - .{% if parameter.required %}requiredOption{% else %}option{% endif %}(`--{{ parameter.name | escapeKeyword }} <{{ parameter.name | escapeKeyword }}{% if parameter.array.type|length > 0 %}...{% endif %}>`, `{{ parameter.description | replace({'`':'\''}) | replace({'\n':' '}) | replace({'\n \n':' '}) }}`{% if parameter.type|typeName == 'boolean' %}, parseBool{% elseif parameter.type|typeName == 'number' %}, parseInteger{% endif %}) + .{% if parameter.required %}requiredOption{% else %}option{% endif %}(`--{{ parameter.name | escapeKeyword }} <{{ parameter.name | escapeKeyword }}{% if parameter.array.type|length > 0 %}...{% endif %}>`, `{{ parameter.description | replace({'`':'\''}) | replace({'\n':' '}) | replace({'\n \n':' '}) }}`{% if parameter | typeName == 'boolean' %}, parseBool{% elseif parameter | typeName == 'number' %}, parseInteger{% endif %}) {% endfor %} {% if method.type == 'location' %} .requiredOption(`--destination `, `output file path.`) diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index b0bc553e23..7d061353c6 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -1,5 +1,5 @@ part of {{ language.params.packageName }}; -{% macro parameter(parameter) %}{% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}{% endmacro %} +{% macro parameter(parameter) %}{% if parameter.required %}required {{ parameter | typeName }}{% else %}{{ parameter | typeName }}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}{% endmacro %} {% macro method_parameters(parameters, consumes) %} {% if parameters|length > 0 %}{{ '{' }}{% for parameter in parameters %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} {% endmacro %} @@ -14,7 +14,7 @@ class {{ service.name | caseUcfirst }} extends Service { {{ service.name | caseUcfirst }}(Client client{{ _self.service_params(service.globalParams) }}): super(client); {% if service.globalParams | length %} {% for parameter in service.globalParams %} - {{ parameter.type | typeName }}{% if not parameter.required %}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}; + {{ parameter | typeName }}{% if not parameter.required %}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}; {% endfor %} {% endif %} {% for method in service.methods %} diff --git a/templates/dart/lib/src/models/model.dart.twig b/templates/dart/lib/src/models/model.dart.twig index 10101967ba..3338d97308 100644 --- a/templates/dart/lib/src/models/model.dart.twig +++ b/templates/dart/lib/src/models/model.dart.twig @@ -1,4 +1,4 @@ -{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst | overrideIdentifier}}>{% else %}{{property.sub_schema | caseUcfirst | overrideIdentifier }}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}Map{% else %}{{property.type | typeName}}{% endif %}{% endif %}{% endmacro %} +{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst | overrideIdentifier}}>{% else %}{{property.sub_schema | caseUcfirst | overrideIdentifier }}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}Map{% else %}{{property | typeName}}{% endif %}{% endif %}{% endmacro %} part of {{ language.params.packageName }}.models; /// {{ definition.description }} diff --git a/templates/deno/src/models.d.ts.twig b/templates/deno/src/models.d.ts.twig index 7bd417cfb2..acbe5834d8 100644 --- a/templates/deno/src/models.d.ts.twig +++ b/templates/deno/src/models.d.ts.twig @@ -9,7 +9,7 @@ {% elseif property.sub_schemas %} ({% for subProperty in property.sub_schemas %}{{subProperty | caseUcfirst}}{% if loop.last == false %} | {% endif %}{% endfor %}){% if property.type == 'array' %}[]{% endif %} {% else %} - {{property.type | typeName}} + {{property | typeName}} {% endif %} {% endapply %} {% endmacro %} diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index ed0ce24890..9b5b87ba75 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -43,17 +43,17 @@ export type UploadProgress = { export class {{ service.name | caseUcfirst }} extends Service { {% if service.globalParams | length %} {% for parameter in service.globalParams %} - protected {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}; - public set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}): void + protected {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName }}; + public set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName }}): void { this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; } - public get{{ parameter.name | caseUcfirst | escapeKeyword }}(): {{ parameter.type | typeName }} + public get{{ parameter.name | caseUcfirst | escapeKeyword }}(): {{ parameter | typeName }} { return this.{{ parameter.name | caseCamel | escapeKeyword }}; } {% endfor %} - constructor(client: Client, {% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}:{{ parameter.type | typeName }}{% if not parameter.required %}|null = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + constructor(client: Client, {% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}:{{ parameter | typeName }}{% if not parameter.required %}|null = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) { super(client); @@ -73,12 +73,12 @@ export class {{ service.name | caseUcfirst }} extends Service { * {% endif %} {% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} - * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} + * @param {{ '{' }}{{ parameter | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {AppwriteException} * @returns {Promise} */ - async {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): Promise<{% if method.type == 'webAuth' %}Response{% elseif method.type == 'location' %}Response{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}> { + async {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): Promise<{% if method.type == 'webAuth' %}Response{% elseif method.type == 'location' %}Response{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}> { {% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} {% if parameter.required %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { diff --git a/templates/dotnet/src/Appwrite/Services/ServiceTemplate.cs.twig b/templates/dotnet/src/Appwrite/Services/ServiceTemplate.cs.twig index 023be1d3ea..f8490accd7 100644 --- a/templates/dotnet/src/Appwrite/Services/ServiceTemplate.cs.twig +++ b/templates/dotnet/src/Appwrite/Services/ServiceTemplate.cs.twig @@ -1,6 +1,6 @@ {% macro parameter(parameter) %} {% if parameter.name == 'orderType' %}{{ 'OrderType orderType = OrderType.ASC' }}{% else %} -{{ parameter.type | typeName }}{% if not parameter.required and (parameter.type == 'boolean' or parameter.type == 'integer') %}?{% endif %} {{ parameter.name | caseCamel | escapeKeyword }}{{ parameter | paramDefault }}{% endif %} +{{ parameter | typeName }}{% if not parameter.required and (parameter.type == 'boolean' or parameter.type == 'integer') %}?{% endif %} {{ parameter.name | caseCamel | escapeKeyword }}{{ parameter | paramDefault }}{% endif %} {% endmacro %} {% macro method_parameters(parameters) %} {% if parameters.all|length > 0 %}{% for parameter in parameters.all %}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ', ' }}{% endif %}{% endfor %}{% endif %} diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index 2da2fe3165..9a6cbb0c2d 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -1,5 +1,5 @@ part of {{ language.params.packageName }}; -{% macro parameter(parameter) %}{% if parameter.required %}required {{ parameter.type | typeName }}{% else %}{{ parameter.type | typeName }}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}{% endmacro %} +{% macro parameter(parameter) %}{% if parameter.required %}required {{ parameter | typeName }}{% else %}{{ parameter | typeName }}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}{% endmacro %} {% macro method_parameters(parameters, consumes) %} {% if parameters|length > 0 %}{{ '{' }}{% for parameter in parameters %}{{ _self.parameter(parameter) }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, Function(UploadProgress)? onProgress{% endif %}{{ '}' }}{% endif %} {% endmacro %} @@ -14,7 +14,7 @@ class {{ service.name | caseUcfirst }} extends Service { {{ service.name | caseUcfirst }}(Client client{{ _self.service_params(service.globalParams) }}): super(client); {% if service.globalParams | length %} {% for parameter in service.globalParams %} - {{ parameter.type | typeName }}{% if not parameter.required %}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}; + {{ parameter | typeName }}{% if not parameter.required %}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}; {% endfor %} {% endif %} {% for method in service.methods %} diff --git a/templates/flutter/lib/src/models/model.dart.twig b/templates/flutter/lib/src/models/model.dart.twig index 56e2799f4b..4c755857bc 100644 --- a/templates/flutter/lib/src/models/model.dart.twig +++ b/templates/flutter/lib/src/models/model.dart.twig @@ -1,4 +1,4 @@ -{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst}}>{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}Map{% else %}{{property.type | typeName}}{% endif %}{% endif %}{% endmacro %} +{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst}}>{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}Map{% else %}{{property | typeName}}{% endif %}{% endif %}{% endmacro %} part of {{ language.params.packageName }}.models; /// {{ definition.description }} diff --git a/templates/go/services/service.go.twig b/templates/go/services/service.go.twig index b787071aea..2ee676ef05 100644 --- a/templates/go/services/service.go.twig +++ b/templates/go/services/service.go.twig @@ -26,7 +26,7 @@ func New{{ service.name | caseUcfirst }}(clt Client) *{{ service.name | caseUcfi {% if method.description %}{{ ((method.name | caseUcfirst) ~ ' ' ~ method.description | caseLcfirst) | godocComment }}{% else %}// {{ method.name | caseUcfirst }}{% endif %} -func (srv *{{ service.name | caseUcfirst }}) {{ method.name | caseUcfirst }}({% if method.parameters.all|length > 0 %}{% for parameter in method.parameters.all %}{{ parameter.name | caseUcfirst }} {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}{% endif %}) (*ClientResponse, error) { +func (srv *{{ service.name | caseUcfirst }}) {{ method.name | caseUcfirst }}({% if method.parameters.all|length > 0 %}{% for parameter in method.parameters.all %}{{ parameter.name | caseUcfirst }} {{ parameter | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}{% endif %}) (*ClientResponse, error) { {% if method.parameters.path|length > 0 %} r := strings.NewReplacer({% for parameter in method.parameters.path %}"{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}", {{ parameter.name | caseUcfirst }}{% if not loop.last %}, {% endif %}{% endfor %}) path := r.Replace("{{ method.path }}") diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig index 90775de2cf..e7803dbfba 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig @@ -1,4 +1,4 @@ -{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst}}>{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}Map{% else %}{{property.type | typeName}}{% endif %}{% endif %}{% endmacro %} +{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst}}>{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}Map{% else %}{{property | typeName}}{% endif %}{% endif %}{% endmacro %} package {{ sdk.namespace | caseDot }}.models import com.google.gson.annotations.SerializedName diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index cf8997519f..f3876a7470 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -1,4 +1,4 @@ -{% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter.type | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} +{% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} {% macro method_parameters(parameters, consumes) %} {% if parameters.all|length > 0 %}{% for parameter in parameters.all | filter((param) => not param.isGlobal) %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} {% endmacro %} @@ -28,11 +28,11 @@ class {{ service.name | caseUcfirst }} : Service { {% if service.globalParams | length %} {% for parameter in service.globalParams %} - val {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | overrideIdentifier }}{% if not parameter.required %}?{% endif %} + val {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | overrideIdentifier }}{% if not parameter.required %}?{% endif %} {% endfor %} - public constructor(client: Client,{% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | overrideIdentifier }}{% if not parameter.required %}? = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) : super(client) { + public constructor(client: Client,{% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | overrideIdentifier }}{% if not parameter.required %}? = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) : super(client) { {% for parameter in service.globalParams %} this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} diff --git a/templates/node/index.d.ts.twig b/templates/node/index.d.ts.twig index fee304ac0e..ae50c740cf 100644 --- a/templates/node/index.d.ts.twig +++ b/templates/node/index.d.ts.twig @@ -7,7 +7,7 @@ {{property.sub_schema | caseUcfirst}}{% if property.type == 'array' %}[]{% endif %} {% endif %} {% else %} - {{property.type | typeName}} + {{property | typeName}} {% endif %} {% endapply %} {% endmacro %} @@ -164,24 +164,24 @@ declare module "{{ language.params.npmPackage|caseDash }}" { {% for service in spec.services %} export class {{ service.name | caseUcfirst }} extends Service { - constructor(client: Client{% for parameter in service.globalParams %}, {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}{% if not parameter.required %}|null{% endif %}{% endfor %}); + constructor(client: Client{% for parameter in service.globalParams %}, {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName }}{% if not parameter.required %}|null{% endif %}{% endfor %}); {% if service.globalParams | length %} {% for parameter in service.globalParams %} /** * Get {{ parameter.name }}. * - * @returns {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} + * @returns {{ '{' }}{{ parameter | typeName }}{{ '}' }} */ - get{{ parameter.name | caseUcfirst | escapeKeyword }}(): {{ parameter.type | typeName }}; + get{{ parameter.name | caseUcfirst | escapeKeyword }}(): {{ parameter | typeName }}; /** * Set {{ parameter.name }}. * - * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} + * @param {{ '{' }}{{ parameter | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} * @returns {void} */ - set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}): void; + set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName }}): void; {% endfor %} {% endif %} @@ -196,12 +196,12 @@ declare module "{{ language.params.npmPackage|caseDash }}" { * {% endif %} {% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} - * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel }} + * @param {{ '{' }}{{ parameter | typeName }}{{ '}' }} {{ parameter.name | caseCamel }} {% endfor %} * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {Promise} */ - {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}): Promise<{% if method.type == 'location' %}Buffer{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}>; + {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}): Promise<{% if method.type == 'location' %}Buffer{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}>; {% endfor %} } {% endfor %} diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 6761cbbef1..955f85cf98 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -13,7 +13,7 @@ class {{ service.name | caseUcfirst }} extends Service { /** * Set {{ parameter.name }}. * - * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} + * @param {{ '{' }}{{ parameter | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} * * @return void */ @@ -24,7 +24,7 @@ class {{ service.name | caseUcfirst }} extends Service { /** * Get {{ parameter.name }}. * - * @return {{ parameter.type | typeName }} + * @return {{ parameter | typeName }} */ get{{ parameter.name | caseUcfirst | escapeKeyword }}() { @@ -50,7 +50,7 @@ class {{ service.name | caseUcfirst }} extends Service { * {% endif %} {% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} - * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} + * @param {{ '{' }}{{ parameter | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {Promise} diff --git a/templates/php/src/Services/Service.php.twig b/templates/php/src/Services/Service.php.twig index 3a40ce33ed..7c78f11c31 100644 --- a/templates/php/src/Services/Service.php.twig +++ b/templates/php/src/Services/Service.php.twig @@ -11,20 +11,20 @@ class {{ service.name | caseUcfirst }} extends Service { {% if service.globalParams | length %} {% for parameter in service.globalParams %} - protected {{ parameter.type | typeName }} ${{ parameter.name | caseCamel | escapeKeyword }}; + protected {{ parameter | typeName }} ${{ parameter.name | caseCamel | escapeKeyword }}; - public function set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}): void + public function set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}): void { $this->{{ parameter.name | caseCamel | escapeKeyword }} = ${{ parameter.name | caseCamel | escapeKeyword }}; } - public function get{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}): {{ parameter.type | typeName }} + public function get{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}): {{ parameter | typeName }} { return $this->{{ parameter.name | caseCamel | escapeKeyword }}; } {% endfor %} - public function __construct(Client $client, {% for parameter in service.globalParams %} {{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + public function __construct(Client $client, {% for parameter in service.globalParams %} {{ parameter | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) { $this->client = $client; {% for parameter in service.globalParams %} @@ -42,13 +42,13 @@ class {{ service.name | caseUcfirst }} extends Service * {% endif %} {% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} - * @param {{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }} + * @param {{ parameter | typeName }}${{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{spec.title | caseUcfirst}}Exception * @return {{ method | getReturn }} */ - public function {{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal ) %}{{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, callable $onProgress = null{% endif %}): {{ method | getReturn }} + public function {{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal ) %}{{ parameter | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, callable $onProgress = null{% endif %}): {{ method | getReturn }} { $path = str_replace([{% for parameter in method.parameters.path %}'{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}'{% if not loop.last %}, {% endif %}{% endfor %}], [{% for parameter in method.parameters.path %}${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}], '{{ method.path }}'); diff --git a/templates/ruby/lib/container/models/model.rb.twig b/templates/ruby/lib/container/models/model.rb.twig index 6cfe64b17f..a60c19df3e 100644 --- a/templates/ruby/lib/container/models/model.rb.twig +++ b/templates/ruby/lib/container/models/model.rb.twig @@ -1,4 +1,4 @@ -{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst}}>{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{{property.type | typeName}}{% endif %}{% endmacro %} +{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst}}>{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{{property | typeName}}{% endif %}{% endmacro %} #frozen_string_literal: true module {{ spec.title | caseUcfirst }} diff --git a/templates/ruby/lib/container/services/service.rb.twig b/templates/ruby/lib/container/services/service.rb.twig index 290ce79622..da4b440cb4 100644 --- a/templates/ruby/lib/container/services/service.rb.twig +++ b/templates/ruby/lib/container/services/service.rb.twig @@ -20,7 +20,7 @@ module {{spec.title | caseUcfirst}} {{ method.description | rubyComment }} # {% for parameter in method.parameters.all %} - # @param [{{ parameter.type | typeName }}] {{ parameter.name | caseSnake | escapeKeyword }} {{ parameter.description }} + # @param [{{ parameter | typeName }}] {{ parameter.name | caseSnake | escapeKeyword }} {{ parameter.description }} {% endfor %} # # @return [{{ method.responseModel | caseUcfirst }}] diff --git a/templates/swift/Sources/Models/Model.swift.twig b/templates/swift/Sources/Models/Model.swift.twig index 74ccc31d44..d9036210f3 100644 --- a/templates/swift/Sources/Models/Model.swift.twig +++ b/templates/swift/Sources/Models/Model.swift.twig @@ -1,4 +1,4 @@ -{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}[{{property.sub_schema | caseUcfirst}}]{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}[String : Any]{% else %}{{property.type | typeName}}{% endif %}{% endif %}{% endmacro %} +{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}[{{property.sub_schema | caseUcfirst}}]{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}[String : Any]{% else %}{{property | typeName}}{% endif %}{% endif %}{% endmacro %} /// {{ definition.description }} public class {{ definition.name | caseUcfirst }} { diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index b5327ab1c9..123631177c 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -12,11 +12,11 @@ import {{spec.title | caseUcfirst}}Models open class {{ service.name | caseUcfirst }}: Service { {% if service.globalParams | length %} {% for parameter in service.globalParams %} - var {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}{% if not parameter.required %}?{% endif %} + var {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName }}{% if not parameter.required %}?{% endif %} {% endfor %} - public init(_ client: Client, {% for parameter in service.globalParams %}_ {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + public init(_ client: Client, {% for parameter in service.globalParams %}_ {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) { {% for parameter in service.globalParams %} self.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }} @@ -34,7 +34,7 @@ open class {{ service.name | caseUcfirst }}: Service { /// {% endif %} {% for parameter in method.parameters.all %} - /// @param {{ parameter.type | typeName | raw}} {{ parameter.name | caseCamel }} + /// @param {{ parameter | typeName | raw}} {{ parameter.name | caseCamel }} {% endfor %} /// @throws Exception /// @return array @@ -44,7 +44,7 @@ open class {{ service.name | caseUcfirst }}: Service { {% endif %} open func {{ method.name | caseCamel }}( {% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} - {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} + {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} {% endfor %} {% if 'multipart/form-data' in method.consumes %} @@ -154,7 +154,7 @@ open class {{ service.name | caseUcfirst }}: Service { /// {% endif %} {% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} - /// @param {{ parameter.type | typeName | raw}} {{ parameter.name | caseCamel }} + /// @param {{ parameter | typeName | raw}} {{ parameter.name | caseCamel }} {% endfor %} /// @throws Exception /// @return array @@ -165,7 +165,7 @@ open class {{ service.name | caseUcfirst }}: Service { {% endif %} open func {{ method.name | caseCamel }}( {% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} - {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}, + {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}, {% endfor %} {% if 'multipart/form-data' in method.consumes %} onProgress: ((UploadProgress) -> Void)? = nil, diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index 4f3fe71085..2537df34f7 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -18,13 +18,13 @@ export class {{ service.name | caseUcfirst }} extends Service { {% endif %} * {% for parameter in method.parameters.all %} - * @param {{ '{' }}{{ parameter.type | getPropertyType(method) | raw }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} + * @param {{ '{' }}{{ parameter | getPropertyType(method) | raw }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {% if method.type == 'webAuth' %}{void|string}{% elseif method.type == 'location' %}{URL}{% else %}{Promise}{% endif %} */ - {% if method.type != 'location' and method.type != 'webAuth'%}async {% endif %}{{ method.name | caseCamel }}{{ method.responseModel | getGenerics(spec) | raw }}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | getPropertyType(method) | raw }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): {{ method | getReturn(spec) | raw }} { + {% if method.type != 'location' and method.type != 'webAuth'%}async {% endif %}{{ method.name | caseCamel }}{{ method.responseModel | getGenerics(spec) | raw }}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter | getPropertyType(method) | raw }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): {{ method | getReturn(spec) | raw }} { {% for parameter in method.parameters.all %} {% if parameter.required %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { From 295f2b95da65bfe7b22ee0600e77309b75cab46c Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 3 Aug 2022 15:50:02 +1200 Subject: [PATCH 191/555] Add formatter --- composer.json | 8 ++++++- composer.lock | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++- phpcs.xml | 22 +++++++++++++++++++ 3 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 phpcs.xml diff --git a/composer.json b/composer.json index 6a66ae8d94..86be3a5960 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,11 @@ "email": "eldad@appwrite.io" } ], + "scripts": { + "test": "vendor/bin/phpunit", + "lint": "vendor/bin/phpcs", + "format": "vendor/bin/phpcbf" + }, "autoload": { "psr-4": { "Appwrite\\SDK\\": "src/SDK", @@ -28,7 +33,8 @@ }, "require-dev": { "phpunit/phpunit": "^9.5.21", - "brianium/paratest": "^6.4" + "brianium/paratest": "^6.4", + "squizlabs/php_codesniffer": "^3.6" }, "minimum-stability": "dev", "prefer-stable": true diff --git a/composer.lock b/composer.lock index d878fe79e5..15cceb9544 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": "2d23d511c41193e87e2bf387370c4082", + "content-hash": "533996af87f893e7dfaa0508e3ee720d", "packages": [ { "name": "matthiasmullie/minify", @@ -2483,6 +2483,62 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.7.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2022-06-18T07:21:10+00:00" + }, { "name": "symfony/console", "version": "v6.1.3", diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000000..209fb3674f --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,22 @@ + + + + + ./src + ./tests + + + + ./tests/sdks + ./tests/languages + ./tests/resources + + + + * + + + + * + + \ No newline at end of file From a782449617203f9a7df98b715184760ac073a713 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 3 Aug 2022 15:51:06 +1200 Subject: [PATCH 192/555] Update to PHP 8 + format --- composer.json | 2 +- composer.lock | 2 +- src/SDK/Language.php | 30 ++--- src/SDK/Language/Android.php | 13 +-- src/SDK/Language/CLI.php | 41 ++----- src/SDK/Language/Dart.php | 86 +++++--------- src/SDK/Language/Deno.php | 11 +- src/SDK/Language/DotNet.php | 47 +++----- src/SDK/Language/Flutter.php | 86 ++++---------- src/SDK/Language/Go.php | 38 +++--- src/SDK/Language/HTTP.php | 48 ++++---- src/SDK/Language/JS.php | 147 ++++++++++++----------- src/SDK/Language/Kotlin.php | 67 +++-------- src/SDK/Language/Node.php | 27 +---- src/SDK/Language/PHP.php | 189 ++++++++++++++---------------- src/SDK/Language/Python.php | 65 +++-------- src/SDK/Language/Ruby.php | 128 +++++++++------------ src/SDK/Language/Swift.php | 66 +++-------- src/SDK/Language/SwiftClient.php | 58 +--------- src/SDK/Language/Web.php | 45 ++------ src/SDK/SDK.php | 192 ++++++++++++++++--------------- src/Spec/Spec.php | 21 ++-- src/Spec/Spec/Service.php | 8 +- src/Spec/Swagger2.php | 43 ++++--- tests/Base.php | 28 +++-- tests/CLINode14Test.php | 2 +- tests/CLINode16Test.php | 2 +- 27 files changed, 590 insertions(+), 902 deletions(-) diff --git a/composer.json b/composer.json index 86be3a5960..1378543461 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "psr-4": {"Tests\\": "tests"} }, "require": { - "php": ">=7.0.0", + "php": ">=8.0", "ext-curl": "*", "ext-mbstring": "*", "ext-json": "*", diff --git a/composer.lock b/composer.lock index 15cceb9544..e48adfdd8b 100644 --- a/composer.lock +++ b/composer.lock @@ -3213,7 +3213,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=7.0.0", + "php": ">=8.0", "ext-curl": "*", "ext-mbstring": "*", "ext-json": "*" diff --git a/src/SDK/Language.php b/src/SDK/Language.php index 3b6ef10c2f..a278a7a6dc 100644 --- a/src/SDK/Language.php +++ b/src/SDK/Language.php @@ -2,8 +2,8 @@ namespace Appwrite\SDK; -abstract class Language { - +abstract class Language +{ const TYPE_INTEGER = 'integer'; const TYPE_NUMBER = 'number'; const TYPE_STRING = 'string'; @@ -20,22 +20,22 @@ abstract class Language { /** * @return string */ - abstract public function getName(); + abstract public function getName(): string; /** - * @return array + * @return array */ - abstract public function getKeywords(); + abstract public function getKeywords(): array; /** - * @return array + * @return array */ - abstract public function getIdentifierOverrides(); + abstract public function getIdentifierOverrides(): array; /** - * @return array + * @return array */ - abstract public function getFiles(); + abstract public function getFiles(): array; /** * @param $type @@ -47,20 +47,20 @@ abstract public function getTypeName($type); * @param array $param * @return string */ - abstract public function getParamDefault(array $param); + abstract public function getParamDefault(array $param): string; /** * @param array $param * @return string */ - abstract public function getParamExample(array $param); + abstract public function getParamExample(array $param): string; /** * @param string $key * @param string $value * @return Language */ - public function setParam($key, $value) + public function setParam(string $key, string $value): Language { $this->params[$key] = $value; @@ -70,17 +70,17 @@ public function setParam($key, $value) /** * @return array */ - public function getParams() + public function getParams(): array { return $this->params; } /** * Language specific filters. - * @return array + * @return array */ public function getFilters(): array { return []; } -} \ No newline at end of file +} diff --git a/src/SDK/Language/Android.php b/src/SDK/Language/Android.php index 7c289c1e44..13d3e06b93 100644 --- a/src/SDK/Language/Android.php +++ b/src/SDK/Language/Android.php @@ -2,13 +2,12 @@ namespace Appwrite\SDK\Language; - -class Android extends Kotlin { - +class Android extends Kotlin +{ /** * @return string */ - public function getName() + public function getName(): string { return 'Android'; } @@ -16,10 +15,10 @@ public function getName() /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ - // Config for root project + // Config for root project [ 'scope' => 'copy', 'destination' => '.github/workflows/publish.yml', @@ -100,7 +99,7 @@ public function getFiles() 'destination' => 'settings.gradle', 'template' => '/android/settings.gradle', ], - // Config for project :library + // Config for project :library [ 'scope' => 'default', 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/Client.kt', diff --git a/src/SDK/Language/CLI.php b/src/SDK/Language/CLI.php index 67a8b0878d..7b301bb7a0 100644 --- a/src/SDK/Language/CLI.php +++ b/src/SDK/Language/CLI.php @@ -4,7 +4,6 @@ class CLI extends Node { - /** * @var array */ @@ -19,7 +18,7 @@ class CLI extends Node * @param string $name * @return $this */ - public function setExecutableName($name) + public function setExecutableName(string $name): CLI { $this->setParam('executableName', $name); @@ -30,7 +29,7 @@ public function setExecutableName($name) * @param string $logo * @return $this */ - public function setLogo($logo) + public function setLogo(string $logo): CLI { $this->setParam('logo', $logo); @@ -41,7 +40,7 @@ public function setLogo($logo) * @param string $logo * @return $this */ - public function setLogoUnescaped($logo) + public function setLogoUnescaped(string $logo): CLI { $this->setParam('logoUnescaped', $logo); @@ -51,7 +50,7 @@ public function setLogoUnescaped($logo) /** * @return string */ - public function getName() + public function getName(): string { return 'cli'; } @@ -59,134 +58,113 @@ public function getName() /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ [ 'scope' => 'default', 'destination' => 'README.md', 'template' => 'cli/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'package.json', 'template' => 'cli/package.json.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'LICENSE.md', 'template' => 'cli/LICENSE.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'install.sh', 'template' => 'cli/install.sh.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'install.ps1', 'template' => 'cli/install.ps1.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'index.js', 'template' => 'cli/index.js.twig', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => 'cli/docs/example.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '.gitignore', 'template' => 'cli/.gitignore', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'Formula/{{ language.params.executableName }}.rb', 'template' => 'cli/Formula/formula.rb.twig', - 'minify' => false, ], [ 'scope' => 'copy', 'destination' => '.github/workflows/npm-publish.yml', 'template' => 'cli/.github/workflows/npm-publish.yml', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/sdks.js', 'template' => 'cli/lib/sdks.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/questions.js', 'template' => 'cli/lib/questions.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/parser.js', 'template' => 'cli/lib/parser.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/exception.js', 'template' => 'cli/lib/exception.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/config.js', 'template' => 'cli/lib/config.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/client.js', 'template' => 'cli/lib/client.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/utils.js', 'template' => 'cli/lib/utils.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/commands/init.js', 'template' => 'cli/lib/commands/init.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/commands/deploy.js', 'template' => 'cli/lib/commands/deploy.js.twig', - 'minify' => false, ], [ 'scope' => 'service', 'destination' => '/lib/commands/{{service.name | caseDash}}.js', 'template' => 'cli/lib/commands/command.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/commands/generic.js', 'template' => 'cli/lib/commands/generic.js.twig', - 'minify' => false, ] ]; } @@ -195,14 +173,14 @@ public function getFiles() * @param array $param * @return string */ - public function getParamExample(array $param) + public function getParamExample(array $param): string { $type = $param['type'] ?? ''; $example = $param['example'] ?? ''; $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -222,11 +200,10 @@ public function getParamExample(array $param) $output .= "'path/to/file.png'"; break; } - } - else { + } else { switch ($type) { case self::TYPE_ARRAY: - if(strpos($example, '[') !== false && strpos($example, ']') !== false) { + if (str_contains($example, '[') && str_contains($example, ']')) { $trimmed = substr($example, 1, -1); $split = explode(',', $trimmed); $output .= implode(' ', $split); diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index f83474de02..2a123301b5 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -5,8 +5,8 @@ use Appwrite\SDK\Language; use Twig\TwigFilter; -class Dart extends Language { - +class Dart extends Language +{ /** * @var array */ @@ -18,7 +18,7 @@ class Dart extends Language { * @param string $name * @return $this */ - public function setPackageName($name) + public function setPackageName(string $name): Dart { $this->setParam('packageName', $name); @@ -28,7 +28,7 @@ public function setPackageName($name) /** * @return string */ - public function getName() + public function getName(): string { return 'Dart'; } @@ -38,7 +38,7 @@ public function getName() * * @return array */ - public function getKeywords() + public function getKeywords(): array { return [ "abstract", @@ -110,7 +110,7 @@ public function getKeywords() /** * @return array */ - public function getIdentifierOverrides() + public function getIdentifierOverrides(): array { return ['Function' => 'Func', 'default' => 'xdefault', 'required' => 'xrequired', 'async' => 'xasync']; } @@ -135,9 +135,9 @@ public function getTypeName($type) return 'bool'; break; case self::TYPE_ARRAY: - return 'List'; - case self::TYPE_OBJECT: - return 'Map'; + return 'List'; + case self::TYPE_OBJECT: + return 'Map'; case self::TYPE_NUMBER: return 'double'; break; @@ -150,19 +150,19 @@ public function getTypeName($type) * @param array $param * @return string */ - public function getParamDefault(array $param) + public function getParamDefault(array $param): string { $type = $param['type'] ?? ''; $default = $param['default'] ?? ''; $required = $param['required'] ?? ''; - if($required) { + if ($required) { return ''; } $output = ' = '; - if(empty($default) && $default !== 0 && $default !== false) { + if (empty($default) && $default !== 0 && $default !== false) { switch ($type) { case self::TYPE_OBJECT: $output .= 'const {}'; @@ -181,8 +181,7 @@ public function getParamDefault(array $param) $output .= "''"; break; } - } - else { + } else { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -190,7 +189,7 @@ public function getParamDefault(array $param) break; case self::TYPE_OBJECT: case self::TYPE_ARRAY: - $output .= 'const '.$default; + $output .= 'const ' . $default; break; case self::TYPE_BOOLEAN: $output .= ($default) ? 'true' : 'false'; @@ -208,14 +207,14 @@ public function getParamDefault(array $param) * @param array $param * @return string */ - public function getParamExample(array $param) + public function getParamExample(array $param): string { $type = $param['type'] ?? ''; $example = $param['example'] ?? ''; $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_FILE: $output .= 'InputFile(path: \'./path-to-files/image.jpg\', filename: \'image.jpg\')'; @@ -223,7 +222,7 @@ public function getParamExample(array $param) case self::TYPE_NUMBER: case self::TYPE_INTEGER: $output .= '0'; - break; + break; case self::TYPE_BOOLEAN: $output .= 'false'; break; @@ -237,8 +236,7 @@ public function getParamExample(array $param) $output .= '[]'; break; } - } - else { + } else { switch ($type) { case self::TYPE_OBJECT: case self::TYPE_FILE: @@ -262,164 +260,140 @@ public function getParamExample(array $param) /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ [ 'scope' => 'default', 'destination' => 'README.md', 'template' => 'dart/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example/README.md', 'template' => 'dart/example/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'CHANGELOG.md', 'template' => 'dart/CHANGELOG.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'LICENSE', 'template' => 'dart/LICENSE.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/client.dart', 'template' => 'dart/lib/src/client.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/client_base.dart', 'template' => 'dart/lib/src/client_base.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/client_browser.dart', 'template' => 'dart/lib/src/client_browser.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/client_io.dart', 'template' => 'dart/lib/src/client_io.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/client_mixin.dart', 'template' => 'dart/lib/src/client_mixin.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/client_stub.dart', 'template' => 'dart/lib/src/client_stub.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/exception.dart', 'template' => 'dart/lib/src/exception.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/upload_progress.dart', 'template' => 'dart/lib/src/upload_progress.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/response.dart', 'template' => 'dart/lib/src/response.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/query.dart', 'template' => 'dart/lib/query.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/{{ language.params.packageName }}.dart', 'template' => 'dart/lib/package.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/pubspec.yaml', 'template' => 'dart/pubspec.yaml.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/client_io.dart', 'template' => 'dart/lib/client_io.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/client_browser.dart', 'template' => 'dart/lib/client_browser.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/service.dart', 'template' => 'dart/lib/src/service.dart.twig', - 'minify' => false, ], [ - 'scope' => 'default', - 'destination' => '/lib/src/enums.dart', - 'template' => 'dart/lib/src/enums.dart.twig', - 'minify' => false, - ], + 'scope' => 'default', + 'destination' => '/lib/src/enums.dart', + 'template' => 'dart/lib/src/enums.dart.twig', + 'minify' => false, + ], [ - 'scope' => 'default', - 'destination' => '/lib/models.dart', - 'template' => 'dart/lib/models.dart.twig', - 'minify' => false, - ], + 'scope' => 'default', + 'destination' => '/lib/models.dart', + 'template' => 'dart/lib/models.dart.twig', + 'minify' => false, + ], [ 'scope' => 'service', 'destination' => '/lib/services/{{service.name | caseDash}}.dart', 'template' => 'dart/lib/services/service.dart.twig', - 'minify' => false, ], [ 'scope' => 'definition', 'destination' => '/lib/src/models/{{definition.name | caseSnake }}.dart', 'template' => 'dart/lib/src/models/model.dart.twig', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => 'dart/docs/example.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '.travis.yml', 'template' => 'dart/.travis.yml.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/src/input_file.dart', 'template' => 'dart/lib/src/input_file.dart.twig', - 'minify' => false, ], ]; } @@ -430,7 +404,7 @@ public function getFilters(): array new TwigFilter('dartComment', function ($value) { $value = explode("\n", $value); foreach ($value as $key => $line) { - $value[$key] = " /// " . wordwrap($value[$key], 75, "\n /// "); + $value[$key] = " /// " . wordwrap($line, 75, "\n /// "); } return implode("\n", $value); }, ['is_safe' => ['html']]), diff --git a/src/SDK/Language/Deno.php b/src/SDK/Language/Deno.php index 31ddbb7a8c..0404ea74c7 100644 --- a/src/SDK/Language/Deno.php +++ b/src/SDK/Language/Deno.php @@ -7,7 +7,7 @@ class Deno extends JS /** * @return string */ - public function getName() + public function getName(): string { return 'Deno'; } @@ -15,7 +15,7 @@ public function getName() /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ [ @@ -127,14 +127,14 @@ public function getTypeName($type) * @param array $param * @return string */ - public function getParamExample(array $param) + public function getParamExample(array $param): string { $type = $param['type'] ?? ''; $example = $param['example'] ?? ''; $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -154,8 +154,7 @@ public function getParamExample(array $param) $output .= "InputFile.fromPath('/path/to/file.png', 'file.png')"; break; } - } - else { + } else { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: diff --git a/src/SDK/Language/DotNet.php b/src/SDK/Language/DotNet.php index 374e9f373c..5aab0c4d1c 100644 --- a/src/SDK/Language/DotNet.php +++ b/src/SDK/Language/DotNet.php @@ -5,12 +5,12 @@ use Appwrite\SDK\Language; use Twig\TwigFilter; -class DotNet extends Language { - +class DotNet extends Language +{ /** * @return string */ - public function getName() + public function getName(): string { return 'DotNet'; } @@ -20,7 +20,7 @@ public function getName() * * @return array */ - public function getKeywords() + public function getKeywords(): array { return [ 'abstract', @@ -136,7 +136,7 @@ public function getKeywords() /** * @return array */ - public function getIdentifierOverrides() + public function getIdentifierOverrides(): array { return [ 'Jwt' => 'JWT' @@ -177,19 +177,19 @@ public function getTypeName($type) * @param array $param * @return string */ - public function getParamDefault(array $param) + public function getParamDefault(array $param): string { $type = $param['type'] ?? ''; $default = $param['default'] ?? ''; $required = $param['required'] ?? ''; - if($required) { + if ($required) { return ''; } $output = ' = '; - if(empty($default) && $default !== 0 && $default !== false) { + if (empty($default) && $default !== 0 && $default !== false) { switch ($type) { case self::TYPE_INTEGER: case self::TYPE_ARRAY: @@ -201,8 +201,7 @@ public function getParamDefault(array $param) $output .= '""'; break; } - } - else { + } else { switch ($type) { case self::TYPE_INTEGER: $output .= $default; @@ -227,14 +226,14 @@ public function getParamDefault(array $param) * @param array $param * @return string */ - public function getParamExample(array $param) + public function getParamExample(array $param): string { $type = $param['type'] ?? ''; $example = $param['example'] ?? ''; $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_FILE: $output .= 'new File("./path-to-files/image.jpg")'; @@ -242,7 +241,7 @@ public function getParamExample(array $param) case self::TYPE_NUMBER: case self::TYPE_INTEGER: $output .= '0'; - break; + break; case self::TYPE_BOOLEAN: $output .= 'false'; break; @@ -256,8 +255,7 @@ public function getParamExample(array $param) $output .= '[List]'; break; } - } - else { + } else { switch ($type) { case self::TYPE_FILE: case self::TYPE_NUMBER: @@ -283,44 +281,38 @@ public function getParamExample(array $param) /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ [ 'scope' => 'default', 'destination' => 'README.md', 'template' => 'dotnet/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'CHANGELOG.md', 'template' => 'dotnet/CHANGELOG.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'LICENSE', 'template' => 'dotnet/LICENSE.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '.travis.yml', 'template' => 'dotnet/.travis.yml.twig', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => 'dotnet/docs/example.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/src/Appwrite.sln', 'template' => 'dotnet/src/Appwrite.sln', - 'minify' => false, ], [ 'scope' => 'copy', @@ -331,49 +323,41 @@ public function getFiles() 'scope' => 'default', 'destination' => '/src/Appwrite/Appwrite.csproj', 'template' => 'dotnet/src/Appwrite/Appwrite.csproj.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Client.cs', 'template' => 'dotnet/src/Appwrite/Client.cs.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Helpers/ExtensionMethods.cs', 'template' => 'dotnet/src/Appwrite/Helpers/ExtensionMethods.cs', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Models/OrderType.cs', 'template' => 'dotnet/src/Appwrite/Models/OrderType.cs.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Models/Rule.cs', 'template' => 'dotnet/src/Appwrite/Models/Rule.cs.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Models/Exception.cs', 'template' => 'dotnet/src/Appwrite/Models/Exception.cs.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Services/Service.cs', 'template' => 'dotnet/src/Appwrite/Services/Service.cs.twig', - 'minify' => false, ], [ 'scope' => 'service', 'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Services/{{service.name | caseUcfirst}}.cs', 'template' => 'dotnet/src/Appwrite/Services/ServiceTemplate.cs.twig', - 'minify' => false, ] ]; } @@ -384,11 +368,10 @@ public function getFilters(): array new TwigFilter('dotnetComment', function ($value) { $value = explode("\n", $value); foreach ($value as $key => $line) { - $value[$key] = " /// " . wordwrap($value[$key], 75, "\n /// "); + $value[$key] = " /// " . wordwrap($line, 75, "\n /// "); } return implode("\n", $value); }, ['is_safe' => ['html']]) ]; } } - diff --git a/src/SDK/Language/Flutter.php b/src/SDK/Language/Flutter.php index b7cd93fdcc..6e5730588d 100644 --- a/src/SDK/Language/Flutter.php +++ b/src/SDK/Language/Flutter.php @@ -2,8 +2,8 @@ namespace Appwrite\SDK\Language; -class Flutter extends Dart { - +class Flutter extends Dart +{ /** * @var array */ @@ -14,7 +14,7 @@ class Flutter extends Dart { /** * @return string */ - public function getName() + public function getName(): string { return 'Flutter'; } @@ -22,260 +22,222 @@ public function getName() /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ [ 'scope' => 'default', 'destination' => 'README.md', 'template' => 'flutter/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example/README.md', 'template' => 'flutter/example/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example/pubspec.yaml', 'template' => 'flutter/example/pubspec.yaml.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'CHANGELOG.md', 'template' => 'flutter/CHANGELOG.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'LICENSE', 'template' => 'flutter/LICENSE.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/client.dart', 'template' => 'flutter/lib/src/client.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/client_base.dart', 'template' => 'flutter/lib/src/client_base.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/client_browser.dart', 'template' => 'flutter/lib/src/client_browser.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/client_io.dart', 'template' => 'flutter/lib/src/client_io.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/client_mixin.dart', 'template' => 'flutter/lib/src/client_mixin.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/client_stub.dart', 'template' => 'flutter/lib/src/client_stub.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/realtime.dart', 'template' => 'flutter/lib/src/realtime.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/realtime_base.dart', 'template' => 'flutter/lib/src/realtime_base.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/realtime_browser.dart', 'template' => 'flutter/lib/src/realtime_browser.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/realtime_io.dart', 'template' => 'flutter/lib/src/realtime_io.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/realtime_mixin.dart', 'template' => 'flutter/lib/src/realtime_mixin.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/realtime_stub.dart', 'template' => 'flutter/lib/src/realtime_stub.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/realtime_subscription.dart', 'template' => 'flutter/lib/src/realtime_subscription.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/realtime_message.dart', 'template' => 'flutter/lib/src/realtime_message.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/realtime_response.dart', 'template' => 'flutter/lib/src/realtime_response.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/realtime_response_connected.dart', 'template' => 'flutter/lib/src/realtime_response_connected.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/cookie_manager.dart', 'template' => 'flutter/lib/src/cookie_manager.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/interceptor.dart', 'template' => 'flutter/lib/src/interceptor.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/response.dart', 'template' => 'flutter/lib/src/response.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/{{ language.params.packageName }}.dart', 'template' => 'flutter/lib/package.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/client_io.dart', 'template' => 'flutter/lib/client_io.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/client_browser.dart', 'template' => 'flutter/lib/client_browser.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/realtime_io.dart', 'template' => 'flutter/lib/realtime_io.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/realtime_browser.dart', 'template' => 'flutter/lib/realtime_browser.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/pubspec.yaml', 'template' => 'flutter/pubspec.yaml.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/service.dart', 'template' => 'flutter/lib/src/service.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/models/model.dart', 'template' => 'flutter/lib/src/models/model_base.dart.twig', - 'minify' => false, ], [ - 'scope' => 'default', - 'destination' => '/lib/src/enums.dart', - 'template' => 'flutter/lib/src/enums.dart.twig', - 'minify' => false, - ], + 'scope' => 'default', + 'destination' => '/lib/src/enums.dart', + 'template' => 'flutter/lib/src/enums.dart.twig', + 'minify' => false, + ], [ - 'scope' => 'default', - 'destination' => '/lib/src/exception.dart', - 'template' => 'flutter/lib/src/exception.dart.twig', - 'minify' => false, - ], + 'scope' => 'default', + 'destination' => '/lib/src/exception.dart', + 'template' => 'flutter/lib/src/exception.dart.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/lib/src/upload_progress.dart', 'template' => 'dart/lib/src/upload_progress.dart.twig', - 'minify' => false, ], [ - 'scope' => 'default', - 'destination' => '/lib/models.dart', - 'template' => 'flutter/lib/models.dart.twig', - 'minify' => false, - ], + 'scope' => 'default', + 'destination' => '/lib/models.dart', + 'template' => 'flutter/lib/models.dart.twig', + 'minify' => false, + ], [ - 'scope' => 'default', - 'destination' => '/lib/query.dart', - 'template' => 'flutter/lib/query.dart.twig', - 'minify' => false, - ], + 'scope' => 'default', + 'destination' => '/lib/query.dart', + 'template' => 'flutter/lib/query.dart.twig', + 'minify' => false, + ], [ 'scope' => 'service', 'destination' => '/lib/services/{{service.name | caseDash}}.dart', 'template' => 'flutter/lib/services/service.dart.twig', - 'minify' => false, ], [ 'scope' => 'definition', 'destination' => '/lib/src/models/{{definition.name | caseSnake }}.dart', 'template' => '/flutter/lib/src/models/model.dart.twig', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => 'flutter/docs/example.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '.travis.yml', 'template' => 'flutter/.travis.yml.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/src/input_file.dart', 'template' => 'flutter/lib/src/input_file.dart.twig', - 'minify' => false, ], ]; } diff --git a/src/SDK/Language/Go.php b/src/SDK/Language/Go.php index d480a3122a..f9725fe821 100644 --- a/src/SDK/Language/Go.php +++ b/src/SDK/Language/Go.php @@ -5,12 +5,12 @@ use Appwrite\SDK\Language; use Twig\TwigFilter; -class Go extends Language { - +class Go extends Language +{ /** * @return string */ - public function getName() + public function getName(): string { return 'Go'; } @@ -20,7 +20,7 @@ public function getName() * * @return array */ - public function getKeywords() + public function getKeywords(): array { return [ 'bool', @@ -47,7 +47,7 @@ public function getKeywords() /** * @return array */ - public function getIdentifierOverrides() + public function getIdentifierOverrides(): array { return []; } @@ -55,56 +55,48 @@ public function getIdentifierOverrides() /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ [ 'scope' => 'default', 'destination' => 'go.mod', 'template' => 'go/go.mod.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'example/main.go', 'template' => 'go/main.go.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'README.md', 'template' => 'go/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'CHANGELOG.md', 'template' => 'go/CHANGELOG.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'LICENSE', 'template' => 'go/LICENSE.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '{{ spec.title | caseLower}}/client.go', 'template' => 'go/client.go.twig', - 'minify' => false, ], [ 'scope' => 'service', 'destination' => '{{ spec.title | caseLower}}/{{service.name | caseDash}}.go', 'template' => 'go/services/service.go.twig', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => 'go/docs/example.md.twig', - 'minify' => false, ], ]; } @@ -139,19 +131,19 @@ public function getTypeName($type) * @param array $param * @return string */ - public function getParamDefault(array $param) + public function getParamDefault(array $param): string { $type = $param['type'] ?? ''; $default = $param['default'] ?? ''; $required = $param['required'] ?? ''; - if($required) { + if ($required) { return ''; } $output = ' = '; - if(empty($default) && $default !== 0 && $default !== false) { + if (empty($default) && $default !== 0 && $default !== false) { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -168,8 +160,7 @@ public function getParamDefault(array $param) $output .= '[]'; break; } - } - else { + } else { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -195,14 +186,14 @@ public function getParamDefault(array $param) * @param array $param * @return string */ - public function getParamExample(array $param) + public function getParamExample(array $param): string { $type = $param['type'] ?? ''; $example = $param['example'] ?? ''; $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -222,8 +213,7 @@ public function getParamExample(array $param) $output .= "file"; break; } - } - else { + } else { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -254,7 +244,7 @@ public function getFilters(): array new TwigFilter('godocComment', function ($value) { $value = explode("\n", $value); foreach ($value as $key => $line) { - $value[$key] = "// " . wordwrap($value[$key], 75, "\n// "); + $value[$key] = "// " . wordwrap($line, 75, "\n// "); } return implode("\n", $value); }, ['is_safe' => ['html']]) diff --git a/src/SDK/Language/HTTP.php b/src/SDK/Language/HTTP.php index fa384484c7..3068af6918 100644 --- a/src/SDK/Language/HTTP.php +++ b/src/SDK/Language/HTTP.php @@ -4,12 +4,12 @@ use Appwrite\SDK\Language; -class HTTP extends Language { - +class HTTP extends Language +{ /** * @return string */ - public function getName() + public function getName(): string { return 'HTTP'; } @@ -19,7 +19,7 @@ public function getName() * * @return array */ - public function getKeywords() + public function getKeywords(): array { return []; } @@ -27,7 +27,7 @@ public function getKeywords() /** * @return array */ - public function getIdentifierOverrides() + public function getIdentifierOverrides(): array { return []; } @@ -52,9 +52,9 @@ public function getTypeName($type) return 'bool'; break; case self::TYPE_ARRAY: - return 'List'; - case self::TYPE_OBJECT: - return 'dynamic'; + return 'List'; + case self::TYPE_OBJECT: + return 'dynamic'; break; } @@ -65,19 +65,19 @@ public function getTypeName($type) * @param array $param * @return string */ - public function getParamDefault(array $param) + public function getParamDefault(array $param): string { $type = $param['type'] ?? ''; $default = $param['default'] ?? ''; $required = $param['required'] ?? ''; - if($required) { + if ($required) { return ''; } $output = ''; - if(empty($default) && $default !== 0 && $default !== false) { + if (empty($default) && $default !== 0 && $default !== false) { switch ($type) { case self::TYPE_OBJECT: $output .= '{}'; @@ -96,22 +96,19 @@ public function getParamDefault(array $param) $output .= '""'; break; } - } - else { + } else { switch ($type) { case self::TYPE_OBJECT: case self::TYPE_NUMBER: - case self::TYPE_INTEGER: - $output .= $default; - break; case self::TYPE_ARRAY: + case self::TYPE_INTEGER: $output .= $default; break; case self::TYPE_BOOLEAN: $output .= ($default) ? 'true' : 'false'; break; case self::TYPE_STRING: - $output .= '"'.$default .'"'; + $output .= '"' . $default . '"'; break; } } @@ -123,14 +120,14 @@ public function getParamDefault(array $param) * @param array $param * @return string */ - public function getParamExample(array $param) + public function getParamExample(array $param): string { $type = $param['type'] ?? ''; $example = $param['example'] ?? ''; $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_FILE: $output .= 'cf 94 84 24 8d c4 91 10 0f dc 54 26 6c 8e 4b bc @@ -139,7 +136,7 @@ public function getParamExample(array $param) case self::TYPE_NUMBER: case self::TYPE_INTEGER: $output .= '0'; - break; + break; case self::TYPE_BOOLEAN: $output .= 'false'; break; @@ -153,22 +150,19 @@ public function getParamExample(array $param) $output .= '[]'; break; } - } - else { + } else { switch ($type) { case self::TYPE_OBJECT: case self::TYPE_FILE: case self::TYPE_NUMBER: case self::TYPE_INTEGER: + case self::TYPE_STRING: case self::TYPE_ARRAY: $output .= $example; break; case self::TYPE_BOOLEAN: $output .= ($example) ? 'true' : 'false'; break; - case self::TYPE_STRING: - $output .= $example; - break; } } @@ -178,16 +172,14 @@ public function getParamExample(array $param) /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}', 'template' => '/http/docs/example.md.twig', - 'minify' => false, ], ]; } } - diff --git a/src/SDK/Language/JS.php b/src/SDK/Language/JS.php index 41ebf28021..9213a51370 100644 --- a/src/SDK/Language/JS.php +++ b/src/SDK/Language/JS.php @@ -4,8 +4,8 @@ use Appwrite\SDK\Language; -abstract class JS extends Language { - +abstract class JS extends Language +{ protected $params = [ 'npmPackage' => 'packageName', 'bowerPackage' => 'packageName', @@ -15,7 +15,7 @@ abstract class JS extends Language { * @param string $name * @return $this */ - public function setNPMPackage($name) + public function setNPMPackage(string $name): JS { $this->setParam('npmPackage', $name); @@ -26,7 +26,7 @@ public function setNPMPackage($name) * @param string $name * @return $this */ - public function setBowerPackage($name) + public function setBowerPackage(string $name): JS { $this->setParam('bowerPackage', $name); @@ -38,80 +38,80 @@ public function setBowerPackage($name) * * @return array */ - public function getKeywords() + public function getKeywords(): array { return [ 'abstract', - 'arguments', - 'await', // new in ECMAScript 5 and 6. - 'boolean', - 'break', - 'byte', - 'case', - 'catch', - 'char', - 'class', // new in ECMAScript 5 and 6. - 'const', - 'continue', - 'debugger', - 'default', - 'delete', - 'do', - 'double', - 'else', - 'enum', // new in ECMAScript 5 and 6. - 'eval', - 'export', // new in ECMAScript 5 and 6. - 'extends', // new in ECMAScript 5 and 6. - 'false', - 'final', - 'finally', - 'float', - 'for', - 'function', - 'goto', - 'if', - 'implements', - 'import', // new in ECMAScript 5 and 6. - 'in', - 'instanceof', - 'int', - 'interface', - 'let', // new in ECMAScript 5 and 6. - 'long', - 'native', - 'new', - 'null', - 'package', - 'private', - 'protected', - 'public', - 'return', - 'short', - 'static', - 'super', // new in ECMAScript 5 and 6. - 'switch', - 'synchronized', - 'this', - 'throw', - 'throws', - 'transient', - 'true', - 'try', - 'typeof', - 'var', - 'void', - 'volatile', - 'while', - 'with', - 'yield', + 'arguments', + 'await', // new in ECMAScript 5 and 6. + 'boolean', + 'break', + 'byte', + 'case', + 'catch', + 'char', + 'class', // new in ECMAScript 5 and 6. + 'const', + 'continue', + 'debugger', + 'default', + 'delete', + 'do', + 'double', + 'else', + 'enum', // new in ECMAScript 5 and 6. + 'eval', + 'export', // new in ECMAScript 5 and 6. + 'extends', // new in ECMAScript 5 and 6. + 'false', + 'final', + 'finally', + 'float', + 'for', + 'function', + 'goto', + 'if', + 'implements', + 'import', // new in ECMAScript 5 and 6. + 'in', + 'instanceof', + 'int', + 'interface', + 'let', // new in ECMAScript 5 and 6. + 'long', + 'native', + 'new', + 'null', + 'package', + 'private', + 'protected', + 'public', + 'return', + 'short', + 'static', + 'super', // new in ECMAScript 5 and 6. + 'switch', + 'synchronized', + 'this', + 'throw', + 'throws', + 'transient', + 'true', + 'try', + 'typeof', + 'var', + 'void', + 'volatile', + 'while', + 'with', + 'yield', ]; } /** * @return array */ - public function getIdentifierOverrides() + public function getIdentifierOverrides(): array { return []; } @@ -141,19 +141,19 @@ public function getTypeName($type) * @param array $param * @return string */ - public function getParamDefault(array $param) + public function getParamDefault(array $param): string { $type = $param['type'] ?? ''; $default = $param['default'] ?? ''; $required = $param['required'] ?? ''; - if($required) { + if ($required) { return ''; } $output = ' = '; - if(empty($default) && $default !== 0 && $default !== false) { + if (empty($default) && $default !== 0 && $default !== false) { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -170,8 +170,7 @@ public function getParamDefault(array $param) $output .= '{}'; break; } - } - else { + } else { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index d00cc30184..52fa20a43b 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -4,12 +4,12 @@ use Appwrite\SDK\Language; -class Kotlin extends Language { - +class Kotlin extends Language +{ /** * @return string */ - public function getName() + public function getName(): string { return 'Kotlin'; } @@ -19,7 +19,7 @@ public function getName() * * @return array */ - public function getKeywords() + public function getKeywords(): array { return [ "abstract", @@ -92,7 +92,7 @@ public function getKeywords() /** * @return array */ - public function getIdentifierOverrides() + public function getIdentifierOverrides(): array { return []; } @@ -115,9 +115,9 @@ public function getTypeName($type) case self::TYPE_BOOLEAN: return 'Boolean'; case self::TYPE_ARRAY: - return 'List'; - case self::TYPE_OBJECT: - return 'Any'; + return 'List'; + case self::TYPE_OBJECT: + return 'Any'; } return $type; @@ -127,19 +127,19 @@ public function getTypeName($type) * @param array $param * @return string */ - public function getParamDefault(array $param) + public function getParamDefault(array $param): string { $type = $param['type'] ?? ''; $default = $param['default'] ?? ''; $required = $param['required'] ?? ''; - if($required) { + if ($required) { return ''; } $output = ' = '; - if(empty($default) && $default !== 0 && $default !== false) { + if (empty($default) && $default !== 0 && $default !== false) { switch ($type) { case self::TYPE_INTEGER: $output .= '-1'; @@ -158,14 +158,13 @@ public function getParamDefault(array $param) $output .= '""'; break; } - } - else { + } else { switch ($type) { case self::TYPE_INTEGER: $output .= $default; break; case self::TYPE_NUMBER: - $output .= sprintf("%.1f",$default);; + $output .= sprintf("%.1f", $default); break; case self::TYPE_BOOLEAN: $output .= ($default) ? 'true' : 'false'; @@ -187,14 +186,14 @@ public function getParamDefault(array $param) * @param array $param * @return string */ - public function getParamExample(array $param) + public function getParamExample(array $param): string { $type = $param['type'] ?? ''; $example = $param['example'] ?? ''; $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_FILE: $output .= 'InputFile.fromPath("file.png")'; @@ -202,7 +201,7 @@ public function getParamExample(array $param) case self::TYPE_NUMBER: case self::TYPE_INTEGER: $output .= '0'; - break; + break; case self::TYPE_BOOLEAN: $output .= 'false'; break; @@ -216,8 +215,7 @@ public function getParamExample(array $param) $output .= 'listOf()'; break; } - } - else { + } else { switch ($type) { case self::TYPE_OBJECT: $output .= 'mapOf( "a" to "b" )'; @@ -243,27 +241,24 @@ public function getParamExample(array $param) /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ - // Config for root project + // Config for root project [ 'scope' => 'copy', 'destination' => '.github/workflows/publish.yml', 'template' => '/kotlin/.github/workflows/publish.yml', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/kotlin/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => '/kotlin/docs/kotlin/example.md.twig', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/java/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => '/kotlin/docs/java/example.md.twig', - 'minify' => false, ], [ 'scope' => 'copy', @@ -274,141 +269,117 @@ public function getFiles() 'scope' => 'copy', 'destination' => 'gradle/wrapper/gradle-wrapper.properties', 'template' => '/kotlin/gradle/wrapper/gradle-wrapper.properties', - 'minify' => false, ], [ 'scope' => 'copy', 'destination' => 'scripts/configure.gradle', 'template' => '/kotlin/scripts/configure.gradle', - 'minify' => false, ], [ 'scope' => 'copy', 'destination' => 'scripts/publish.gradle', 'template' => '/kotlin/scripts/publish.gradle', - 'minify' => false, ], [ 'scope' => 'copy', 'destination' => 'scripts/setup.gradle', 'template' => '/kotlin/scripts/setup.gradle', - 'minify' => false, ], [ 'scope' => 'copy', 'destination' => '.gitignore', 'template' => '/kotlin/.gitignore', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'build.gradle', 'template' => '/kotlin/build.gradle.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'CHANGELOG.md', 'template' => '/kotlin/CHANGELOG.md.twig', - 'minify' => false, ], [ 'scope' => 'copy', 'destination' => 'gradle.properties', 'template' => '/kotlin/gradle.properties', - 'minify' => false, ], [ 'scope' => 'copy', 'destination' => 'gradlew', 'template' => '/kotlin/gradlew', - 'minify' => false, ], [ 'scope' => 'copy', 'destination' => 'gradlew.bat', 'template' => '/kotlin/gradlew.bat', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'LICENSE.md', 'template' => '/kotlin/LICENSE.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'README.md', 'template' => '/kotlin/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'settings.gradle', 'template' => '/kotlin/settings.gradle.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/Client.kt', 'template' => '/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/Query.kt', 'template' => '/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/exceptions/{{spec.title | caseUcfirst}}Exception.kt', 'template' => '/kotlin/src/main/kotlin/io/appwrite/exceptions/Exception.kt.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/extensions/JsonExtensions.kt', 'template' => '/kotlin/src/main/kotlin/io/appwrite/extensions/JsonExtensions.kt.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/json/PreciseNumberAdapter.kt', 'template' => '/kotlin/src/main/kotlin/io/appwrite/json/PreciseNumberAdapter.kt.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/services/Service.kt', 'template' => '/kotlin/src/main/kotlin/io/appwrite/services/Service.kt.twig', - 'minify' => false, ], [ 'scope' => 'service', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/services/{{service.name | caseUcfirst}}.kt', 'template' => '/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/models/InputFile.kt', 'template' => '/kotlin/src/main/kotlin/io/appwrite/models/InputFile.kt.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/models/UploadProgress.kt', 'template' => '/kotlin/src/main/kotlin/io/appwrite/models/UploadProgress.kt.twig', - 'minify' => false, ], [ 'scope' => 'definition', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/models/{{ definition.name | caseUcfirst }}.kt', 'template' => '/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig', - 'minify' => false, ], ]; } } - diff --git a/src/SDK/Language/Node.php b/src/SDK/Language/Node.php index 62f9ea5ffc..a312a02d2e 100644 --- a/src/SDK/Language/Node.php +++ b/src/SDK/Language/Node.php @@ -7,7 +7,7 @@ class Node extends JS /** * @return string */ - public function getName() + public function getName(): string { return 'NodeJS'; } @@ -36,92 +36,78 @@ public function getTypeName($type) /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ [ 'scope' => 'default', 'destination' => 'index.js', 'template' => 'node/index.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'index.d.ts', 'template' => 'node/index.d.ts.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/client.js', 'template' => 'node/lib/client.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/query.js', 'template' => 'node/lib/query.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/inputFile.js', 'template' => 'node/lib/inputFile.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/service.js', 'template' => 'node/lib/service.js.twig', - 'minify' => false, ], [ 'scope' => 'service', 'destination' => '/lib/services/{{service.name | caseDash}}.js', 'template' => 'node/lib/services/service.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'README.md', 'template' => 'node/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'CHANGELOG.md', 'template' => 'node/CHANGELOG.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'LICENSE', 'template' => 'node/LICENSE.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'package.json', 'template' => 'node/package.json.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/exception.js', 'template' => 'node/lib/exception.js.twig', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => 'node/docs/example.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '.travis.yml', 'template' => 'node/.travis.yml.twig', - 'minify' => false, ], ]; } @@ -130,14 +116,14 @@ public function getFiles() * @param array $param * @return string */ - public function getParamExample(array $param) + public function getParamExample(array $param): string { $type = $param['type'] ?? ''; $example = $param['example'] ?? ''; $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -157,8 +143,7 @@ public function getParamExample(array $param) $output .= "InputFile.fromPath('/path/to/file.png', 'file.png')"; break; } - } - else { + } else { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -180,4 +165,4 @@ public function getParamExample(array $param) return $output; } -} \ No newline at end of file +} diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index fd7b94db1d..5fbf02008c 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -5,8 +5,8 @@ use Appwrite\SDK\Language; use Twig\TwigFilter; -class PHP extends Language { - +class PHP extends Language +{ /** * @var array */ @@ -19,7 +19,7 @@ class PHP extends Language { * @param string $name * @return $this */ - public function setComposerVendor($name) + public function setComposerVendor(string $name): PHP { $this->setParam('composerVendor', $name); @@ -30,7 +30,7 @@ public function setComposerVendor($name) * @param string $name * @return $this */ - public function setComposerPackage($name) + public function setComposerPackage(string $name): PHP { $this->setParam('composerPackage', $name); @@ -40,7 +40,7 @@ public function setComposerPackage($name) /** * @return string */ - public function getName() + public function getName(): string { return 'PHP'; } @@ -50,81 +50,81 @@ public function getName() * * @return array */ - public function getKeywords() + public function getKeywords(): array { return [ '__halt_compiler', - 'abstract', - 'and', - 'array', - 'as', - 'break', - 'callable', - 'case', - 'catch', - 'class', - 'clone', - 'const', - 'continue', - 'declare', - 'default', - 'die', - 'do', - 'echo', - 'else', - 'elseif', - 'empty', - 'enddeclare', - 'endfor', - 'endforeach', - 'endif', - 'endswitch', - 'endwhile', - 'eval', - 'exit', - 'extends', - 'final', - 'for', - 'foreach', - 'function', - 'global', - 'goto', - 'if', - 'implements', - 'include', - 'include_once', - 'instanceof', - 'insteadof', - 'interface', - 'isset', - 'list', - 'namespace', - 'new', - 'or', - 'print', - 'private', - 'protected', - 'public', - 'require', - 'require_once', - 'return', - 'static', - 'switch', - 'throw', - 'trait', - 'try', - 'unset', - 'use', - 'var', - 'while', - 'xor' + 'abstract', + 'and', + 'array', + 'as', + 'break', + 'callable', + 'case', + 'catch', + 'class', + 'clone', + 'const', + 'continue', + 'declare', + 'default', + 'die', + 'do', + 'echo', + 'else', + 'elseif', + 'empty', + 'enddeclare', + 'endfor', + 'endforeach', + 'endif', + 'endswitch', + 'endwhile', + 'eval', + 'exit', + 'extends', + 'final', + 'for', + 'foreach', + 'function', + 'global', + 'goto', + 'if', + 'implements', + 'include', + 'include_once', + 'instanceof', + 'insteadof', + 'interface', + 'isset', + 'list', + 'namespace', + 'new', + 'or', + 'print', + 'private', + 'protected', + 'public', + 'require', + 'require_once', + 'return', + 'static', + 'switch', + 'throw', + 'trait', + 'try', + 'unset', + 'use', + 'var', + 'while', + 'xor' ]; } /** * @return array */ - public function getIdentifierOverrides() + public function getIdentifierOverrides(): array { return []; } @@ -132,81 +132,69 @@ public function getIdentifierOverrides() /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ [ 'scope' => 'default', 'destination' => 'README.md', 'template' => 'php/README.md.twig', - 'minify' => false, //'block' => 'default', ], [ 'scope' => 'default', 'destination' => 'CHANGELOG.md', 'template' => 'php/CHANGELOG.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'LICENSE', 'template' => 'php/LICENSE.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'composer.json', 'template' => 'php/composer.json.twig', - 'minify' => false, ], [ 'scope' => 'service', 'destination' => 'docs/{{service.name | caseLower}}.md', 'template' => 'php/docs/service.md.twig', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => 'php/docs/example.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'src/{{ spec.title | caseUcfirst}}/Client.php', 'template' => 'php/src/Client.php.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'src/{{ spec.title | caseUcfirst}}/Query.php', 'template' => 'php/src/Query.php.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'src/{{ spec.title | caseUcfirst}}/InputFile.php', 'template' => 'php/src/InputFile.php.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'src/{{ spec.title | caseUcfirst}}/{{ spec.title | caseUcfirst}}Exception.php', 'template' => 'php/src/Exception.php.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/src/{{ spec.title | caseUcfirst}}/Service.php', 'template' => 'php/src/Service.php.twig', - 'minify' => false, ], [ 'scope' => 'service', 'destination' => '/src/{{ spec.title | caseUcfirst}}/Services/{{service.name | caseUcfirst}}.php', 'template' => 'php/src/Services/Service.php.twig', - 'minify' => false, ], ]; } @@ -240,19 +228,19 @@ public function getTypeName($type) * @param array $param * @return string */ - public function getParamDefault(array $param) + public function getParamDefault(array $param): string { $type = $param['type'] ?? ''; $default = $param['default'] ?? ''; $required = $param['required'] ?? ''; - if($required) { + if ($required) { return ''; } $output = ' = '; - if(empty($default) && $default !== 0 && $default !== false) { + if (empty($default) && $default !== 0 && $default !== false) { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -267,8 +255,7 @@ public function getParamDefault(array $param) $output .= '[]'; break; } - } - else { + } else { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -294,14 +281,14 @@ public function getParamDefault(array $param) * @param array $param * @return string */ - public function getParamExample(array $param) + public function getParamExample(array $param): string { $type = $param['type'] ?? ''; $example = $param['example'] ?? ''; $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -319,8 +306,7 @@ public function getParamExample(array $param) $output .= "InputFile::withPath('file.png')"; break; } - } - else { + } else { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -347,16 +333,16 @@ public function getParamExample(array $param) /** * Converts JSON Object To PHP Native Assoc Array - * + * * @var $data array */ - protected function jsonToAssoc(array $data):string + protected function jsonToAssoc(array $data): string { $output = '['; - - foreach($data as $key => $node) { + + foreach ($data as $key => $node) { $value = (is_array($node)) ? $this->jsonToAssoc($node) : $node; - $output .= '\''.$key.'\' => '.((is_string($node)) ? '\''.$value.'\'' : $value).(($key !== array_key_last($data)) ? ', ' : ''); + $output .= '\'' . $key . '\' => ' . ((is_string($node)) ? '\'' . $value . '\'' : $value) . (($key !== \array_key_last($data)) ? ', ' : ''); } $output .= ']'; @@ -366,16 +352,17 @@ protected function jsonToAssoc(array $data):string protected function getReturn(array $method): string { - if(($method['emptyResponse'] ?? true) || $method['type'] === 'location') { + if (($method['emptyResponse'] ?? true) || $method['type'] === 'location') { return 'string'; } return 'array'; } - public function getFilters(): array { + public function getFilters(): array + { return [ - new TwigFilter('getReturn', function($value) { + new TwigFilter('getReturn', function ($value) { return $this->getReturn($value); }) ]; diff --git a/src/SDK/Language/Python.php b/src/SDK/Language/Python.php index 969aaed88d..e3d03c9d69 100644 --- a/src/SDK/Language/Python.php +++ b/src/SDK/Language/Python.php @@ -5,8 +5,8 @@ use Appwrite\SDK\Language; use Exception; -class Python extends Language { - +class Python extends Language +{ protected $params = [ 'pipPackage' => 'packageName', ]; @@ -15,7 +15,7 @@ class Python extends Language { * @param string $name * @return $this */ - public function setPipPackage($name) + public function setPipPackage(string $name): Python { $this->setParam('pipPackage', $name); @@ -25,7 +25,7 @@ public function setPipPackage($name) /** * @return string */ - public function getName() + public function getName(): string { return 'Python'; } @@ -35,7 +35,7 @@ public function getName() * * @return array */ - public function getKeywords() + public function getKeywords(): array { return [ 'False', @@ -78,7 +78,7 @@ public function getKeywords() /** * @return array */ - public function getIdentifierOverrides() + public function getIdentifierOverrides(): array { return []; } @@ -86,122 +86,88 @@ public function getIdentifierOverrides() /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ [ 'scope' => 'default', 'destination' => 'README.md', 'template' => 'python/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'CHANGELOG.md', 'template' => 'python/CHANGELOG.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'LICENSE', 'template' => 'python/LICENSE.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'setup.py', 'template' => 'python/setup.py.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'setup.cfg', 'template' => 'python/setup.cfg.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'requirements.txt', 'template' => 'python/requirements.txt.twig', - 'minify' => false, - ], - /*[ - 'scope' => 'service', - 'destination' => 'docs/{{service.name | caseSnake}}.md', - 'template' => 'python/docs/service.md.twig', - 'minify' => false, - ], - [ - 'scope' => 'service', - 'destination' => 'docs/{{service.name | caseSnake}}.md', - 'template' => 'python/docs/service.md.twig', - 'minify' => false, ], - [ - 'scope' => 'method', - 'destination' => 'docs/examples/{{service.name | caseSnake}}/{{method.name | caseSnake}}.md', - 'template' => 'python/docs/example.md.twig', - 'minify' => false, - ],*/ [ 'scope' => 'default', 'destination' => '{{ spec.title | caseSnake}}/__init__.py', 'template' => 'python/package/__init__.py.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '{{ spec.title | caseSnake}}/client.py', 'template' => 'python/package/client.py.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '{{ spec.title | caseSnake}}/query.py', 'template' => 'python/package/query.py.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '{{ spec.title | caseSnake}}/exception.py', 'template' => 'python/package/exception.py.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '{{ spec.title | caseSnake}}/input_file.py', 'template' => 'python/package/input_file.py.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '{{ spec.title | caseSnake}}/service.py', 'template' => 'python/package/service.py.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '{{ spec.title | caseSnake}}/services/__init__.py', 'template' => 'python/package/services/__init__.py.twig', - 'minify' => false, ], [ 'scope' => 'service', 'destination' => '{{ spec.title | caseSnake}}/services/{{service.name | caseSnake}}.py', 'template' => 'python/package/services/service.py.twig', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => 'python/docs/example.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '.travis.yml', 'template' => 'python/.travis.yml.twig', - 'minify' => false, ], ]; } @@ -219,19 +185,19 @@ public function getTypeName($type) * @param array $param * @return string */ - public function getParamDefault(array $param) + public function getParamDefault(array $param): string { $type = $param['type'] ?? ''; $default = $param['default'] ?? ''; $required = $param['required'] ?? ''; - if($required) { + if ($required) { return ''; } $output = '='; - if(empty($default) && $default !== 0 && $default !== false) { + if (empty($default) && $default !== 0 && $default !== false) { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -249,8 +215,7 @@ public function getParamDefault(array $param) $output .= '{}'; break; } - } - else { + } else { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -259,7 +224,6 @@ public function getParamDefault(array $param) $output .= $default; break; case self::TYPE_FILE: - #$output .= json_encode($default); $output .= '{}'; break; case self::TYPE_BOOLEAN: @@ -278,14 +242,14 @@ public function getParamDefault(array $param) * @param array $param * @return string */ - public function getParamExample(array $param) + public function getParamExample(array $param): string { $type = $param['type'] ?? ''; $example = $param['example'] ?? ''; $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -305,8 +269,7 @@ public function getParamExample(array $param) $output .= "InputFile.from_path('file.png')"; break; } - } - else { + } else { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: diff --git a/src/SDK/Language/Ruby.php b/src/SDK/Language/Ruby.php index f11c11b8f7..cac4a5f545 100644 --- a/src/SDK/Language/Ruby.php +++ b/src/SDK/Language/Ruby.php @@ -5,8 +5,8 @@ use Appwrite\SDK\Language; use Twig\TwigFilter; -class Ruby extends Language { - +class Ruby extends Language +{ protected $params = [ 'gemPackage' => 'gemName', ]; @@ -15,7 +15,7 @@ class Ruby extends Language { * @param string $name * @return $this */ - public function setGemPackage($name) + public function setGemPackage(string $name): Ruby { $this->setParam('gemPackage', $name); @@ -25,7 +25,7 @@ public function setGemPackage($name) /** * @return string */ - public function getName() + public function getName(): string { return 'Ruby'; } @@ -35,52 +35,52 @@ public function getName() * * @return array */ - public function getKeywords() + public function getKeywords(): array { return [ 'BEGIN', - 'END', - 'alias', - 'and', - 'begin', - 'break', - 'case', - 'class', - 'def', - 'defined?', - 'do', - 'else', - 'module', - 'next', - 'nil', - 'not', - 'or', - 'redo', - 'rescue', - 'retry', - 'return', - 'self', - 'super', - 'then', - 'elsif', - 'end', - 'false', - 'ensure', - 'for', - 'if', - 'true', - 'undef', - 'unless', - 'until', - 'when', - 'while', + 'END', + 'alias', + 'and', + 'begin', + 'break', + 'case', + 'class', + 'def', + 'defined?', + 'do', + 'else', + 'module', + 'next', + 'nil', + 'not', + 'or', + 'redo', + 'rescue', + 'retry', + 'return', + 'self', + 'super', + 'then', + 'elsif', + 'end', + 'false', + 'ensure', + 'for', + 'if', + 'true', + 'undef', + 'unless', + 'until', + 'when', + 'while', ]; } /** * @return array */ - public function getIdentifierOverrides() + public function getIdentifierOverrides(): array { return []; } @@ -88,98 +88,83 @@ public function getIdentifierOverrides() /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ [ 'scope' => 'default', 'destination' => 'README.md', 'template' => 'ruby/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'CHANGELOG.md', 'template' => 'ruby/CHANGELOG.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'LICENSE', 'template' => 'ruby/LICENSE.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'Gemfile', 'template' => 'ruby/Gemfile.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '{{ spec.title | caseDash }}.gemspec', 'template' => 'ruby/gemspec.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/{{ spec.title | caseDash }}.rb', 'template' => 'ruby/lib/container.rb.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/{{ spec.title | caseDash }}/client.rb', 'template' => 'ruby/lib/container/client.rb.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/{{ spec.title | caseDash }}/query.rb', 'template' => 'ruby/lib/container/query.rb.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/{{ spec.title | caseDash }}/service.rb', 'template' => 'ruby/lib/container/service.rb.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/{{ spec.title | caseDash }}/input_file.rb', 'template' => 'ruby/lib/container/input_file.rb.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/{{ spec.title | caseDash }}/exception.rb', 'template' => 'ruby/lib/container/exception.rb.twig', - 'minify' => false, ], [ 'scope' => 'service', 'destination' => '/lib/{{ spec.title | caseDash}}/services/{{service.name | caseDash}}.rb', 'template' => 'ruby/lib/container/services/service.rb.twig', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => 'ruby/docs/example.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '.travis.yml', 'template' => 'ruby/.travis.yml.twig', - 'minify' => false, ], [ 'scope' => 'definition', 'destination' => '/lib/{{ spec.title | caseDash }}/models/{{ definition.name | caseSnake }}.rb', 'template' => 'ruby/lib/container/models/model.rb.twig', - 'minify' => false, ], ]; } @@ -203,19 +188,19 @@ public function getTypeName($type) * @param array $param * @return string */ - public function getParamDefault(array $param) + public function getParamDefault(array $param): string { $type = $param['type'] ?? ''; $default = $param['default'] ?? ''; $required = $param['required'] ?? ''; - if($required) { + if ($required) { return ':'; } $output = ': '; - if(empty($default) && $default !== 0 && $default !== false) { + if (empty($default) && $default !== 0 && $default !== false) { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -232,8 +217,7 @@ public function getParamDefault(array $param) $output .= '{}'; break; } - } - else { + } else { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -257,14 +241,14 @@ public function getParamDefault(array $param) * @param array $param * @return string */ - public function getParamExample(array $param) + public function getParamExample(array $param): string { $type = $param['type'] ?? ''; $example = $param['example'] ?? ''; $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -276,7 +260,7 @@ public function getParamExample(array $param) break; case self::TYPE_ARRAY: $output .= '[]'; - break; + break; case self::TYPE_OBJECT: $output .= '{}'; break; @@ -284,8 +268,7 @@ public function getParamExample(array $param) $output .= "InputFile.from_path('dir/file.png')"; break; } - } - else { + } else { switch ($type) { case self::TYPE_NUMBER: case self::TYPE_INTEGER: @@ -312,16 +295,17 @@ public function getParamExample(array $param) /** * Converts JSON Object To Ruby Native Hash - * + * + * @return string * @var $data array */ - protected function jsonToHash(array $data):string + protected function jsonToHash(array $data): string { $output = '{'; - - foreach($data as $key => $node) { + + foreach ($data as $key => $node) { $value = (is_array($node)) ? $this->jsonToHash($node) : $node; - $output .= '"'.$key.'" => '.((is_string($node)) ? '"'.$value.'"' : $value).(($key !== array_key_last($data)) ? ', ' : ''); + $output .= '"' . $key . '" => ' . ((is_string($node)) ? '"' . $value . '"' : $value) . (($key !== array_key_last($data)) ? ', ' : ''); } $output .= '}'; diff --git a/src/SDK/Language/Swift.php b/src/SDK/Language/Swift.php index 398adc62ff..74b6686f44 100644 --- a/src/SDK/Language/Swift.php +++ b/src/SDK/Language/Swift.php @@ -5,12 +5,12 @@ use Appwrite\SDK\Language; use Twig\TwigFilter; -class Swift extends Language { - +class Swift extends Language +{ /** * @return string */ - public function getName() + public function getName(): string { return 'Swift'; } @@ -20,7 +20,7 @@ public function getName() * * @return array */ - public function getKeywords() + public function getKeywords(): array { return [ "class", @@ -93,7 +93,7 @@ public function getKeywords() /** * @return array */ - public function getIdentifierOverrides() + public function getIdentifierOverrides(): array { return []; } @@ -101,194 +101,163 @@ public function getIdentifierOverrides() /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ [ 'scope' => 'default', 'destination' => 'README.md', 'template' => 'swift/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'CHANGELOG.md', 'template' => 'swift/CHANGELOG.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'LICENSE', 'template' => 'swift/LICENSE.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'Package.swift', 'template' => 'swift/Package.swift.twig', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => 'swift/docs/example.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Tests/{{ spec.title | caseUcfirst}}Tests/Tests.swift', 'template' => 'swift/Tests/Tests.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Client.swift', 'template' => 'swift/Sources/Client.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Models/{{ spec.title | caseUcfirst}}Error.swift', 'template' => '/swift/Sources/Models/Error.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Models/File.swift', 'template' => 'swift/Sources/Models/InputFile.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Models/Query.swift', 'template' => 'swift/Sources/Models/Query.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Models/UploadProgress.swift', 'template' => 'swift/Sources/Models/UploadProgress.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Extensions/Codable+JSON.swift', 'template' => 'swift/Sources/Extensions/Codable+JSON.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Extensions/Cookie+Codable.swift', 'template' => 'swift/Sources/Extensions/Cookie+Codable.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Extensions/HTTPClientRequest+Cookies.swift', 'template' => 'swift/Sources/Extensions/HTTPClientRequest+Cookies.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Extensions/String+MimeTypes.swift', 'template' => 'swift/Sources/Extensions/String+MimeTypes.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/StreamingDelegate.swift', 'template' => 'swift/Sources/StreamingDelegate.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Services/Service.swift', 'template' => 'swift/Sources/Service.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/iOS/iOSDeviceInfo.swift', 'template' => 'swift/Sources/DeviceInfo/iOS/iOSDeviceInfo.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/iOS/UIDevice+ModelName.swift', 'template' => 'swift/Sources/DeviceInfo/iOS/UIDevice+ModelName.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/Linux/LinuxDeviceInfo.swift', 'template' => 'swift/Sources/DeviceInfo/Linux/LinuxDeviceInfo.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/MacOS/MacOSDeviceInfo.swift', 'template' => 'swift/Sources/DeviceInfo/MacOS/MacOSDeviceInfo.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/MacOS/CwlSysCtl.swift', 'template' => 'swift/Sources/DeviceInfo/MacOS/CwlSysCtl.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/Windows/WindowsDeviceInfo.swift', 'template' => 'swift/Sources/DeviceInfo/Windows/WindowsDeviceInfo.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/OSDeviceInfo.swift', 'template' => 'swift/Sources/DeviceInfo/OSDeviceInfo.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/PackageInfo/Apple/PackageInfo+Apple.swift', 'template' => 'swift/Sources/PackageInfo/Apple/PackageInfo+Apple.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/PackageInfo/Linux/PackageInfo+Linux.swift', 'template' => 'swift/Sources/PackageInfo/Linux/PackageInfo+Linux.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/PackageInfo/Windows/PackageInfo+Windows.swift', 'template' => 'swift/Sources/PackageInfo/Windows/PackageInfo+Windows.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/PackageInfo/OSPackageInfo.swift', 'template' => 'swift/Sources/PackageInfo/OSPackageInfo.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/PackageInfo/PackageInfo.swift', 'template' => 'swift/Sources/PackageInfo/PackageInfo.swift', - 'minify' => false, ], [ 'scope' => 'service', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Services/{{service.name | caseUcfirst}}.swift', 'template' => 'swift/Sources/Services/Service.swift.twig', - 'minify' => false, ], [ 'scope' => 'definition', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}Models/{{ definition.name | caseUcfirst }}.swift', 'template' => '/swift/Sources/Models/Model.swift.twig', - 'minify' => false, ], ]; } @@ -311,7 +280,7 @@ public function getTypeName($type) case self::TYPE_BOOLEAN: return 'Bool'; case self::TYPE_ARRAY: - return '[Any]'; + return '[Any]'; case self::TYPE_OBJECT: return 'Any'; } @@ -323,19 +292,19 @@ public function getTypeName($type) * @param array $param * @return string */ - public function getParamDefault(array $param) + public function getParamDefault(array $param): string { $type = $param['type'] ?? ''; $default = $param['default'] ?? ''; $required = $param['required'] ?? ''; - if($required) { + if ($required) { return ''; } $output = ' = '; - if(empty($default) && $default !== 0 && $default !== false) { + if (empty($default) && $default !== 0 && $default !== false) { switch ($type) { case self::TYPE_INTEGER: case self::TYPE_NUMBER: @@ -356,14 +325,13 @@ public function getParamDefault(array $param) default: echo $type; } - } - else { + } else { switch ($type) { case self::TYPE_INTEGER: $output .= $default; break; case self::TYPE_NUMBER: - $output .= sprintf("%.1f",$default); + $output .= sprintf("%.1f", $default); break; case self::TYPE_BOOLEAN: $output .= ($default) ? 'true' : 'false'; @@ -386,14 +354,14 @@ public function getParamDefault(array $param) * @param array $param * @return string */ - public function getParamExample(array $param) + public function getParamExample(array $param): string { $type = $param['type'] ?? ''; $example = $param['example'] ?? ''; $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_FILE: $output .= 'InputFile.fromPath("file.png")'; @@ -414,10 +382,8 @@ public function getParamExample(array $param) case self::TYPE_OBJECT: $output .= '[:]'; break; - } - } - else { + } else { switch ($type) { case self::TYPE_FILE: case self::TYPE_NUMBER: @@ -446,7 +412,7 @@ public function getFilters(): array new TwigFilter('swiftComment', function ($value) { $value = explode("\n", $value); foreach ($value as $key => $line) { - $value[$key] = " /// " . wordwrap($value[$key], 75, "\n /// "); + $value[$key] = " /// " . wordwrap($line, 75, "\n /// "); } return implode("\n", $value); }, ['is_safe' => ['html']]) diff --git a/src/SDK/Language/SwiftClient.php b/src/SDK/Language/SwiftClient.php index f54069c910..08235d0d83 100644 --- a/src/SDK/Language/SwiftClient.php +++ b/src/SDK/Language/SwiftClient.php @@ -2,309 +2,261 @@ namespace Appwrite\SDK\Language; -class SwiftClient extends Swift { - +class SwiftClient extends Swift +{ /** * @return string */ - public function getName() + public function getName(): string { return 'SwiftClient'; } - public function getFiles() + public function getFiles(): array { return \array_merge(parent::getFiles(), [ [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/OAuth/WebAuthComponent.swift', 'template' => '/swift/Sources/OAuth/WebAuthComponent.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/OAuth/View+OAuth.swift', 'template' => '/swift/Sources/OAuth/View+OAuth.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Models/RealtimeModels.swift', 'template' => '/swift/Sources/Models/RealtimeModels.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Services/Realtime.swift', 'template' => '/swift/Sources/Services/Realtime.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/WebSockets/HTTPHandler.swift', 'template' => '/swift/Sources/WebSockets/HTTPHandler.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/WebSockets/MessageHandler.swift', 'template' => '/swift/Sources/WebSockets/MessageHandler.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/WebSockets/WebSocketClient.swift', 'template' => '/swift/Sources/WebSockets/WebSocketClient.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/WebSockets/WebSocketClientDelegate.swift', 'template' => '/swift/Sources/WebSockets/WebSocketClientDelegate.swift.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/WebSockets/WebSocketClientError.swift', 'template' => '/swift/Sources/WebSockets/WebSocketClientError.swift.twig', - 'minify' => false, ], // Config for project example-swiftui [ 'scope' => 'default', 'destination' => '/example-swiftui/iOS/Info.plist', 'template' => '/swift/example-swiftui/iOS/Info.plist', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/iOS/ImagePicker+iOS.swift', 'template' => '/swift/example-swiftui/iOS/ImagePicker+iOS.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/iOS/Keyboard.swift', 'template' => '/swift/example-swiftui/iOS/Keyboard.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/macOS/ImagePicker+macOS.swift', 'template' => '/swift/example-swiftui/macOS/ImagePicker+macOS.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/macOS/Info.plist', 'template' => '/swift/example-swiftui/macOS/Info.plist', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/macOS/macOS.entitlements', 'template' => '/swift/example-swiftui/macOS/macOS.entitlements', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Shared/Assets.xcassets/AccentColor.colorset/Contents.json', 'template' => '/swift/example-swiftui/Shared/Assets.xcassets/AccentColor.colorset/Contents.json', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Shared/Assets.xcassets/AppIcon.appiconset/Contents.json', 'template' => '/swift/example-swiftui/Shared/Assets.xcassets/AppIcon.appiconset/Contents.json', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Shared/Assets.xcassets/Contents.json', 'template' => '/swift/example-swiftui/Shared/Assets.xcassets/Contents.json', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Shared/Image/OSImage.swift', 'template' => '/swift/example-swiftui/Shared/Image/OSImage.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Shared/ExampleApp.swift', 'template' => '/swift/example-swiftui/Shared/ExampleApp.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Shared/ExampleView.swift', 'template' => '/swift/example-swiftui/Shared/ExampleView.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Shared/ExampleViewModel.swift', 'template' => '/swift/example-swiftui/Shared/ExampleViewModel.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Shared/ImagePicker.swift', 'template' => '/swift/example-swiftui/Shared/ImagePicker.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist', 'template' => '/swift/example-swiftui/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Example.xcodeproj/project.pbxproj', 'template' => '/swift/example-swiftui/Example.xcodeproj/project.pbxproj', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata', 'template' => '/swift/example-swiftui/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Tests iOS/Info.plist', 'template' => '/swift/example-swiftui/Tests iOS/Info.plist', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Tests iOS/Tests_iOS.swift', 'template' => '/swift/example-swiftui/Tests iOS/Tests_iOS.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Tests macOS/Info.plist', 'template' => '/swift/example-swiftui/Tests macOS/Info.plist', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-swiftui/Tests macOS/Tests_macOS.swift', 'template' => '/swift/example-swiftui/Tests macOS/Tests_macOS.swift', - 'minify' => false, ], // Config for project example-uikit [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample/Assets.xcassets/AccentColor.colorset/Contents.json', 'template' => '/swift/example-uikit/UIKitExample/Assets.xcassets/AccentColor.colorset/Contents.json', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample/Assets.xcassets/AppIcon.appiconset/Contents.json', 'template' => '/swift/example-uikit/UIKitExample/Assets.xcassets/AppIcon.appiconset/Contents.json', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample/Assets.xcassets/Contents.json', 'template' => '/swift/example-uikit/UIKitExample/Assets.xcassets/Contents.json', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample/Base.lproj/LaunchScreen.storyboard', 'template' => '/swift/example-uikit/UIKitExample/Base.lproj/LaunchScreen.storyboard', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample/Base.lproj/Main.storyboard', 'template' => '/swift/example-uikit/UIKitExample/Base.lproj/Main.storyboard', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample/AppDelegate.swift', 'template' => '/swift/example-uikit/UIKitExample/AppDelegate.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample/ImagePicker.swift', 'template' => '/swift/example-uikit/UIKitExample/ImagePicker.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample/Info.plist', 'template' => '/swift/example-uikit/UIKitExample/Info.plist', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample/SceneDelegate.swift', 'template' => '/swift/example-uikit/UIKitExample/SceneDelegate.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample/ViewController.swift', 'template' => '/swift/example-uikit/UIKitExample/ViewController.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved', 'template' => '/swift/example-uikit/UIKitExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist', 'template' => '/swift/example-uikit/UIKitExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample.xcodeproj/project.pbxproj', 'template' => '/swift/example-uikit/UIKitExample.xcodeproj/project.pbxproj', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata', 'template' => '/swift/example-uikit/UIKitExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExampleTests/Info.plist', 'template' => '/swift/example-uikit/UIKitExampleTests/Info.plist', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExampleTests/UIKitExampleTests.swift', 'template' => '/swift/example-uikit/UIKitExampleTests/UIKitExampleTests.swift', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExampleUITests/Info.plist', 'template' => '/swift/example-uikit/UIKitExampleUITests/Info.plist', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/example-uikit/UIKitExampleUITests/UIKitExampleUITests.swift', 'template' => '/swift/example-uikit/UIKitExampleUITests/UIKitExampleUITests.swift', - 'minify' => false, ], ]); } -} \ No newline at end of file +} diff --git a/src/SDK/Language/Web.php b/src/SDK/Language/Web.php index 4484147782..029b42efcf 100644 --- a/src/SDK/Language/Web.php +++ b/src/SDK/Language/Web.php @@ -4,14 +4,12 @@ use Twig\TwigFilter; - class Web extends JS { - /** * @return string */ - public function getName() + public function getName(): string { return 'Web'; } @@ -19,104 +17,88 @@ public function getName() /** * @return array */ - public function getFiles() + public function getFiles(): array { return [ [ 'scope' => 'default', 'destination' => 'src/index.ts', 'template' => 'web/src/index.ts.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'src/client.ts', 'template' => 'web/src/client.ts.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'src/service.ts', 'template' => 'web/src/service.ts.twig', - 'minify' => false, ], [ 'scope' => 'service', 'destination' => 'src/services/{{service.name | caseDash}}.ts', 'template' => 'web/src/services/template.ts.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'src/models.ts', 'template' => 'web/src/models.ts.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'src/query.ts', 'template' => 'web/src/query.ts.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'README.md', 'template' => 'web/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'CHANGELOG.md', 'template' => 'web/CHANGELOG.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'LICENSE', 'template' => 'web/LICENSE.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'package.json', 'template' => 'web/package.json.twig', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => 'web/docs/example.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'tsconfig.json', 'template' => '/web/tsconfig.json.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'rollup.config.js', 'template' => '/web/rollup.config.js.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'dist/cjs/package.json', 'template' => '/web/dist/cjs/package.json.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'dist/esm/package.json', 'template' => '/web/dist/esm/package.json.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '.travis.yml', 'template' => 'web/.travis.yml.twig', - 'minify' => false, ], ]; } @@ -125,7 +107,7 @@ public function getFiles() * @param array $param * @return string */ - public function getParamExample(array $param) + public function getParamExample(array $param): string { $type = $param['type'] ?? ''; $example = $param['example'] ?? ''; @@ -219,7 +201,7 @@ protected function populateGenerics(string $model, array $spec, array &$generics foreach ($properties as $property) { if (array_key_exists('sub_schema', $property) && $property['sub_schema']) { - $this->populateGenerics($property['sub_schema'], $spec, $generics, false); + $this->populateGenerics($property['sub_schema'], $spec, $generics); } } } @@ -232,7 +214,9 @@ public function getGenerics(string $model, array $spec, bool $skipFirst = false) $this->populateGenerics($model, $spec, $generics, $skipFirst); } - if (empty($generics)) return ''; + if (empty($generics)) { + return ''; + } $generics = array_unique($generics); $generics = array_map(fn ($type) => "{$type} extends Models.{$type}", $generics); @@ -263,9 +247,7 @@ public function getReturn(array $method, array $spec): string $models = []; - if ($method['responseModel']) { - $this->populateGenerics($method['responseModel'], $spec, $models); - } + $this->populateGenerics($method['responseModel'], $spec, $models); $models = array_unique($models); $models = array_filter($models, fn ($model) => $model != $this->toUpperCase($method['responseModel'])); @@ -277,16 +259,13 @@ public function getReturn(array $method, array $spec): string $ret .= '>'; return $ret; - } else { - return 'Promise<{}>'; } - - return ""; + return 'Promise<{}>'; } public function toUpperCase(string $value): string { - return ucfirst((string)$this->helperCamelCase($value)); + return ucfirst($this->helperCamelCase($value)); } protected function helperCamelCase($str) @@ -341,14 +320,14 @@ public function getFilters(): array new TwigFilter('comment2', function ($value) { $value = explode("\n", $value); foreach ($value as $key => $line) { - $value[$key] = " * " . wordwrap($value[$key], 75, "\n * "); + $value[$key] = " * " . wordwrap($line, 75, "\n * "); } return implode("\n", $value); }, ['is_safe' => ['html']]), new TwigFilter('comment3', function ($value) { $value = explode("\n", $value); foreach ($value as $key => $line) { - $value[$key] = " * " . wordwrap($value[$key], 75, "\n * "); + $value[$key] = " * " . wordwrap($line, 75, "\n * "); } return implode("\n", $value); }, ['is_safe' => ['html']]), diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index 436d164464..f4c520daf4 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -4,38 +4,46 @@ use Exception; use Appwrite\Spec\Spec; +use Throwable; use Twig\Environment; +use Twig\Error\LoaderError; +use Twig\Error\RuntimeError; +use Twig\Error\SyntaxError; +use Twig\Extension\DebugExtension; use Twig\Loader\FilesystemLoader; use Twig\TemplateWrapper; use Twig\TwigFilter; use MatthiasMullie\Minify; +use Twig_Error_Loader; +use Twig_Error_Runtime; +use Twig_Error_Syntax; class SDK { /** - * @var Language + * @var Language|null */ - protected $language = null; + protected ?Language $language = null; /** - * @var Spec + * @var Spec|null */ - protected $spec = null; + protected ?Spec $spec = null; /** - * @var Environment + * @var Environment|null */ - protected $twig = null; + protected ?Environment $twig = null; /** * @var array */ - protected $defaultHeaders = []; + protected array $defaultHeaders = []; /** * @var array */ - protected $params = [ + protected array $params = [ 'namespace' => '', 'name' => '', 'description' => '', @@ -74,7 +82,7 @@ public function __construct(Language $language, Spec $spec) $this->twig = new Environment(new FilesystemLoader(__DIR__ . '/../../templates'), [ 'debug' => true - ] ); + ]); /** * Add language specific filters @@ -83,7 +91,7 @@ public function __construct(Language $language, Spec $spec) $this->twig->addFilter($filter); } - $this->twig->addExtension(new \Twig\Extension\DebugExtension()); + $this->twig->addExtension(new DebugExtension()); $this->twig->addFilter(new TwigFilter('caseLower', function ($value) { return strtolower((string)$value); @@ -92,13 +100,13 @@ public function __construct(Language $language, Spec $spec) return strtoupper((string)$value); })); $this->twig->addFilter(new TwigFilter('caseUcfirst', function ($value) { - return ucfirst((string)$this->helperCamelCase($value)); + return ucfirst($this->helperCamelCase($value)); })); $this->twig->addFilter(new TwigFilter('caseLcfirst', function ($value) { return lcfirst((string)$value); })); $this->twig->addFilter(new TwigFilter('caseCamel', function ($value) { - return (string)$this->helperCamelCase($value); + return $this->helperCamelCase($value); })); $this->twig->addFilter(new TwigFilter('caseDash', function ($value) { return str_replace([' ', '_'], '-', strtolower(preg_replace('/([a-zA-Z])(?=[A-Z])/', '$1-', $value))); @@ -137,13 +145,13 @@ public function __construct(Language $language, Spec $spec) $this->twig->addFilter(new TwigFilter('comment1', function ($value) { $value = explode("\n", $value); foreach ($value as $key => $line) { - $value[$key] = " * " . wordwrap($value[$key], 75, "\n * "); + $value[$key] = " * " . wordwrap($line, 75, "\n * "); } return implode("\n", $value); }, ['is_safe' => ['html']])); $this->twig->addFilter(new TwigFilter('escapeDollarSign', function ($value) { return str_replace('$', '\$', $value); - }, ['is_safe'=>['html']])); + }, ['is_safe' => ['html']])); $this->twig->addFilter(new TwigFilter('paramsQuery', function ($value) { $query = ''; @@ -158,7 +166,7 @@ public function __construct(Language $language, Spec $spec) return $value; }, ['is_safe' => ['html']])); $this->twig->addFilter(new TwigFilter('escapeKeyword', function ($value) use ($language) { - if(in_array($value, $language->getKeywords())) { + if (in_array($value, $language->getKeywords())) { return 'x' . $value; } @@ -168,13 +176,13 @@ public function __construct(Language $language, Spec $spec) return $value; }, ['is_safe' => ['html']])); $this->twig->addFilter(new TwigFilter('removeDollarSign', function ($value) { - return str_replace('$','',$value); + return str_replace('$', '', $value); })); $this->twig->addFilter(new TwigFilter('unescape', function ($value) { return html_entity_decode($value); })); $this->twig->addFilter(new TwigFilter('overrideIdentifier', function ($value) use ($language) { - if(isset($language->getIdentifierOverrides()[$value])) { + if (isset($language->getIdentifierOverrides()[$value])) { return $language->getIdentifierOverrides()[$value]; } return $value; @@ -185,9 +193,10 @@ public function __construct(Language $language, Spec $spec) * @param array $headers * @return $this */ - public function setDefaultHeaders($headers) { + public function setDefaultHeaders(array $headers): SDK + { $this->defaultHeaders = $headers; - + return $this; } @@ -195,7 +204,7 @@ public function setDefaultHeaders($headers) { * @param string $text * @return $this */ - public function setNamespace($text) + public function setNamespace(string $text): SDK { $this->setParam('namespace', $text); @@ -206,7 +215,7 @@ public function setNamespace($text) * @param string $text * @return $this */ - public function setName($text) + public function setName(string $text): SDK { $this->setParam('name', $text); @@ -217,7 +226,7 @@ public function setName($text) * @param string $text * @return $this */ - public function setDescription($text) + public function setDescription(string $text): SDK { $this->setParam('description', $text); @@ -225,10 +234,10 @@ public function setDescription($text) } /** - * @param string $name + * @param string $text * @return $this */ - public function setShortDescription($text) + public function setShortDescription(string $text): SDK { $this->setParam('shortDescription', $text); @@ -239,7 +248,7 @@ public function setShortDescription($text) * @param string $text * @return $this */ - public function setVersion($text) + public function setVersion(string $text): SDK { $this->setParam('version', $text); @@ -250,7 +259,7 @@ public function setVersion($text) * @param string $text * @return $this */ - public function setLicense($text) + public function setLicense(string $text): SDK { $this->setParam('license', $text); @@ -261,7 +270,7 @@ public function setLicense($text) * @param string $content * @return $this */ - public function setLicenseContent($content) + public function setLicenseContent(string $content): SDK { $this->setParam('licenseContent', $content); @@ -269,10 +278,10 @@ public function setLicenseContent($content) } /** - * @param $url + * @param string $url * @return $this */ - public function setGitRepo($url) + public function setGitRepo(string $url): SDK { $this->setParam('gitRepo', $url); @@ -280,10 +289,10 @@ public function setGitRepo($url) } /** - * @param $name + * @param string $name * @return $this */ - public function setGitRepoName($name) + public function setGitRepoName(string $name): SDK { $this->setParam('gitRepoName', $name); @@ -291,10 +300,10 @@ public function setGitRepoName($name) } /** - * @param $name + * @param string $name * @return $this */ - public function setGitUserName($name) + public function setGitUserName(string $name): SDK { $this->setParam('gitUserName', $name); @@ -302,10 +311,10 @@ public function setGitUserName($name) } /** - * @param $url + * @param string $url * @return $this */ - public function setGitURL($url) + public function setGitURL(string $url): SDK { $this->setParam('gitURL', $url); @@ -313,10 +322,10 @@ public function setGitURL($url) } /** - * @param $url + * @param string $url * @return $this */ - public function setLogo($url) + public function setLogo(string $url): SDK { $this->setParam('logo', $url); @@ -324,10 +333,10 @@ public function setLogo($url) } /** - * @param $url + * @param string $url * @return $this */ - public function setURL($url) + public function setURL(string $url): SDK { $this->setParam('url', $url); @@ -335,10 +344,10 @@ public function setURL($url) } /** - * @param $text + * @param string $text * @return $this */ - public function setShareText($text) + public function setShareText(string $text): SDK { $this->setParam('shareText', $text); @@ -346,10 +355,10 @@ public function setShareText($text) } /** - * @param $user + * @param string $user * @return $this */ - public function setShareVia($user) + public function setShareVia(string $user): SDK { $this->setParam('shareVia', $user); @@ -357,10 +366,10 @@ public function setShareVia($user) } /** - * @param $url + * @param string $url * @return $this */ - public function setShareURL($url) + public function setShareURL(string $url): SDK { $this->setParam('shareURL', $url); @@ -368,10 +377,10 @@ public function setShareURL($url) } /** - * @param $tags string comma separated list + * @param string $tags Comma separated list * @return $this */ - public function setShareTags($tags) + public function setShareTags(string $tags): SDK { $this->setParam('shareTags', $tags); @@ -379,10 +388,10 @@ public function setShareTags($tags) } /** - * @param $message string + * @param string $message * @return $this */ - public function setWarning($message) + public function setWarning(string $message): SDK { $this->setParam('warning', $message); @@ -393,7 +402,7 @@ public function setWarning($message) * @param $message string * @return $this */ - public function setGettingStarted($message) + public function setGettingStarted(string $message): SDK { $this->setParam('gettingStarted', $message); @@ -401,10 +410,10 @@ public function setGettingStarted($message) } /** - * @param $text string + * @param string $text * @return $this */ - public function setReadme($text) + public function setReadme(string $text): SDK { $this->setParam('readme', $text); @@ -412,10 +421,10 @@ public function setReadme($text) } /** - * @param $text string + * @param string $text * @return $this */ - public function setChangelog($text) + public function setChangelog(string $text): SDK { $this->setParam('changelog', $text); @@ -423,10 +432,10 @@ public function setChangelog($text) } /** - * @param $text string + * @param string $text * @return $this */ - public function setExamples($text) + public function setExamples(string $text): SDK { $this->setParam('examples', $text); @@ -438,7 +447,7 @@ public function setExamples($text) * @param string $url * @return $this */ - public function setDiscord(string $channel, string $url) + public function setDiscord(string $channel, string $url): SDK { $this->setParam('discordChannel', $channel); $this->setParam('discordUrl', $url); @@ -450,7 +459,7 @@ public function setDiscord(string $channel, string $url) * @param string $handle * @return $this */ - public function setTwitter(string $handle) + public function setTwitter(string $handle): SDK { $this->setParam('twitterHandle', $handle); @@ -461,7 +470,7 @@ public function setTwitter(string $handle) * @param string $test * @return $this */ - public function setTest(string $test) + public function setTest(string $test): SDK { $this->setParam('test', $test); @@ -473,7 +482,7 @@ public function setTest(string $test) * @param string $value * @return SDK */ - public function setParam($key, $value) + public function setParam(string $key, string $value): SDK { $this->params[$key] = $value; @@ -481,10 +490,10 @@ public function setParam($key, $value) } /** - * @param $name + * @param string $name * @return string */ - public function getParam($name) + public function getParam(string $name): string { return $this->params[$name] ?? ''; } @@ -492,19 +501,19 @@ public function getParam($name) /** * @return array */ - public function getParams() + public function getParams(): array { return $this->params; } /** - * @param $target - * @throws \Throwable - * @throws \Twig_Error_Loader - * @throws \Twig_Error_Runtime - * @throws \Twig_Error_Syntax + * @param string $target + * @throws Throwable + * @throws LoaderError + * @throws RuntimeError + * @throws SyntaxError */ - public function generate($target) + public function generate(string $target): void { $params = [ 'spec' => [ @@ -514,7 +523,7 @@ public function generate($target) 'version' => $this->spec->getVersion(), 'endpoint' => $this->spec->getEndpoint(), 'host' => parse_url($this->spec->getEndpoint(), PHP_URL_HOST), - 'basePath' => $this->spec->getAttribute('basePath',''), + 'basePath' => $this->spec->getAttribute('basePath', ''), 'licenseName' => $this->spec->getLicenseName(), 'licenseURL' => $this->spec->getLicenseURL(), 'contactName' => $this->spec->getContactName(), @@ -536,12 +545,12 @@ public function generate($target) foreach ($this->language->getFiles() as $file) { if ($file['scope'] != 'copy') { - $template = $this->twig->load($file['template']); /* @var $template \Twig\TemplateWrapper */ + $template = $this->twig->load($file['template']); /* @var $template TemplateWrapper */ } $destination = $target . '/' . $file['destination']; $block = $file['block'] ?? null; $minify = $file['minify'] ?? false; - + switch ($file['scope']) { case 'default': $this->render($template, $destination, $block, $params, $minify); @@ -550,7 +559,7 @@ public function generate($target) if (!file_exists(dirname($destination))) { mkdir(dirname($destination), 0777, true); } - copy(realpath(__DIR__.'/../../templates/' . $file['template']), $destination); + copy(realpath(__DIR__ . '/../../templates/' . $file['template']), $destination); break; case 'service': foreach ($this->spec->getServices() as $key => $service) { @@ -572,7 +581,6 @@ public function generate($target) break; case 'definition': foreach ($this->spec->getDefinitions() as $key => $definition) { - $params['definition'] = $definition; $this->render($template, $destination, $block, $params, $minify); @@ -603,12 +611,13 @@ public function generate($target) } /** + * @param array $methods * @return bool */ - protected function hasUploads($methods):bool + protected function hasUploads(array $methods): bool { - foreach($methods as $method) { - if(isset($method['type']) && $method['type'] === 'upload') { + foreach ($methods as $method) { + if (isset($method['type']) && $method['type'] === 'upload') { return true; } } @@ -617,12 +626,13 @@ protected function hasUploads($methods):bool } /** + * @param array $methods * @return bool */ - protected function hasLocation($methods):bool + protected function hasLocation(array $methods): bool { - foreach($methods as $method) { - if(isset($method['type']) && $method['type'] === 'location') { + foreach ($methods as $method) { + if (isset($method['type']) && $method['type'] === 'location') { return true; } } @@ -631,12 +641,13 @@ protected function hasLocation($methods):bool } /** + * @param array $methods * @return bool */ - protected function hasWebAuth($methods):bool + protected function hasWebAuth(array $methods): bool { - foreach($methods as $method) { - if(isset($method['type']) && $method['type'] === 'webAuth') { + foreach ($methods as $method) { + if (isset($method['type']) && $method['type'] === 'webAuth') { return true; } } @@ -647,15 +658,15 @@ protected function hasWebAuth($methods):bool /** * @param TemplateWrapper $template * @param string $destination - * @param string $block + * @param string|null $block * @param array $params * @param bool $minify * - * @throws \Throwable - * @throws \Twig_Error_Loader - * @throws \Twig_Error_Syntax + * @throws Throwable + * @throws Twig_Error_Loader + * @throws Twig_Error_Syntax */ - protected function render(TemplateWrapper $template, $destination, $block, $params = [], $minify = false) + protected function render(TemplateWrapper $template, string $destination, ?string $block, array $params = [], bool $minify = false): void { $destination = $this->twig->createTemplate($destination); $destination = $destination->render($params); @@ -685,16 +696,15 @@ protected function render(TemplateWrapper $template, $destination, $block, $para break; default: throw new Exception('No minifier found for ' . $ext . ' file'); - break; } } } /** - * @param string $str + * @param string|null $str * @return string */ - protected function helperCamelCase($str): string + protected function helperCamelCase(?string $str): string { if ($str == null) { return ''; diff --git a/src/Spec/Spec.php b/src/Spec/Spec.php index 137b789d78..2511bbe6b9 100644 --- a/src/Spec/Spec.php +++ b/src/Spec/Spec.php @@ -5,8 +5,8 @@ use Exception; use ArrayObject; -abstract class Spec extends ArrayObject { - +abstract class Spec extends ArrayObject +{ const FORMAT_OPEN_API_3 = 'Open API 3'; const FORMAT_SWAGGER_2 = 'Swagger 2'; @@ -23,10 +23,10 @@ public function __construct($input) { if (filter_var($input, FILTER_VALIDATE_URL)) { $data = file_get_contents($input, false, stream_context_create([ - "ssl" => ['verify_peer' => false, 'allow_self_signed'=> true] + "ssl" => ['verify_peer' => false, 'allow_self_signed' => true] ])); - if(!$data) { + if (!$data) { throw new Exception('Can\'t read data from ' . $input); } @@ -35,8 +35,7 @@ public function __construct($input) try { $input = json_decode($input, true); - } - catch (Exception $e) { + } catch (Exception $e) { throw new Exception('Failed to parse spec: ' . $e->getMessage()); } @@ -129,8 +128,8 @@ public function getAttribute($name, $default = null) $temp = &$this; - foreach($name as $key) { - if(!isset($temp[$key])) { + foreach ($name as $key) { + if (!isset($temp[$key])) { return $default; } @@ -147,7 +146,7 @@ public function getAttribute($name, $default = null) * * @param string $key * @param mixed $value - * @param string $type + * @param array $parameter * @return mixed */ public function setAttribute($key, $value, $type = self::SET_TYPE_ASSIGN) @@ -158,7 +157,7 @@ public function setAttribute($key, $value, $type = self::SET_TYPE_ASSIGN) break; case self::SET_TYPE_APPEND: $this[$key] = (!isset($this[$key]) || !is_array($this[$key])) ? [] : $this[$key]; - array_push($this[$key], $value); + $this[$key][] = $value; break; case self::SET_TYPE_PREPEND: $this[$key] = (!isset($this[$key]) || !is_array($this[$key])) ? [] : $this[$key]; @@ -168,4 +167,4 @@ public function setAttribute($key, $value, $type = self::SET_TYPE_ASSIGN) return $this; } -} \ No newline at end of file +} diff --git a/src/Spec/Spec/Service.php b/src/Spec/Spec/Service.php index 184dfff217..c57d0a09fd 100644 --- a/src/Spec/Spec/Service.php +++ b/src/Spec/Spec/Service.php @@ -1,5 +1,9 @@ getAttribute('securityDefinitions', []); $paths = $this->getAttribute('paths', []); @@ -156,13 +156,13 @@ public function getMethods($service) $responses = $method['responses']; $responseModel = ''; $emptyResponse = true; - foreach($responses as $code => $desc) { - if($code != '204') { + foreach ($responses as $code => $desc) { + if ($code != '204') { $emptyResponse = false; } - if(isset($desc['schema']) && isset($desc['schema']['$ref'])) { + if (isset($desc['schema']) && isset($desc['schema']['$ref'])) { $responseModel = $desc['schema']['$ref']; - if(!empty($responseModel)) { + if (!empty($responseModel)) { $responseModel = str_replace('#/definitions/', '', $responseModel); } } @@ -222,7 +222,7 @@ public function getMethods($service) $param['default'] = (is_array($param['default'])) ? json_encode($param['default']) : $param['default']; - if(($parameter['x-global'] ?? false)) { + if (($parameter['x-global'] ?? false)) { $serviceParams[$param['name']] = $param; } @@ -248,7 +248,6 @@ public function getMethods($service) $param['type'] = $value['type'] ?? null; $param['description'] = $value['description'] ?? ''; $param['required'] = (in_array($key, $bodyRequired)); - $param['default'] = $value['default'] ?? null; $param['example'] = $value['x-example'] ?? null; $param['isGlobal'] = $value['x-global'] ?? false; $param['isUploadID'] = $value['x-upload-id'] ?? false; @@ -266,8 +265,6 @@ public function getMethods($service) } continue 2; - - break; } $output['parameters']['all'][] = $param; @@ -297,7 +294,6 @@ public function getGlobalHeaders() $security = $this->getAttribute('securityDefinitions', []); foreach ($security as $key => $definition) { - if (isset($definition['in']) && $definition['in'] === 'header') { $list[] = [ 'key' => $key, @@ -310,38 +306,41 @@ public function getGlobalHeaders() return $list; } - public function getDefinitions() { + public function getDefinitions() + { $list = []; - $definition = $this->getAttribute('definitions',[]); + $definition = $this->getAttribute('definitions', []); foreach ($definition as $key => $schema) { - if($key == 'any') continue; + if ($key == 'any') { + continue; + } $sch = [ "name" => $key, - "properties"=> $schema['properties'] ?? [], - "description"=> $schema['description'] ?? [], + "properties" => $schema['properties'] ?? [], + "description" => $schema['description'] ?? [], "required" => $schema['required'] ?? [], "additionalProperties" => $schema['additionalProperties'] ?? [] ]; - if(isset($sch['properties'])) { - foreach($sch['properties'] as $name => $def) { + if (isset($sch['properties'])) { + foreach ($sch['properties'] as $name => $def) { $sch['properties'][$name]['name'] = $name; $sch['properties'][$name]['description'] = $def['description']; - $sch['properties'][$name]['required'] = in_array($name,$sch['required']); - if(isset($def['items']['$ref'])) { + $sch['properties'][$name]['required'] = in_array($name, $sch['required']); + if (isset($def['items']['$ref'])) { //nested model $sch['properties'][$name]['sub_schema'] = str_replace('#/definitions/', '', $def['items']['$ref']); } - if(isset($def['items']['x-anyOf'])) { + if (isset($def['items']['x-anyOf'])) { //nested model $sch['properties'][$name]['sub_schemas'] = \array_map(fn($schema) => str_replace('#/definitions/', '', $schema['$ref']), $def['items']['x-anyOf']); } - if(isset($def['items']['x-oneOf'])) { + if (isset($def['items']['x-oneOf'])) { //nested model $sch['properties'][$name]['sub_schemas'] = \array_map(fn($schema) => str_replace('#/definitions/', '', $schema['$ref']), $def['items']['x-oneOf']); } - } + } } $list[$key] = $sch; } diff --git a/tests/Base.php b/tests/Base.php index 88f6584c10..445d424f98 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -6,6 +6,9 @@ use Appwrite\SDK\SDK; use Appwrite\Spec\Swagger2; use PHPUnit\Framework\TestCase; +use Twig\Error\LoaderError; +use Twig\Error\RuntimeError; +use Twig\Error\SyntaxError; ini_set('display_errors', 1); ini_set('display_startup_errors', 1); @@ -13,7 +16,6 @@ abstract class Base extends TestCase { - const FOO_RESPONSES = [ 'GET:/v1/mock/tests/foo:passed', 'POST:/v1/mock/tests/foo:passed', @@ -72,6 +74,12 @@ public function tearDown(): void { } + /** + * @throws SyntaxError + * @throws \Throwable + * @throws RuntimeError + * @throws LoaderError + */ public function testHTTPSuccess(): void { $spec = file_get_contents(realpath(__DIR__ . '/resources/spec.json')); @@ -151,19 +159,25 @@ public function testHTTPSuccess(): void } } - private function rmdir_recursive($dir) { + private function rmdir_recursive($dir) + { if (!\is_dir($dir)) { return; } - foreach(\scandir($dir) as $file) { - if ('.' === $file || '..' === $file) continue; - if (\is_dir("$dir/$file")) $this->rmdir_recursive("$dir/$file"); - else \unlink("$dir/$file"); + foreach (\scandir($dir) as $file) { + if ('.' === $file || '..' === $file) { + continue; + } + if (\is_dir("$dir/$file")) { + $this->rmdir_recursive("$dir/$file"); + } else { + \unlink("$dir/$file"); + } } rmdir($dir); } - public function getLanguage(): Language + public function getLanguage(): Language { return new $this->class(); } diff --git a/tests/CLINode14Test.php b/tests/CLINode14Test.php index 934718fbbc..9491ac3975 100644 --- a/tests/CLINode14Test.php +++ b/tests/CLINode14Test.php @@ -47,4 +47,4 @@ public function getLanguage(): Language return $language; } -} \ No newline at end of file +} diff --git a/tests/CLINode16Test.php b/tests/CLINode16Test.php index e495247599..686b5b7ce8 100644 --- a/tests/CLINode16Test.php +++ b/tests/CLINode16Test.php @@ -47,4 +47,4 @@ public function getLanguage(): Language return $language; } -} \ No newline at end of file +} From d79a5d019a1ef86ceedcc832ed40d2f18eed7225 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 3 Aug 2022 04:14:51 +0000 Subject: [PATCH 193/555] remove service params --- composer.lock | 56 +++++++++++++++++++++---------------------- src/Spec/Swagger2.php | 15 ------------ 2 files changed, 28 insertions(+), 43 deletions(-) diff --git a/composer.lock b/composer.lock index b9935887aa..6fdd410b33 100644 --- a/composer.lock +++ b/composer.lock @@ -374,16 +374,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v6.5.1", + "version": "v6.6.1", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9" + "reference": "ae5803ce4558f855c7d955baa2d90b93ec40c4b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9", - "reference": "41fc4cc01422dae2d6bf6a0ce39756f57ac7d8a9", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/ae5803ce4558f855c7d955baa2d90b93ec40c4b7", + "reference": "ae5803ce4558f855c7d955baa2d90b93ec40c4b7", "shasum": "" }, "require": { @@ -398,18 +398,18 @@ "phpunit/php-timer": "^5.0.3", "phpunit/phpunit": "^9.5.21", "sebastian/environment": "^5.1.4", - "symfony/console": "^5.4.9 || ^6.1.1", + "symfony/console": "^5.4.9 || ^6.1.2", "symfony/process": "^5.4.8 || ^6.1.0" }, "require-dev": { "doctrine/coding-standard": "^9.0.0", "ext-pcov": "*", "ext-posix": "*", - "infection/infection": "^0.26.12", + "infection/infection": "^0.26.13", "malukenho/mcbumpface": "^1.1.5", "squizlabs/php_codesniffer": "^3.7.1", "symfony/filesystem": "^5.4.9 || ^6.1.0", - "vimeo/psalm": "^4.23.0" + "vimeo/psalm": "^4.24.0" }, "bin": [ "bin/paratest", @@ -450,7 +450,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v6.5.1" + "source": "https://github.com/paratestphp/paratest/tree/v6.6.1" }, "funding": [ { @@ -462,7 +462,7 @@ "type": "paypal" } ], - "time": "2022-06-24T16:02:27+00:00" + "time": "2022-07-22T14:07:17+00:00" }, { "name": "doctrine/instantiator", @@ -2485,16 +2485,16 @@ }, { "name": "symfony/console", - "version": "v6.1.2", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7" + "reference": "43fcb5c5966b43c56bcfa481368d90d748936ab8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7a86c1c42fbcb69b59768504c7bca1d3767760b7", - "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7", + "url": "https://api.github.com/repos/symfony/console/zipball/43fcb5c5966b43c56bcfa481368d90d748936ab8", + "reference": "43fcb5c5966b43c56bcfa481368d90d748936ab8", "shasum": "" }, "require": { @@ -2561,7 +2561,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.2" + "source": "https://github.com/symfony/console/tree/v6.1.3" }, "funding": [ { @@ -2577,7 +2577,7 @@ "type": "tidelift" } ], - "time": "2022-06-26T13:01:30+00:00" + "time": "2022-07-22T14:17:57+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2813,16 +2813,16 @@ }, { "name": "symfony/process", - "version": "v6.1.0", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "318718453c2be58266f1a9e74063d13cb8dd4165" + "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/318718453c2be58266f1a9e74063d13cb8dd4165", - "reference": "318718453c2be58266f1a9e74063d13cb8dd4165", + "url": "https://api.github.com/repos/symfony/process/zipball/a6506e99cfad7059b1ab5cab395854a0a0c21292", + "reference": "a6506e99cfad7059b1ab5cab395854a0a0c21292", "shasum": "" }, "require": { @@ -2854,7 +2854,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.1.0" + "source": "https://github.com/symfony/process/tree/v6.1.3" }, "funding": [ { @@ -2870,7 +2870,7 @@ "type": "tidelift" } ], - "time": "2022-05-11T12:12:29+00:00" + "time": "2022-06-27T17:24:16+00:00" }, { "name": "symfony/service-contracts", @@ -2959,16 +2959,16 @@ }, { "name": "symfony/string", - "version": "v6.1.2", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "1903f2879875280c5af944625e8246d81c2f0604" + "reference": "f35241f45c30bcd9046af2bb200a7086f70e1d6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/1903f2879875280c5af944625e8246d81c2f0604", - "reference": "1903f2879875280c5af944625e8246d81c2f0604", + "url": "https://api.github.com/repos/symfony/string/zipball/f35241f45c30bcd9046af2bb200a7086f70e1d6b", + "reference": "f35241f45c30bcd9046af2bb200a7086f70e1d6b", "shasum": "" }, "require": { @@ -3024,7 +3024,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.2" + "source": "https://github.com/symfony/string/tree/v6.1.3" }, "funding": [ { @@ -3040,7 +3040,7 @@ "type": "tidelift" } ], - "time": "2022-06-26T16:35:04+00:00" + "time": "2022-07-27T15:50:51+00:00" }, { "name": "theseer/tokenizer", @@ -3163,5 +3163,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } diff --git a/src/Spec/Swagger2.php b/src/Spec/Swagger2.php index 26d5070aa1..28123bf80b 100644 --- a/src/Spec/Swagger2.php +++ b/src/Spec/Swagger2.php @@ -6,11 +6,6 @@ class Swagger2 extends Spec { - /** - * @var array - */ - // private array $serviceParams = []; - /** * @return string */ @@ -112,7 +107,6 @@ public function getServices() $list[$tag] = [ 'name' => $tag, 'methods' => $methods, - // 'globalParams' => $this->serviceParams[$tag] ?? [], ]; } } @@ -138,7 +132,6 @@ public function getServices() public function getMethods($service) { $list = []; - // $serviceParams= []; $security = $this->getAttribute('securityDefinitions', []); $paths = $this->getAttribute('paths', []); @@ -210,7 +203,6 @@ public function getMethods($service) 'default' => $parameter['default'] ?? null, 'example' => $parameter['x-example'] ?? null, 'isUploadID' => $parameter['x-upload-id'] ?? false, - // 'isGlobal' => $parameter['x-global'] ?? false, 'array' => [ 'type' => $parameter['items']['type'] ?? '', ], @@ -222,10 +214,6 @@ public function getMethods($service) $param['default'] = (is_array($param['default'])) ? json_encode($param['default']) : $param['default']; - // if(($parameter['x-global'] ?? false)) { - // $serviceParams[$param['name']] = $param; - // } - switch ($parameter['in']) { case 'header': $output['parameters']['header'][] = $param; @@ -250,7 +238,6 @@ public function getMethods($service) $param['required'] = (in_array($key, $bodyRequired)); $param['default'] = $value['default'] ?? null; $param['example'] = $value['x-example'] ?? null; - // $param['isGlobal'] = $value['x-global'] ?? false; $param['isUploadID'] = $value['x-upload-id'] ?? false; $param['array'] = [ 'type' => $value['items']['type'] ?? '', @@ -282,8 +269,6 @@ public function getMethods($service) } } - // $this->serviceParams[$service] = $serviceParams; - return $list; } From 7f7fe4cd7750966f73c8195abf5cbb8ee58b3fe0 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 3 Aug 2022 04:23:37 +0000 Subject: [PATCH 194/555] service params remove from templates --- .../appwrite/services/ServiceTemplate.kt.twig | 13 -------- templates/dart/lib/services/service.dart.twig | 9 ++--- templates/deno/src/services/service.ts.twig | 21 ++---------- .../flutter/lib/services/service.dart.twig | 7 +--- .../appwrite/services/ServiceTemplate.kt.twig | 13 -------- templates/node/lib/services/service.js.twig | 33 ++----------------- templates/php/src/Services/Service.php.twig | 21 +----------- .../python/package/services/service.py.twig | 8 ----- .../lib/container/services/service.rb.twig | 11 +------ .../swift/Sources/Services/Service.swift.twig | 11 +------ templates/web/src/services/template.ts.twig | 20 ++--------- 11 files changed, 14 insertions(+), 153 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index ab2d8c22d4..d45ff572e5 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -28,20 +28,7 @@ import java.io.File class {{ service.name | caseUcfirst }} : Service { -{% if service.globalParams | length %} -{% for parameter in service.globalParams %} - val {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | overrideIdentifier }}{% if not parameter.required %}?{% endif %} - -{% endfor %} - - public constructor(client: Client,{% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | overrideIdentifier }}{% if not parameter.required %}? = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) : super(client) { -{% for parameter in service.globalParams %} - this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }} -{% endfor %} - } -{% else %} public constructor (client: Client) : super(client) { } -{% endif %} {% for method in service.methods %} /** diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index 31e91adae9..87f4badf91 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -11,14 +11,9 @@ part of {{ language.params.packageName }}; {{ service.description|dartComment}} {% endif %} class {{ service.name | caseUcfirst }} extends Service { - {{ service.name | caseUcfirst }}(super.client{{ _self.service_params(service.globalParams) }}); -{% if service.globalParams | length %} -{% for parameter in service.globalParams %} - {{ parameter.type | typeName }}{% if not parameter.required %}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}; -{% endfor %} -{% endif %} -{% for method in service.methods %} + {{ service.name | caseUcfirst }}(super.client); +{% for method in service.methods %} /// {{ method.title }} {% if method.description %} /// diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index ed0ce24890..b6db5d7891 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -41,27 +41,12 @@ export type UploadProgress = { } export class {{ service.name | caseUcfirst }} extends Service { -{% if service.globalParams | length %} -{% for parameter in service.globalParams %} - protected {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}; - public set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}): void - { - this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; - } - public get{{ parameter.name | caseUcfirst | escapeKeyword }}(): {{ parameter.type | typeName }} - { - return this.{{ parameter.name | caseCamel | escapeKeyword }}; - } -{% endfor %} - constructor(client: Client, {% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}:{{ parameter.type | typeName }}{% if not parameter.required %}|null = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + + constructor(client: Client) { super(client); - -{% for parameter in service.globalParams %} - this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; -{% endfor %} } -{% endif %} + {% for method in service.methods %} {% set generics = _self.get_generics(spec.definitions[method.responseModel], spec, true, true) %} {% set generics_return = _self.get_generics_return(spec.definitions[method.responseModel], spec) %} diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index 5d9a0aab69..13cdcfc7be 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -11,12 +11,7 @@ part of {{ language.params.packageName }}; {{ service.description|dartComment}} {% endif %} class {{ service.name | caseUcfirst }} extends Service { - {{ service.name | caseUcfirst }}(super.client{{ _self.service_params(service.globalParams) }}); -{% if service.globalParams | length %} -{% for parameter in service.globalParams %} - {{ parameter.type | typeName }}{% if not parameter.required %}?{% endif %} {{ parameter.name | caseCamel | overrideIdentifier }}; -{% endfor %} -{% endif %} + {{ service.name | caseUcfirst }}(super.client); {% for method in service.methods %} /// {{ method.title }} diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index cf8997519f..9b7c606a6f 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -26,20 +26,7 @@ import java.io.File class {{ service.name | caseUcfirst }} : Service { -{% if service.globalParams | length %} -{% for parameter in service.globalParams %} - val {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | overrideIdentifier }}{% if not parameter.required %}?{% endif %} - -{% endfor %} - - public constructor(client: Client,{% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | overrideIdentifier }}{% if not parameter.required %}? = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) : super(client) { -{% for parameter in service.globalParams %} - this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }} -{% endfor %} - } -{% else %} public constructor (client: Client) : super(client) { } -{% endif %} {% for method in service.methods %} /** diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index 6761cbbef1..d3d8c03ef5 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -7,39 +7,12 @@ const { promisify } = require('util'); const fs = require('fs'); class {{ service.name | caseUcfirst }} extends Service { -{% if service.globalParams | length %} -{% for parameter in service.globalParams %} - {{ parameter.name | caseCamel | escapeKeyword }}; - /** - * Set {{ parameter.name }}. - * - * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} - * - * @return void - */ - set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}) - { - this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; - } - /** - * Get {{ parameter.name }}. - * - * @return {{ parameter.type | typeName }} - */ - get{{ parameter.name | caseUcfirst | escapeKeyword }}() - { - return this.{{ parameter.name | caseCamel | escapeKeyword }}; - } -{% endfor %} - constructor(client, {% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + + constructor(client) { super(client); - -{% for parameter in service.globalParams %} - this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; -{% endfor %} } -{% endif %} + {% for method in service.methods %} /** diff --git a/templates/php/src/Services/Service.php.twig b/templates/php/src/Services/Service.php.twig index 3a40ce33ed..c8b94762f1 100644 --- a/templates/php/src/Services/Service.php.twig +++ b/templates/php/src/Services/Service.php.twig @@ -9,30 +9,11 @@ use {{ spec.title | caseUcfirst }}\InputFile; class {{ service.name | caseUcfirst }} extends Service { -{% if service.globalParams | length %} -{% for parameter in service.globalParams %} - protected {{ parameter.type | typeName }} ${{ parameter.name | caseCamel | escapeKeyword }}; - - public function set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}): void - { - $this->{{ parameter.name | caseCamel | escapeKeyword }} = ${{ parameter.name | caseCamel | escapeKeyword }}; - } - - public function get{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}): {{ parameter.type | typeName }} - { - return $this->{{ parameter.name | caseCamel | escapeKeyword }}; - } -{% endfor %} - - public function __construct(Client $client, {% for parameter in service.globalParams %} {{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + public function __construct(Client $client) { $this->client = $client; -{% for parameter in service.globalParams %} - $this->{{ parameter.name | caseCamel | escapeKeyword }} = ${{ parameter.name | caseCamel | escapeKeyword }}; -{% endfor %} } -{% endif %} {% for method in service.methods %} /** * {{ method.title }} diff --git a/templates/python/package/services/service.py.twig b/templates/python/package/services/service.py.twig index 3270cea22e..47b6c3077a 100644 --- a/templates/python/package/services/service.py.twig +++ b/templates/python/package/services/service.py.twig @@ -3,16 +3,8 @@ from ..exception import AppwriteException class {{ service.name | caseUcfirst }}(Service): -{% if service.globalParams | length %} - def __init__(self, client,{% for parameter in service.globalParams %} {{ parameter.name | caseSnake | escapeKeyword }}{% if not parameter.required %} = None{% endif %}{% if not loop.last %},{% endif %}{% endfor %}): - super({{ service.name | caseUcfirst }}, self).__init__(client) -{% for parameter in service.globalParams %} - self.{{ parameter.name | caseSnake | escapeKeyword }} = {{ parameter.name | caseSnake | escapeKeyword }} -{% endfor %} -{% else %} def __init__(self, client): super({{ service.name | caseUcfirst }}, self).__init__(client) -{% endif %} {% for method in service.methods %} def {{ method.name | caseSnake }}(self{% if method.parameters.all|length > 0 %}, {% endif %}{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | escapeKeyword | caseSnake }}{% if not parameter.required %} = None{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress = None{% endif %}): diff --git a/templates/ruby/lib/container/services/service.rb.twig b/templates/ruby/lib/container/services/service.rb.twig index 290ce79622..3f4e697123 100644 --- a/templates/ruby/lib/container/services/service.rb.twig +++ b/templates/ruby/lib/container/services/service.rb.twig @@ -3,18 +3,9 @@ module {{spec.title | caseUcfirst}} class {{ service.name | caseUcfirst }} < Service -{% if service.globalParams | length %} -{% for parameter in service.globalParams %} - @{{ parameter.name | caseSnake | escapeKeyword }}{% if not parameter.required %}: nil{% endif %} -{% endfor %} - - def initialize(client, {% for parameter in service.globalParams %}{{ parameter.name | caseSnake | escapeKeyword }}:{% if not parameter.required %} nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + def initialize(client) @client = client -{% for parameter in service.globalParams %} - @{{ parameter.name | caseSnake | escapeKeyword }} = {{ parameter.name | caseSnake | escapeKeyword }} -{% endfor %} end -{% endif %} {% for method in service.methods %} {{ method.description | rubyComment }} diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index b5327ab1c9..d843396b62 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -10,21 +10,12 @@ import NIO import {{spec.title | caseUcfirst}}Models open class {{ service.name | caseUcfirst }}: Service { -{% if service.globalParams | length %} -{% for parameter in service.globalParams %} - var {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}{% if not parameter.required %}?{% endif %} -{% endfor %} - - public init(_ client: Client, {% for parameter in service.globalParams %}_ {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + public init(_ client: client) { -{% for parameter in service.globalParams %} - self.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }} -{% endfor %} super.init(client) } -{% endif %} {% for method in service.methods %} /// /// {{ method.title }} diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index 6f15944953..34ae98cf12 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -8,27 +8,11 @@ type Payload = { } export class {{ service.name | caseUcfirst }} extends Service { -{% if service.globalParams | length %} -{% for parameter in service.globalParams %} - protected {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}; - public set{{ parameter.name | caseUcfirst | escapeKeyword }}({{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName }}): void - { - this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; - } - public get{{ parameter.name | caseUcfirst | escapeKeyword }}(): {{ parameter.type | typeName }} - { - return this.{{ parameter.name | caseCamel | escapeKeyword }}; - } -{% endfor %} - constructor(client: Client, {% for parameter in service.globalParams %} {{ parameter.name | caseCamel | escapeKeyword }}:{{ parameter.type | typeName }}{% if not parameter.required %}|null = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}) + + constructor(client: Client) { super(client); - -{% for parameter in service.globalParams %} - this.{{ parameter.name | caseCamel | escapeKeyword }} = {{ parameter.name | caseCamel | escapeKeyword }}; -{% endfor %} } -{% endif %} {% for method in service.methods %} /** From 76157d9c920f0aae6b7c8146906424d505b8cb61 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 3 Aug 2022 04:33:36 +0000 Subject: [PATCH 195/555] remove global check --- templates/android/docs/java/example.md.twig | 6 +++--- templates/android/docs/kotlin/example.md.twig | 6 +++--- .../io/appwrite/services/ServiceTemplate.kt.twig | 4 ++-- templates/dart/docs/example.md.twig | 4 ++-- templates/dart/lib/services/service.dart.twig | 2 +- templates/deno/docs/example.md.twig | 2 +- templates/deno/src/services/service.ts.twig | 16 ++++++++-------- templates/dotnet/docs/example.md.twig | 2 +- templates/flutter/docs/example.md.twig | 12 ++++++------ templates/flutter/lib/services/service.dart.twig | 2 +- templates/kotlin/docs/java/example.md.twig | 4 ++-- templates/kotlin/docs/kotlin/example.md.twig | 4 ++-- .../io/appwrite/services/ServiceTemplate.kt.twig | 4 ++-- templates/node/base/params.twig | 10 +++++----- templates/node/docs/example.md.twig | 2 +- templates/node/index.d.ts.twig | 4 ++-- templates/node/lib/services/service.js.twig | 6 +++--- templates/php/base/params.twig | 16 ++++++++-------- templates/php/docs/example.md.twig | 2 +- templates/php/docs/service.md.twig | 10 +++++----- templates/php/src/Services/Service.php.twig | 6 +++--- templates/python/base/params.twig | 10 +++++----- templates/python/docs/example.md.twig | 2 +- .../python/package/services/service.py.twig | 2 +- templates/ruby/base/params.twig | 6 +++--- templates/ruby/docs/example.md.twig | 2 +- .../ruby/lib/container/services/service.rb.twig | 2 +- .../swift/Sources/Services/Service.swift.twig | 12 ++++++------ templates/swift/docs/example.md.twig | 4 ++-- templates/web/docs/example.md.twig | 2 +- templates/web/src/services/template.ts.twig | 16 ++++++++-------- 31 files changed, 91 insertions(+), 91 deletions(-) diff --git a/templates/android/docs/java/example.md.twig b/templates/android/docs/java/example.md.twig index 6c53999bdb..7722f903b5 100644 --- a/templates/android/docs/java/example.md.twig +++ b/templates/android/docs/java/example.md.twig @@ -25,9 +25,9 @@ public class MainActivity extends AppCompatActivity { {% endfor %} {% endif %} - {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); + {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client); - {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => not param.isGlobal) | length == 0 %}new Continuation() { + {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}new Continuation() { @NotNull @Override public CoroutineContext getContext() { @@ -56,7 +56,7 @@ public class MainActivity extends AppCompatActivity { {% if method.type == "webAuth" %} this, {% endif %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} {% if parameter.required %} {{ parameter | paramExample }}{% if not loop.last %}, {% endif %} diff --git a/templates/android/docs/kotlin/example.md.twig b/templates/android/docs/kotlin/example.md.twig index b0b8ad8f4c..131d43bc93 100644 --- a/templates/android/docs/kotlin/example.md.twig +++ b/templates/android/docs/kotlin/example.md.twig @@ -23,15 +23,15 @@ class MainActivity : AppCompatActivity() { {% endfor %} {% endif %} - val {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) + val {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client) GlobalScope.launch { -{% if method.type == 'webAuth' %} {% elseif method.type == 'location' %} val result = {% else %} val response = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => not param.isGlobal) | length == 0 %}){% endif %} +{% if method.type == 'webAuth' %} {% elseif method.type == 'location' %} val result = {% else %} val response = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}){% endif %} {% if method.type == "webAuth" %} activity = this@MainActivity, {% endif %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} {% if parameter.required %} {{parameter.name}} = {{ parameter | paramExample }}{% if not loop.last %},{% endif %} diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index d45ff572e5..2eef700969 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -1,6 +1,6 @@ {% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter.type | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} {% macro method_parameters(parameters, consumes) %} -{% if parameters.all|length > 0 %}{% for parameter in parameters.all | filter((param) => not param.isGlobal) %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} +{% if parameters.all|length > 0 %}{% for parameter in parameters.all %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} {% endmacro %} {% macro methodNeedsSecurityParameters(method) %} {% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} @@ -38,7 +38,7 @@ class {{ service.name | caseUcfirst }} : Service { {{ method.description|comment1 }} * {% endif %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} * @param {{ parameter.name | caseCamel }} {{ parameter.description }} {% endfor %} * {% if method.type != "webAuth" %}@return [{{ _self.resultType(sdk.namespace, method) }}]{% endif %} diff --git a/templates/dart/docs/example.md.twig b/templates/dart/docs/example.md.twig index 77e0462c75..f438c7e9c2 100644 --- a/templates/dart/docs/example.md.twig +++ b/templates/dart/docs/example.md.twig @@ -17,14 +17,14 @@ void main() { // Init SDK {% endfor %} ; {% endif %} - Future result = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} + Future result = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %} {% if loop.first %} {% endif %} {% if parameter.required %} {{ parameter.name | caseCamel | overrideIdentifier }}: {{ parameter | paramExample | replace({'': (parameter.name | caseCamel) }) | raw }}, {% endif %} -{% endfor %}{% if method.parameters.all | filter((param) => not param.isGlobal) | length > 0 %} {% endif %}); +{% endfor %}{% if method.parameters.all | length > 0 %} {% endif %}); result .then((response) { diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index 87f4badf91..7b68973390 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -20,7 +20,7 @@ class {{ service.name | caseUcfirst }} extends Service { {{ method.description | dartComment }} /// {% endif %} - {% if method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all | filter((param) => not param.isGlobal), method.consumes) }}) async { + {% if method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all, method.consumes) }}) async { final String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | overrideIdentifier }}){% endfor %}; {% if 'multipart/form-data' in method.consumes %} diff --git a/templates/deno/docs/example.md.twig b/templates/deno/docs/example.md.twig index b18069b2ff..98fb10f194 100644 --- a/templates/deno/docs/example.md.twig +++ b/templates/deno/docs/example.md.twig @@ -19,7 +19,7 @@ client {% endif %} -let promise = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); +let promise = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); promise.then(function (response) { console.log(response); diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index b6db5d7891..7d38705b4b 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -57,14 +57,14 @@ export class {{ service.name | caseUcfirst }} extends Service { {{ method.description|comment1 }} * {% endif %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all%} * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {AppwriteException} * @returns {Promise} */ - async {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): Promise<{% if method.type == 'webAuth' %}Response{% elseif method.type == 'location' %}Response{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}> { -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} + async {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): Promise<{% if method.type == 'webAuth' %}Response{% elseif method.type == 'location' %}Response{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}> { +{% for parameter in method.parameters.all %} {% if parameter.required %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); @@ -72,18 +72,18 @@ export class {{ service.name | caseUcfirst }} extends Service { {% endif %} {% endfor %} - let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name }}{{ '}' }}', {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; + let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; let payload: Payload = {}; {% for parameter in method.parameters.query %} - if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; + if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; } {% endfor %} {% for parameter in method.parameters.body %} - if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; + if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; } {% endfor %} {% if 'multipart/form-data' in method.consumes %} diff --git a/templates/dotnet/docs/example.md.twig b/templates/dotnet/docs/example.md.twig index 533ab5b78a..eb5c4a9020 100644 --- a/templates/dotnet/docs/example.md.twig +++ b/templates/dotnet/docs/example.md.twig @@ -14,4 +14,4 @@ client {% endif %} {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); -{% if method.type == 'location' %}string{% else %}HttpResponseMessage{% endif %} result = await {{ service.name | caseCamel }}.{{ method.name | caseUcfirst }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); +{% if method.type == 'location' %}string{% else %}HttpResponseMessage{% endif %} result = await {{ service.name | caseCamel }}.{{ method.name | caseUcfirst }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); diff --git a/templates/flutter/docs/example.md.twig b/templates/flutter/docs/example.md.twig index 6ae4da7943..44163cffdf 100644 --- a/templates/flutter/docs/example.md.twig +++ b/templates/flutter/docs/example.md.twig @@ -18,14 +18,14 @@ void main() { // Init SDK {% endif %} {% if method.type == 'location' %} // downloading file - Future result = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} + Future result = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %} {% if loop.first %} {% endif %} {% if parameter.required %} {{ parameter.name | caseCamel }}: {{ parameter | paramExample }}, {% endif %} -{% endfor %}{% if method.parameters.all | filter((param) => not param.isGlobal) | length > 0 %} {% endif %}).then((bytes) { +{% endfor %}{% if method.parameters.all | length > 0 %} {% endif %}).then((bytes) { final file = File('path_to_file/filename.ext'); file.writeAsBytesSync(bytes) }).catchError((error) { @@ -35,14 +35,14 @@ void main() { // Init SDK //displaying image preview FutureBuilder( - future: {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} + future: {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %} {% if loop.first %} {% endif %} {% if parameter.required %} {{ parameter.name | caseCamel | overrideIdentifier }}: {{ parameter | paramExample }}, {% endif %} -{% endfor %}{% if method.parameters.all | filter((param) => not param.isGlobal) | length > 0 %} {% endif %} +{% endfor %}{% if method.parameters.all | length > 0 %} {% endif %} ), //works for both public file and private file, for private files you need to be logged in builder: (context, snapshot) { return snapshot.hasData && snapshot.data != null @@ -53,14 +53,14 @@ FutureBuilder( }, ); {% else %} - Future result = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} + Future result = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %} {% if loop.first %} {% endif %} {% if parameter.required %} {{ parameter.name | caseCamel }}: {{ parameter | paramExample }}, {% endif %} -{% endfor %}{% if method.parameters.all | filter((param) => not param.isGlobal) | length > 0 %} {% endif %}); +{% endfor %}{% if method.parameters.all | length > 0 %} {% endif %}); result .then((response) { diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index 13cdcfc7be..4467960dd6 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -20,7 +20,7 @@ class {{ service.name | caseUcfirst }} extends Service { {{ method.description|dartComment }} /// {% endif %} - {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all | filter((param) => not param.isGlobal), method.consumes) }}) async { + {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all, method.consumes) }}) async { {% if method.parameters.path | length > 0 %}final{% else %}const{% endif %} String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | overrideIdentifier }}){% endfor %}; {% if 'multipart/form-data' in method.consumes %} diff --git a/templates/kotlin/docs/java/example.md.twig b/templates/kotlin/docs/java/example.md.twig index 22ffafc277..f91259417f 100644 --- a/templates/kotlin/docs/java/example.md.twig +++ b/templates/kotlin/docs/java/example.md.twig @@ -14,7 +14,7 @@ public void main() { {% endfor %}{% endfor %}{% endif %} {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); - {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => not param.isGlobal) | length == 0 %}new Continuation() { + {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}new Continuation() { @NotNull @Override public CoroutineContext getContext() { @@ -37,7 +37,7 @@ public void main() { } });{% endif %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} {% if parameter.required %} {{parameter.name}} = {{ parameter | paramExample }}{% if not loop.last %},{% endif %} diff --git a/templates/kotlin/docs/kotlin/example.md.twig b/templates/kotlin/docs/kotlin/example.md.twig index 5c35a9fc6d..0d7ecb6ce5 100644 --- a/templates/kotlin/docs/kotlin/example.md.twig +++ b/templates/kotlin/docs/kotlin/example.md.twig @@ -14,9 +14,9 @@ suspend fun main() { {% endfor %}{% endfor %}{% endif %} val {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) -{% if method.type == 'webAuth' %} {% elseif method.type == 'location' %} val result = {% else %} val response = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => not param.isGlobal) | length == 0 %}){% endif %} +{% if method.type == 'webAuth' %} {% elseif method.type == 'location' %} val result = {% else %} val response = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}){% endif %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} {% if parameter.required %} {{parameter.name}} = {{ parameter | paramExample }}{% if not loop.last %},{% endif %} diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index 9b7c606a6f..30ac874525 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -1,6 +1,6 @@ {% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter.type | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} {% macro method_parameters(parameters, consumes) %} -{% if parameters.all|length > 0 %}{% for parameter in parameters.all | filter((param) => not param.isGlobal) %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} +{% if parameters.all|length > 0 %}{% for parameter in parameters.all %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} {% endmacro %} {% macro methodNeedsSecurityParameters(method) %} {% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} @@ -36,7 +36,7 @@ class {{ service.name | caseUcfirst }} : Service { {{ method.description|comment1 }} * {% endif %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} * @param {{ parameter.name | caseCamel }} {{ parameter.description }} {% endfor %} * {% if method.type != "webAuth" %}@return [{{ _self.resultType(sdk.namespace, method) }}]{% endif %} diff --git a/templates/node/base/params.twig b/templates/node/base/params.twig index 610392905f..7ccadfa538 100644 --- a/templates/node/base/params.twig +++ b/templates/node/base/params.twig @@ -1,6 +1,6 @@ let payload = {}; {% if method.parameters.all | length %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} {% if parameter.required %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); @@ -10,14 +10,14 @@ {% endfor %} {% for parameter in method.parameters.query %} - if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; + if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; } {% endfor %} {% for parameter in method.parameters.body %} - if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword}}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; + if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword}}{% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" and parameter.type != "file" ) %}.toString(){% endif %}; } {% endfor %} {% endif %} diff --git a/templates/node/docs/example.md.twig b/templates/node/docs/example.md.twig index d552dc6fb3..33374dd944 100644 --- a/templates/node/docs/example.md.twig +++ b/templates/node/docs/example.md.twig @@ -18,7 +18,7 @@ client {% endfor %}; {% endif %} -const promise = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); +const promise = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); promise.then(function (response) { console.log(response); diff --git a/templates/node/index.d.ts.twig b/templates/node/index.d.ts.twig index fee304ac0e..edc08a3cc0 100644 --- a/templates/node/index.d.ts.twig +++ b/templates/node/index.d.ts.twig @@ -195,13 +195,13 @@ declare module "{{ language.params.npmPackage|caseDash }}" { {{ method.description|comment1 }} * {% endif %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel }} {% endfor %} * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {Promise} */ - {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}): Promise<{% if method.type == 'location' %}Buffer{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}>; + {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}): Promise<{% if method.type == 'location' %}Buffer{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}>; {% endfor %} } {% endfor %} diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index d3d8c03ef5..c599c44743 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -22,14 +22,14 @@ class {{ service.name | caseUcfirst }} extends Service { {{ method.description|comment1 }} * {% endif %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {Promise} */ - async {{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = () => {}{% endif %}) { - let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; + async {{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = () => {}{% endif %}) { + let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; {{ include ('node/base/params.twig')}} {% if 'multipart/form-data' in method.consumes %} {{ include ('node/base/requests/file.twig')}} diff --git a/templates/php/base/params.twig b/templates/php/base/params.twig index 9fac3d03e2..04813d936f 100644 --- a/templates/php/base/params.twig +++ b/templates/php/base/params.twig @@ -1,27 +1,27 @@ $params = []; {% if method.parameters.all | length %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal ) %} +{% for parameter in method.parameters.all %} {% if parameter.required %} - if (!isset(${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }})) { + if (!isset(${{ parameter.name | caseCamel | escapeKeyword }})) { throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); } {% endif %} {% endfor %} {% for parameter in method.parameters.query %} - if (!is_null(${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }})) { - $params['{{ parameter.name }}'] = ${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; + if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { + $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; } {% endfor %} {% for parameter in method.parameters.body %} - if (!is_null(${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }})) { - $params['{{ parameter.name }}'] = ${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; + if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { + $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; } {% endfor %} {% for parameter in method.parameters.formData %} - if (!is_null(${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }})) { - $params['{{ parameter.name }}'] = ${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; + if (!is_null(${{ parameter.name | caseCamel | escapeKeyword }})) { + $params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel | escapeKeyword }}; } {% endfor %} {% endif %} \ No newline at end of file diff --git a/templates/php/docs/example.md.twig b/templates/php/docs/example.md.twig index 64a92dc41d..56a2826b10 100644 --- a/templates/php/docs/example.md.twig +++ b/templates/php/docs/example.md.twig @@ -20,4 +20,4 @@ $client {% endif %} ${{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}($client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); -$result = ${{ service.name | caseCamel }}->{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); \ No newline at end of file +$result = ${{ service.name | caseCamel }}->{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); \ No newline at end of file diff --git a/templates/php/docs/service.md.twig b/templates/php/docs/service.md.twig index b851c82179..6c69c4d4a4 100644 --- a/templates/php/docs/service.md.twig +++ b/templates/php/docs/service.md.twig @@ -11,28 +11,28 @@ ** {{ method.description }} ** {% endif %} -{% if method.parameters.all | filter((param) => not param.isGlobal) is not empty %} +{% if method.parameters.all is not empty %} ### Parameters | Field Name | Type | Description | Default | | --- | --- | --- | --- | {% if method.parameters.path | length > 0 %} -{% for parameter in method.parameters.path | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.path %} | {{ parameter.name }} | {{ parameter.type }} | {% if parameter.required == 1 %}**Required** {% endif %}{{ parameter.description }} | {{ parameter.default }} | {% endfor %} {% endif %} {% if method.parameters.query | length > 0 %} -{% for parameter in method.parameters.query | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.query %} | {{ parameter.name }} | {{ parameter.type }} | {% if parameter.required == 1 %}**Required** {% endif %}{{ parameter.description }} | {{ parameter.default }} | {% endfor %} {% endif %} {% if method.parameters.body | length > 0 %} -{% for parameter in method.parameters.body | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.body %} | {{ parameter.name }} | {{ parameter.type }} | {{ parameter.description }} | {{ parameter.default }} | {% endfor %} {% endif %} {% if method.parameters.formData | length > 0 %} -{% for parameter in method.parameters.formData | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.formData %} | {{ parameter.name }} | {{ parameter.type }} | {{ parameter.description }} | {{ parameter.default }} | {% endfor %} {% endif %} diff --git a/templates/php/src/Services/Service.php.twig b/templates/php/src/Services/Service.php.twig index c8b94762f1..24706fd761 100644 --- a/templates/php/src/Services/Service.php.twig +++ b/templates/php/src/Services/Service.php.twig @@ -22,16 +22,16 @@ class {{ service.name | caseUcfirst }} extends Service {{ method.description|comment1 }} * {% endif %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} * @param {{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{spec.title | caseUcfirst}}Exception * @return {{ method | getReturn }} */ - public function {{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal ) %}{{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, callable $onProgress = null{% endif %}): {{ method | getReturn }} + public function {{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, callable $onProgress = null{% endif %}): {{ method | getReturn }} { - $path = str_replace([{% for parameter in method.parameters.path %}'{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}'{% if not loop.last %}, {% endif %}{% endfor %}], [{% for parameter in method.parameters.path %}${% if parameter.isGlobal %}this->{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}], '{{ method.path }}'); + $path = str_replace([{% for parameter in method.parameters.path %}'{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}'{% if not loop.last %}, {% endif %}{% endfor %}], [{% for parameter in method.parameters.path %}${{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}], '{{ method.path }}'); {{ include('php/base/params.twig') }} {% if 'multipart/form-data' in method.consumes %} diff --git a/templates/python/base/params.twig b/templates/python/base/params.twig index b7d4fb997f..faf595f080 100644 --- a/templates/python/base/params.twig +++ b/templates/python/base/params.twig @@ -2,30 +2,30 @@ {% if method.parameters.all | length %} {% for parameter in method.parameters.all %} {% if parameter.required %} - if {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} is None: + if {{ parameter.name | escapeKeyword | caseSnake }} is None: raise {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | escapeKeyword | caseSnake }}"') {% endif %} {% endfor %} {% for parameter in method.parameters.path %} - path = path.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }}) + path = path.replace('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | escapeKeyword | caseSnake }}) {% endfor %} {% for parameter in method.parameters.query %} - params['{{ parameter.name }}'] = {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} + params['{{ parameter.name }}'] = {{ parameter.name | escapeKeyword | caseSnake }} {% endfor %} {% for parameter in method.parameters.body %} {% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %} params['{{ parameter.name }}'] = str({{ parameter.name | escapeKeyword | caseSnake }}).lower() if type({{ parameter.name | escapeKeyword | caseSnake }}) is bool else {{ parameter.name | escapeKeyword | caseSnake }} {% else %} - params['{{ parameter.name }}'] = {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} + params['{{ parameter.name }}'] = {{ parameter.name | escapeKeyword | caseSnake }} {% endif %} {% endfor %} {% for parameter in method.parameters.formData %} {% if method.consumes[0] == "multipart/form-data" and ( parameter.type != "string" and parameter.type != "array" ) %} params['{{ parameter.name }}'] = str({{ parameter.name | escapeKeyword | caseSnake }}).lower() if type({{ parameter.name | escapeKeyword | caseSnake }}) is bool else {{ parameter.name | escapeKeyword | caseSnake }} {% else %} - params['{{ parameter.name }}'] = {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | escapeKeyword | caseSnake }} + params['{{ parameter.name }}'] = {{ parameter.name | escapeKeyword | caseSnake }} {% endif %} {% endfor %} {% endif %} \ No newline at end of file diff --git a/templates/python/docs/example.md.twig b/templates/python/docs/example.md.twig index 328789969c..aa22527d80 100644 --- a/templates/python/docs/example.md.twig +++ b/templates/python/docs/example.md.twig @@ -18,4 +18,4 @@ client = Client() {% endif %} {{ service.name | caseSnake }} = {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) -result = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}) +result = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}) diff --git a/templates/python/package/services/service.py.twig b/templates/python/package/services/service.py.twig index 47b6c3077a..df665f003b 100644 --- a/templates/python/package/services/service.py.twig +++ b/templates/python/package/services/service.py.twig @@ -7,7 +7,7 @@ class {{ service.name | caseUcfirst }}(Service): super({{ service.name | caseUcfirst }}, self).__init__(client) {% for method in service.methods %} - def {{ method.name | caseSnake }}(self{% if method.parameters.all|length > 0 %}, {% endif %}{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | escapeKeyword | caseSnake }}{% if not parameter.required %} = None{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress = None{% endif %}): + def {{ method.name | caseSnake }}(self{% if method.parameters.all|length > 0 %}, {% endif %}{% for parameter in method.parameters.all %}{{ parameter.name | escapeKeyword | caseSnake }}{% if not parameter.required %} = None{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress = None{% endif %}): {% if method.title %} """{{ method.title }}""" diff --git a/templates/ruby/base/params.twig b/templates/ruby/base/params.twig index 92afa831b3..81b8863983 100644 --- a/templates/ruby/base/params.twig +++ b/templates/ruby/base/params.twig @@ -1,6 +1,6 @@ params = { {% for parameter in method.parameters.query | merge(method.parameters.body) %} - {{ parameter.name }}: {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}, + {{ parameter.name }}: {{ parameter.name | caseSnake | escapeKeyword }}, {% endfor %} } @@ -15,13 +15,13 @@ {% if method.parameters.all | length %} {% for parameter in method.parameters.all %} {% if parameter.required %} - if {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}.nil? + if {{ parameter.name | caseSnake | escapeKeyword }}.nil? raise {{spec.title | caseUcfirst}}::Exception.new('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"') end {% endif %} {% endfor %} {% for parameter in method.parameters.path %} - .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {% if parameter.isGlobal %}@{% endif %}{{ parameter.name | caseSnake | escapeKeyword }}) + .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {{ parameter.name | caseSnake | escapeKeyword }}) {% endfor %} {% endif %} \ No newline at end of file diff --git a/templates/ruby/docs/example.md.twig b/templates/ruby/docs/example.md.twig index 113a4bd8c3..341b590223 100644 --- a/templates/ruby/docs/example.md.twig +++ b/templates/ruby/docs/example.md.twig @@ -15,6 +15,6 @@ client {{ service.name | caseSnake }} = {{spec.title | caseUcfirst}}::{{ service.name | caseUcfirst }}.new(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{parameter.name | caseSnake}}:{{ parameter | paramExample }}{% endfor %}{% endif %}) -response = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{parameter.name|caseSnake}}: {% if parameter.type == 'file' %}{{spec.title | caseUcfirst}}::{{ parameter | paramExample }}{% else %}{{ parameter | paramExample }}{% endif %}{% endif %}{% endfor %}) +response = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{parameter.name|caseSnake}}: {% if parameter.type == 'file' %}{{spec.title | caseUcfirst}}::{{ parameter | paramExample }}{% else %}{{ parameter | paramExample }}{% endif %}{% endif %}{% endfor %}) puts response.inspect \ No newline at end of file diff --git a/templates/ruby/lib/container/services/service.rb.twig b/templates/ruby/lib/container/services/service.rb.twig index 3f4e697123..6f707c7c9c 100644 --- a/templates/ruby/lib/container/services/service.rb.twig +++ b/templates/ruby/lib/container/services/service.rb.twig @@ -15,7 +15,7 @@ module {{spec.title | caseUcfirst}} {% endfor %} # # @return [{{ method.responseModel | caseUcfirst }}] - def {{ method.name | caseSnake }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseSnake | escapeKeyword }}:{% if not parameter.required %} nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress: nil{% endif %}) + def {{ method.name | caseSnake }}({% for parameter in method.parameters.all %}{{ parameter.name | caseSnake | escapeKeyword }}:{% if not parameter.required %} nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress: nil{% endif %}) path = '{{ method.path }}' diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index d843396b62..378e9ff80c 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -34,7 +34,7 @@ open class {{ service.name | caseUcfirst }}: Service { @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) {% endif %} open func {{ method.name | caseCamel }}( -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} {% endfor %} @@ -46,7 +46,7 @@ open class {{ service.name | caseUcfirst }}: Service { {% for parameter in method.parameters.path %} path = path.replacingOccurrences( of: "{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}", - with: {% if method.parameters.path %}{% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% else %}""{% endif %} + with: {% if method.parameters.path %}{{ parameter.name | caseCamel | escapeKeyword }}{% else %}""{% endif %} ) {% endfor %} @@ -56,7 +56,7 @@ open class {{ service.name | caseUcfirst }}: Service { let params: [String: Any?] = [:] {% endif %} {% for parameter in method.parameters.query | merge(method.parameters.body) %} - "{{ parameter.name }}": {% if parameter.isGlobal %}self.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last or _self.methodNeedsSecurityParameters(method) %},{% endif %} + "{{ parameter.name }}": {{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last or _self.methodNeedsSecurityParameters(method) %},{% endif %} {% endfor %} {% if _self.methodNeedsSecurityParameters(method) %} @@ -144,7 +144,7 @@ open class {{ service.name | caseUcfirst }}: Service { {{ method.description | swiftComment }} /// {% endif %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} /// @param {{ parameter.type | typeName | raw}} {{ parameter.name | caseCamel }} {% endfor %} /// @throws Exception @@ -155,7 +155,7 @@ open class {{ service.name | caseUcfirst }}: Service { @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) {% endif %} open func {{ method.name | caseCamel }}( -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}, {% endfor %} {% if 'multipart/form-data' in method.consumes %} @@ -166,7 +166,7 @@ open class {{ service.name | caseUcfirst }}: Service { Task { do { let result = try await {{ method.name | caseCamel }}( -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} {% endfor %} diff --git a/templates/swift/docs/example.md.twig b/templates/swift/docs/example.md.twig index 4bb02784db..25a9e95c7d 100644 --- a/templates/swift/docs/example.md.twig +++ b/templates/swift/docs/example.md.twig @@ -11,9 +11,9 @@ func main() async throws { {% endfor %} {% endif %} let {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) - let {% if method.type == 'webAuth' %}success{% elseif method.type == 'location' %}byteBuffer{% elseif method.responseModel | length == 0 %}result{% else %}{{ method.responseModel | caseCamel | escapeKeyword }}{% endif %} = try await {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => not param.isGlobal) | filter((param) => param.required) | length == 0 %}){{ '\n' }}{% endif %} + let {% if method.type == 'webAuth' %}success{% elseif method.type == 'location' %}byteBuffer{% elseif method.responseModel | length == 0 %}result{% else %}{{ method.responseModel | caseCamel | escapeKeyword }}{% endif %} = try await {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => param.required) | length == 0 %}){{ '\n' }}{% endif %} -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) | filter((parameter) => parameter.required) %} +{% for parameter in method.parameters.all | filter((parameter) => parameter.required) %} {{parameter.name}}: {{ parameter | paramExample | escapeKeyword }}{% if not loop.last %},{% endif %} {% if loop.last %} diff --git a/templates/web/docs/example.md.twig b/templates/web/docs/example.md.twig index 55dc170c6a..6e80ad1c36 100644 --- a/templates/web/docs/example.md.twig +++ b/templates/web/docs/example.md.twig @@ -16,7 +16,7 @@ client {% endif %} {% if method.type == 'webAuth' %}// Go to OAuth provider login page {% endif %} -{% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}const result = {% else %}const promise = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); +{% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}const result = {% else %}const promise = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %}); {% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}console.log(result); // Resource URL{% else %}promise.then(function (response) { console.log(response); // Success diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index 34ae98cf12..5fac3da564 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -22,15 +22,15 @@ export class {{ service.name | caseUcfirst }} extends Service { {{ method.description|comment3 }} {% endif %} * -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} +{% for parameter in method.parameters.all %} * @param {{ '{' }}{{ parameter.type | getPropertyType(method) | raw }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {% if method.type == 'webAuth' %}{void|string}{% elseif method.type == 'location' %}{URL}{% else %}{Promise}{% endif %} */ - {% if method.type != 'location' and method.type != 'webAuth'%}async {% endif %}{{ method.name | caseCamel }}{{ method.responseModel | getGenerics(spec) | raw }}({% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | getPropertyType(method) | raw }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): {{ method | getReturn(spec) | raw }} { -{% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} + {% if method.type != 'location' and method.type != 'webAuth'%}async {% endif %}{{ method.name | caseCamel }}{{ method.responseModel | getGenerics(spec) | raw }}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | getPropertyType(method) | raw }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): {{ method | getReturn(spec) | raw }} { +{% for parameter in method.parameters.all %} {% if parameter.required %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"'); @@ -38,18 +38,18 @@ export class {{ service.name | caseUcfirst }} extends Service { {% endif %} {% endfor %} - let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel | escapeKeyword }}{{ '}' }}', {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; + let path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel | escapeKeyword }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %}; let payload: Payload = {}; {% for parameter in method.parameters.query %} - if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; + if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}; } {% endfor %} {% for parameter in method.parameters.body %} - if (typeof {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { - payload['{{ parameter.name }}'] = {% if parameter.isGlobal %}this.{% endif %}{{ parameter.name | caseCamel | escapeKeyword }}; + if (typeof {{ parameter.name | caseCamel | escapeKeyword }} !== 'undefined') { + payload['{{ parameter.name }}'] = {{ parameter.name | caseCamel | escapeKeyword }}; } {% endfor %} From b53e8de7bae86955cfd454f258bb23c80ffe1303 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 3 Aug 2022 21:06:50 +1200 Subject: [PATCH 196/555] Add permissions helper classes --- src/SDK/Language/Android.php | 5 + src/SDK/Language/Dart.php | 6 + src/SDK/Language/Deno.php | 6 + src/SDK/Language/Flutter.php | 6 + src/SDK/Language/Kotlin.php | 6 + src/SDK/Language/Node.php | 6 + src/SDK/Language/PHP.php | 6 + src/SDK/Language/Python.php | 6 + src/SDK/Language/Ruby.php | 6 + src/SDK/Language/Swift.php | 12 +- src/SDK/Language/Web.php | 6 + .../main/java/io/appwrite/Permissions.kt.twig | 80 +++++++++++++ templates/dart/lib/permissions.dart.twig | 102 +++++++++++++++++ templates/deno/src/permissions.ts.twig | 76 +++++++++++++ templates/flutter/lib/permissions.dart.twig | 102 +++++++++++++++++ .../kotlin/io/appwrite/Permissions.kt.twig | 80 +++++++++++++ templates/node/lib/permissions.js.twig | 78 +++++++++++++ templates/php/src/Permissions.php.twig | 105 ++++++++++++++++++ templates/python/package/permissions.py.twig | 54 +++++++++ .../ruby/lib/container/permissions.rb.twig | 59 ++++++++++ .../swift/Sources/Permissions.swift.twig | 100 +++++++++++++++++ .../Sources/{Models => }/Query.swift.twig | 0 templates/web/src/permissions.ts.twig | 76 +++++++++++++ 23 files changed, 980 insertions(+), 3 deletions(-) create mode 100644 templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig create mode 100644 templates/dart/lib/permissions.dart.twig create mode 100644 templates/deno/src/permissions.ts.twig create mode 100644 templates/flutter/lib/permissions.dart.twig create mode 100644 templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig create mode 100644 templates/node/lib/permissions.js.twig create mode 100644 templates/php/src/Permissions.php.twig create mode 100644 templates/python/package/permissions.py.twig create mode 100644 templates/ruby/lib/container/permissions.rb.twig create mode 100644 templates/swift/Sources/Permissions.swift.twig rename templates/swift/Sources/{Models => }/Query.swift.twig (100%) create mode 100644 templates/web/src/permissions.ts.twig diff --git a/src/SDK/Language/Android.php b/src/SDK/Language/Android.php index 7c289c1e44..89d8da98da 100644 --- a/src/SDK/Language/Android.php +++ b/src/SDK/Language/Android.php @@ -106,6 +106,11 @@ public function getFiles() 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/Client.kt', 'template' => '/android/library/src/main/java/io/appwrite/Client.kt.twig', ], + [ + 'scope' => 'default', + 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/Permissions.kt', + 'template' => '/android/library/src/main/java/io/appwrite/Permissions.kt.twig', + ], [ 'scope' => 'default', 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/Query.kt', diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index f83474de02..64e3cd6a0c 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -343,6 +343,12 @@ public function getFiles() 'template' => 'dart/lib/src/response.dart.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '/lib/permissions.dart', + 'template' => 'dart/lib/permissions.dart.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/lib/query.dart', diff --git a/src/SDK/Language/Deno.php b/src/SDK/Language/Deno.php index 31ddbb7a8c..58b40f5162 100644 --- a/src/SDK/Language/Deno.php +++ b/src/SDK/Language/Deno.php @@ -30,6 +30,12 @@ public function getFiles() 'template' => 'deno/src/client.ts.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'src/permissions.ts', + 'template' => 'deno/src/permissions.ts.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'src/query.ts', diff --git a/src/SDK/Language/Flutter.php b/src/SDK/Language/Flutter.php index b7cd93fdcc..36d9f2e0ef 100644 --- a/src/SDK/Language/Flutter.php +++ b/src/SDK/Language/Flutter.php @@ -241,6 +241,12 @@ public function getFiles() 'template' => 'flutter/lib/models.dart.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '/lib/permissions.dart', + 'template' => 'flutter/lib/permissions.dart.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/lib/query.dart', diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index d00cc30184..2bf632a144 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -354,6 +354,12 @@ public function getFiles() 'template' => '/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/Permissions.kt', + 'template' => '/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/Query.kt', diff --git a/src/SDK/Language/Node.php b/src/SDK/Language/Node.php index 62f9ea5ffc..259562e46a 100644 --- a/src/SDK/Language/Node.php +++ b/src/SDK/Language/Node.php @@ -57,6 +57,12 @@ public function getFiles() 'template' => 'node/lib/client.js.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'lib/permissions.js', + 'template' => 'node/lib/permissions.js.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'lib/query.js', diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index fd7b94db1d..c8720f6f47 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -178,6 +178,12 @@ public function getFiles() 'template' => 'php/src/Client.php.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'src/{{ spec.title | caseUcfirst}}/Permissions.php', + 'template' => 'php/src/Permissions.php.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'src/{{ spec.title | caseUcfirst}}/Query.php', diff --git a/src/SDK/Language/Python.php b/src/SDK/Language/Python.php index 969aaed88d..e1c8e21d44 100644 --- a/src/SDK/Language/Python.php +++ b/src/SDK/Language/Python.php @@ -155,6 +155,12 @@ public function getFiles() 'template' => 'python/package/client.py.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '{{ spec.title | caseSnake}}/permissions.py', + 'template' => 'python/package/permissions.py.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '{{ spec.title | caseSnake}}/query.py', diff --git a/src/SDK/Language/Ruby.php b/src/SDK/Language/Ruby.php index f11c11b8f7..1b44169888 100644 --- a/src/SDK/Language/Ruby.php +++ b/src/SDK/Language/Ruby.php @@ -133,6 +133,12 @@ public function getFiles() 'template' => 'ruby/lib/container/client.rb.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'lib/{{ spec.title | caseDash }}/permissions.rb', + 'template' => 'ruby/lib/container/permissions.rb.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'lib/{{ spec.title | caseDash }}/query.rb', diff --git a/src/SDK/Language/Swift.php b/src/SDK/Language/Swift.php index 398adc62ff..a832da8b72 100644 --- a/src/SDK/Language/Swift.php +++ b/src/SDK/Language/Swift.php @@ -154,14 +154,20 @@ public function getFiles() ], [ 'scope' => 'default', - 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Models/File.swift', + 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Models/InputFile.swift', 'template' => 'swift/Sources/Models/InputFile.swift.twig', 'minify' => false, ], [ 'scope' => 'default', - 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Models/Query.swift', - 'template' => 'swift/Sources/Models/Query.swift.twig', + 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Permissions.swift', + 'template' => 'swift/Sources/Permissions.swift.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Query.swift', + 'template' => 'swift/Sources/Query.swift.twig', 'minify' => false, ], [ diff --git a/src/SDK/Language/Web.php b/src/SDK/Language/Web.php index 4484147782..f54f0e27f6 100644 --- a/src/SDK/Language/Web.php +++ b/src/SDK/Language/Web.php @@ -52,6 +52,12 @@ public function getFiles() 'template' => 'web/src/models.ts.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'src/permissions.ts', + 'template' => 'web/src/permissions.ts.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'src/query.ts', diff --git a/templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig b/templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig new file mode 100644 index 0000000000..5e5200e607 --- /dev/null +++ b/templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig @@ -0,0 +1,80 @@ +package {{ sdk.namespace | caseDot }} + +class Permissions { + companion object { + + fun from( + read: List = listOf(), + write: List = listOf(), + create: List = listOf(), + update: List = listOf(), + delete: List = listOf(), + admin: List = listOf(), + ): List { + val permissions = mutableListOf() + + if (read.isNotEmpty()) { + permissions.add(read(*read.toTypedArray())) + } + if (write.isNotEmpty()) { + permissions.add(write(*write.toTypedArray())) + } + if (create.isNotEmpty()) { + permissions.add(create(*create.toTypedArray())) + } + if (update.isNotEmpty()) { + permissions.add(update(*update.toTypedArray())) + } + if (delete.isNotEmpty()) { + permissions.add(delete(*delete.toTypedArray())) + } + if (admin.isNotEmpty()) { + permissions.add(admin(*admin.toTypedArray())) + } + + return permissions + } + + fun read(vararg permissions: String): String { + if (permissions.isEmpty()) { + throw IllegalArgumentException("At least one permission must be provided.") + } + return "read(${permissions.joinToString(",")})" + } + + fun write(vararg permissions: String): String { + if (permissions.isEmpty()) { + throw IllegalArgumentException("At least one permission must be provided.") + } + return "write(${permissions.joinToString(",")})" + } + + fun create(vararg permissions: String): String { + if (permissions.isEmpty()) { + throw IllegalArgumentException("At least one permission must be provided.") + } + return "create(${permissions.joinToString(",")})" + } + + fun update(vararg permissions: String): String { + if (permissions.isEmpty()) { + throw IllegalArgumentException("At least one permission must be provided.") + } + return "update(${permissions.joinToString(",")})" + } + + fun delete(vararg permissions: String): String { + if (permissions.isEmpty()) { + throw IllegalArgumentException("At least one permission must be provided.") + } + return "delete(${permissions.joinToString(",")})" + } + + fun admin(vararg permissions: String): String { + if (permissions.isEmpty()) { + throw IllegalArgumentException("At least one permission must be provided.") + } + return "admin(${permissions.joinToString(",")})" + } + } +} \ No newline at end of file diff --git a/templates/dart/lib/permissions.dart.twig b/templates/dart/lib/permissions.dart.twig new file mode 100644 index 0000000000..961a40ed83 --- /dev/null +++ b/templates/dart/lib/permissions.dart.twig @@ -0,0 +1,102 @@ +part of {{ language.params.packageName }}; + +class Permissions { + + static List from( + List read = [], + List write = [], + List create = [], + List update = [], + List delete = [], + List admin = [], + ) { + final permissions = []; + + if (read.isNotEmpty) { + permissions.add(Permissions.read(read)); + } + if (write.isNotEmpty) { + permissions.add(Permissions.write(write)); + } + if (create.isNotEmpty) { + permissions.add(Permissions.create(create)); + } + if (update.isNotEmpty) { + permissions.add(Permissions.update(update)); + } + if (delete.isNotEmpty) { + permissions.add(Permissions.delete(delete)); + } + if (admin.isNotEmpty) { + permissions.add(Permissions.admin(admin)); + } + + return permissions; + } + + static String read(List permissions) { + if (read.isEmpty) { + throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); + } + return "read(${permissions.join(",")})"; + } + + static String read(String permission) { + return Permissions.read([permission]); + } + + static String write(List permissions) { + if (write.isEmpty) { + throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); + } + return "write(${permissions.join(",")})"; + } + + static String write(String permission) { + return Permissions.write([permission]); + } + + static String create(List permissions) { + if (create.isEmpty) { + throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); + } + return "create(${permissions.join(",")})"; + } + + static String create(String permission) { + return Permissions.create([permission]); + } + + static String update(List permissions) { + if (update.isEmpty) { + throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); + } + return "update(${permissions.join(",")})"; + } + + static String update(String permission) { + return Permissions.update([permission]); + } + + static String delete(List permissions) { + if (delete.isEmpty) { + throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); + } + return "delete(${permissions.join(",")})"; + } + + static String delete(String permission) { + return Permissions.delete([permission]); + } + + static String admin(List permissions) { + if (admin.isEmpty) { + throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); + } + return "admin(${permissions.join(",")})"; + } + + static String admin(String permission) { + return Permissions.admin([permission]); + } +} diff --git a/templates/deno/src/permissions.ts.twig b/templates/deno/src/permissions.ts.twig new file mode 100644 index 0000000000..601bde469a --- /dev/null +++ b/templates/deno/src/permissions.ts.twig @@ -0,0 +1,76 @@ +export class Permissions { + + static from = ( + read: string[] = [], + write: string[] = [], + create: string[] = [], + update: string[] = [], + xdelete: string[] = [], + admin: string[] = [], + ): string[] => { + const permissions = []; + + if (read.length > 0) { + permissions.push(Permissions.read(read)); + } + if (write.length > 0) { + permissions.push(Permissions.write(write)); + } + if (create.length > 0) { + permissions.push(Permissions.create(create)); + } + if (update.length > 0) { + permissions.push(Permissions.update(update)); + } + if (xdelete.length > 0) { + permissions.push(Permissions.delete(xdelete)); + } + if (admin.length > 0) { + permissions.push(Permissions.admin(admin)); + } + + return permissions + } + + static read = (...permissions: string[]): string => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `read(${permissions.join(',')})` + } + + static write = (...permissions: string[]): string => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `write(${permissions.join(',')})` + } + + static create = (...permissions: string[]): string => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `create(${permissions.join(',')})` + } + + static update = (...permissions: string[]): string => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `update(${permissions.join(',')})` + } + + static delete = (...permissions: string[]): string => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `delete(${permissions.join(',')})` + } + + static admin = (...permissions: string[]): string => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `admin(${permissions.join(',')})` + } +} diff --git a/templates/flutter/lib/permissions.dart.twig b/templates/flutter/lib/permissions.dart.twig new file mode 100644 index 0000000000..961a40ed83 --- /dev/null +++ b/templates/flutter/lib/permissions.dart.twig @@ -0,0 +1,102 @@ +part of {{ language.params.packageName }}; + +class Permissions { + + static List from( + List read = [], + List write = [], + List create = [], + List update = [], + List delete = [], + List admin = [], + ) { + final permissions = []; + + if (read.isNotEmpty) { + permissions.add(Permissions.read(read)); + } + if (write.isNotEmpty) { + permissions.add(Permissions.write(write)); + } + if (create.isNotEmpty) { + permissions.add(Permissions.create(create)); + } + if (update.isNotEmpty) { + permissions.add(Permissions.update(update)); + } + if (delete.isNotEmpty) { + permissions.add(Permissions.delete(delete)); + } + if (admin.isNotEmpty) { + permissions.add(Permissions.admin(admin)); + } + + return permissions; + } + + static String read(List permissions) { + if (read.isEmpty) { + throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); + } + return "read(${permissions.join(",")})"; + } + + static String read(String permission) { + return Permissions.read([permission]); + } + + static String write(List permissions) { + if (write.isEmpty) { + throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); + } + return "write(${permissions.join(",")})"; + } + + static String write(String permission) { + return Permissions.write([permission]); + } + + static String create(List permissions) { + if (create.isEmpty) { + throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); + } + return "create(${permissions.join(",")})"; + } + + static String create(String permission) { + return Permissions.create([permission]); + } + + static String update(List permissions) { + if (update.isEmpty) { + throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); + } + return "update(${permissions.join(",")})"; + } + + static String update(String permission) { + return Permissions.update([permission]); + } + + static String delete(List permissions) { + if (delete.isEmpty) { + throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); + } + return "delete(${permissions.join(",")})"; + } + + static String delete(String permission) { + return Permissions.delete([permission]); + } + + static String admin(List permissions) { + if (admin.isEmpty) { + throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); + } + return "admin(${permissions.join(",")})"; + } + + static String admin(String permission) { + return Permissions.admin([permission]); + } +} diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig new file mode 100644 index 0000000000..5e5200e607 --- /dev/null +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig @@ -0,0 +1,80 @@ +package {{ sdk.namespace | caseDot }} + +class Permissions { + companion object { + + fun from( + read: List = listOf(), + write: List = listOf(), + create: List = listOf(), + update: List = listOf(), + delete: List = listOf(), + admin: List = listOf(), + ): List { + val permissions = mutableListOf() + + if (read.isNotEmpty()) { + permissions.add(read(*read.toTypedArray())) + } + if (write.isNotEmpty()) { + permissions.add(write(*write.toTypedArray())) + } + if (create.isNotEmpty()) { + permissions.add(create(*create.toTypedArray())) + } + if (update.isNotEmpty()) { + permissions.add(update(*update.toTypedArray())) + } + if (delete.isNotEmpty()) { + permissions.add(delete(*delete.toTypedArray())) + } + if (admin.isNotEmpty()) { + permissions.add(admin(*admin.toTypedArray())) + } + + return permissions + } + + fun read(vararg permissions: String): String { + if (permissions.isEmpty()) { + throw IllegalArgumentException("At least one permission must be provided.") + } + return "read(${permissions.joinToString(",")})" + } + + fun write(vararg permissions: String): String { + if (permissions.isEmpty()) { + throw IllegalArgumentException("At least one permission must be provided.") + } + return "write(${permissions.joinToString(",")})" + } + + fun create(vararg permissions: String): String { + if (permissions.isEmpty()) { + throw IllegalArgumentException("At least one permission must be provided.") + } + return "create(${permissions.joinToString(",")})" + } + + fun update(vararg permissions: String): String { + if (permissions.isEmpty()) { + throw IllegalArgumentException("At least one permission must be provided.") + } + return "update(${permissions.joinToString(",")})" + } + + fun delete(vararg permissions: String): String { + if (permissions.isEmpty()) { + throw IllegalArgumentException("At least one permission must be provided.") + } + return "delete(${permissions.joinToString(",")})" + } + + fun admin(vararg permissions: String): String { + if (permissions.isEmpty()) { + throw IllegalArgumentException("At least one permission must be provided.") + } + return "admin(${permissions.joinToString(",")})" + } + } +} \ No newline at end of file diff --git a/templates/node/lib/permissions.js.twig b/templates/node/lib/permissions.js.twig new file mode 100644 index 0000000000..ec55ef5e25 --- /dev/null +++ b/templates/node/lib/permissions.js.twig @@ -0,0 +1,78 @@ +class Permissions { + + static from = ( + read = [], + write = [], + create = [], + update = [], + xdelete = [], + admin = [] + ) => { + const permissions = []; + + if (read.length > 0) { + permissions.push(Permissions.read(read)); + } + if (write.length > 0) { + permissions.push(Permissions.write(write)); + } + if (create.length > 0) { + permissions.push(Permissions.create(create)); + } + if (update.length > 0) { + permissions.push(Permissions.update(update)); + } + if (xdelete.length > 0) { + permissions.push(Permissions.delete(xdelete)); + } + if (admin.length > 0) { + permissions.push(Permissions.admin(admin)); + } + + return permissions + } + + static read = (...permissions) => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `read(${permissions.join(',')})` + } + + static write = (...permissions) => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `write(${permissions.join(',')})` + } + + static create = (...permissions) => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `create(${permissions.join(',')})` + } + + static update = (...permissions) => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `update(${permissions.join(',')})` + } + + static delete = (...permissions) => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `delete(${permissions.join(',')})` + } + + static admin = (...permissions) => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `admin(${permissions.join(',')})` + } +} + +module.exports = Permissions; diff --git a/templates/php/src/Permissions.php.twig b/templates/php/src/Permissions.php.twig new file mode 100644 index 0000000000..14f0d5aabd --- /dev/null +++ b/templates/php/src/Permissions.php.twig @@ -0,0 +1,105 @@ + [String] { + let permissions = [] + + if read.count > 0 { + permissions.append(Permissions.read(read)) + } + if write.count > 0 { + permissions.append(Permissions.write(write)) + } + if create.count > 0 { + permissions.append(Permissions.create(create)) + } + if update.count > 0 { + permissions.append(Permissions.update(update)) + } + if delete.count > 0 { + permissions.append(Permissions.delete(delete)) + } + if admin.count > 0 { + permissions.append(Permissions.admin(admin)) + } + + return permissions + } + + public static func read(_ permissions: [String]) -> String { + if permissions.count == 0 { + throw {{ spec.title | caseUcfirst }}Error(message: "At least one permission must be provided.") + } + return "read(\(permissions.joined(separator: ","))" + } + + public static func read(_ permissions: String...) -> String { + return Permissions.read(permissions) + } + + public static func write(_ permissions: [String]) -> String { + if permissions.count == 0 { + throw {{ spec.title | caseUcfirst }}Error(message: "At least one permission must be provided.") + } + return "write(\(permissions.joined(separator: ","))" + } + + public static func write(_ permissions: String...) -> String { + return Permissions.write(permissions) + } + + public static func create(_ permissions: [String]) -> String { + if permissions.count == 0 { + throw {{ spec.title | caseUcfirst }}Error(message: "At least one permission must be provided.") + } + return "create(\(permissions.joined(separator: ","))" + } + + public static func create(_ permissions: String...) -> String { + return Permissions.create(permissions) + } + + public static func update(_ permissions: [String]) -> String { + if permissions.count == 0 { + throw {{ spec.title | caseUcfirst }}Error(message: "At least one permission must be provided.") + } + return "update(\(permissions.joined(separator: ","))" + } + + public static func update(_ permissions: String...) -> String { + return Permissions.update(permissions) + } + + public static func delete(_ permissions: [String]) -> String { + if permissions.count == 0 { + throw {{ spec.title | caseUcfirst }}Error(message: "At least one permission must be provided.") + } + return "delete(\(permissions.joined(separator: ","))" + } + + public static func delete(_ permissions: String...) -> String { + return Permissions.delete(permissions) + } + + public static func admin(_ permissions: [String]) -> String { + if permissions.count == 0 { + throw {{ spec.title | caseUcfirst }}Error(message: "At least one permission must be provided.") + } + return "admin(\(permissions.joined(separator: ","))" + } + + public static func admin(_ permissions: String...) -> String { + return Permissions.admin(permissions) + } +} \ No newline at end of file diff --git a/templates/swift/Sources/Models/Query.swift.twig b/templates/swift/Sources/Query.swift.twig similarity index 100% rename from templates/swift/Sources/Models/Query.swift.twig rename to templates/swift/Sources/Query.swift.twig diff --git a/templates/web/src/permissions.ts.twig b/templates/web/src/permissions.ts.twig new file mode 100644 index 0000000000..601bde469a --- /dev/null +++ b/templates/web/src/permissions.ts.twig @@ -0,0 +1,76 @@ +export class Permissions { + + static from = ( + read: string[] = [], + write: string[] = [], + create: string[] = [], + update: string[] = [], + xdelete: string[] = [], + admin: string[] = [], + ): string[] => { + const permissions = []; + + if (read.length > 0) { + permissions.push(Permissions.read(read)); + } + if (write.length > 0) { + permissions.push(Permissions.write(write)); + } + if (create.length > 0) { + permissions.push(Permissions.create(create)); + } + if (update.length > 0) { + permissions.push(Permissions.update(update)); + } + if (xdelete.length > 0) { + permissions.push(Permissions.delete(xdelete)); + } + if (admin.length > 0) { + permissions.push(Permissions.admin(admin)); + } + + return permissions + } + + static read = (...permissions: string[]): string => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `read(${permissions.join(',')})` + } + + static write = (...permissions: string[]): string => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `write(${permissions.join(',')})` + } + + static create = (...permissions: string[]): string => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `create(${permissions.join(',')})` + } + + static update = (...permissions: string[]): string => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `update(${permissions.join(',')})` + } + + static delete = (...permissions: string[]): string => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `delete(${permissions.join(',')})` + } + + static admin = (...permissions: string[]): string => { + if (permissions.length === 0) { + throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); + } + return `admin(${permissions.join(',')})` + } +} From 3a0974b8ed0da9300f8a696d7da0902629dcc3a0 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Wed, 3 Aug 2022 12:24:19 +0000 Subject: [PATCH 197/555] fix refactor --- templates/kotlin/base/requests/file.twig | 3 ++- .../main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/kotlin/base/requests/file.twig b/templates/kotlin/base/requests/file.twig index fb5f31d84e..d06aa20ec3 100644 --- a/templates/kotlin/base/requests/file.twig +++ b/templates/kotlin/base/requests/file.twig @@ -1,3 +1,4 @@ +{% import 'kotlin/base/utils.twig' as utils %} val idParamName: String? = {% if method.parameters.all | filter(p => p.isUploadID) | length > 0 %}{% for parameter in method.parameters.all | filter(parameter => parameter.isUploadID) %}"{{ parameter.name }}"{% endfor %}{% else %}null{% endif %} {% for parameter in method.parameters.all %} @@ -9,7 +10,7 @@ path, headers, params, - responseType = {{ result.resultType(sdk.namespace, method) }}::class.java, + responseType = {{ utils.resultType(sdk.namespace, method) }}::class.java, {% if method.responseModel %} converter, {% endif %} diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index a0c8645dc2..bf24f77270 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -43,12 +43,12 @@ class {{ service.name | caseUcfirst }} : Service { {% for parameter in method.parameters.all | filter((param) => not param.isGlobal) %} * @param {{ parameter.name | caseCamel }} {{ parameter.description }} {% endfor %} - * {% if method.type != "webAuth" %}@return [{{ result.resultType(sdk.namespace, method) }}]{% endif %} + * {% if method.type != "webAuth" %}@return [{{ utils.resultType(sdk.namespace, method) }}]{% endif %} */ @JvmOverloads @Throws({{ spec.title | caseUcfirst }}Exception::class) - suspend fun {{ method.name | caseCamel }}({% if method.type == "webAuth" %}{{ '\n\t\t' }}activity: ComponentActivity{% if method.parameters.all | length > 0 %}, {% endif %}{% endif %}{{ parameters.method_parameters(method.parameters, method.consumes) }}{% if method.parameters.all|length > 0 %}{{ '\n\t' }}{% endif %}){% if method.type != "webAuth" %}: {{ result.resultType(sdk.namespace, method) }}{% endif %} { + suspend fun {{ method.name | caseCamel }}({% if method.type == "webAuth" %}{{ '\n\t\t' }}activity: ComponentActivity{% if method.parameters.all | length > 0 %}, {% endif %}{% endif %}{{ utils.method_parameters(method.parameters, method.consumes) }}{% if method.parameters.all|length > 0 %}{{ '\n\t' }}{% endif %}){% if method.type != "webAuth" %}: {{ utils.resultType(sdk.namespace, method) }}{% endif %} { val path = "{{ method.path }}"{% for parameter in method.parameters.path %}.replace("{{ '{' ~ parameter.name | caseCamel ~ '}' }}", {{ parameter.name | caseCamel }}){% endfor %} val params = mutableMapOf( From e240dca519a32a31b001fbd44805203d2aec3783 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 4 Aug 2022 17:16:31 +1200 Subject: [PATCH 198/555] Lint fixes --- src/SDK/Language.php | 14 +++++++------- src/Spec/Spec.php | 9 +++------ tests/Base.php | 22 +++++++++++----------- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/SDK/Language.php b/src/SDK/Language.php index a278a7a6dc..d6352bde59 100644 --- a/src/SDK/Language.php +++ b/src/SDK/Language.php @@ -4,13 +4,13 @@ abstract class Language { - const TYPE_INTEGER = 'integer'; - const TYPE_NUMBER = 'number'; - const TYPE_STRING = 'string'; - const TYPE_BOOLEAN = 'boolean'; - const TYPE_ARRAY = 'array'; - const TYPE_OBJECT = 'object'; - const TYPE_FILE = 'file'; + public const TYPE_INTEGER = 'integer'; + public const TYPE_NUMBER = 'number'; + public const TYPE_STRING = 'string'; + public const TYPE_BOOLEAN = 'boolean'; + public const TYPE_ARRAY = 'array'; + public const TYPE_OBJECT = 'object'; + public const TYPE_FILE = 'file'; /** * @var array diff --git a/src/Spec/Spec.php b/src/Spec/Spec.php index 2511bbe6b9..6ffbbba530 100644 --- a/src/Spec/Spec.php +++ b/src/Spec/Spec.php @@ -7,12 +7,9 @@ abstract class Spec extends ArrayObject { - const FORMAT_OPEN_API_3 = 'Open API 3'; - const FORMAT_SWAGGER_2 = 'Swagger 2'; - - const SET_TYPE_ASSIGN = 'assign'; - const SET_TYPE_PREPEND = 'prepend'; - const SET_TYPE_APPEND = 'append'; + private const SET_TYPE_ASSIGN = 'assign'; + private const SET_TYPE_PREPEND = 'prepend'; + private const SET_TYPE_APPEND = 'append'; /** * Spec constructor. diff --git a/tests/Base.php b/tests/Base.php index 445d424f98..b9edd567e3 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -16,7 +16,7 @@ abstract class Base extends TestCase { - const FOO_RESPONSES = [ + protected const FOO_RESPONSES = [ 'GET:/v1/mock/tests/foo:passed', 'POST:/v1/mock/tests/foo:passed', 'PUT:/v1/mock/tests/foo:passed', @@ -24,7 +24,7 @@ abstract class Base extends TestCase 'DELETE:/v1/mock/tests/foo:passed', ]; - const BAR_RESPONSES = [ + protected const BAR_RESPONSES = [ 'GET:/v1/mock/tests/bar:passed', 'POST:/v1/mock/tests/bar:passed', 'PUT:/v1/mock/tests/bar:passed', @@ -32,31 +32,31 @@ abstract class Base extends TestCase 'DELETE:/v1/mock/tests/bar:passed', ]; - const GENERAL_RESPONSES = [ + protected const GENERAL_RESPONSES = [ 'GET:/v1/mock/tests/general/redirect/done:passed', 'POST:/v1/mock/tests/general/upload:passed', ]; - const EXTENDED_GENERAL_RESPONSES = [ + protected const EXTENDED_GENERAL_RESPONSES = [ 'Download test passed.', ]; - const COOKIE_RESPONSES = [ + protected const COOKIE_RESPONSES = [ 'GET:/v1/mock/tests/general/set-cookie:passed', 'GET:/v1/mock/tests/general/get-cookie:passed', ]; - const LARGE_FILE_RESPONSES = [ + protected const LARGE_FILE_RESPONSES = [ 'POST:/v1/mock/tests/general/upload:passed', ]; - const EXCEPTION_RESPONSES = [ + protected const EXCEPTION_RESPONSES = [ 'Mock 400 error', 'Server Error', 'This is a text error', ]; - const REALTIME_RESPONSES = [ + protected const REALTIME_RESPONSES = [ 'WS:/v1/realtime:passed', ]; @@ -110,7 +110,7 @@ public function testHTTPSuccess(): void $dir = __DIR__ . '/sdks/' . $this->language; - $this->rmdir_recursive($dir); + $this->rmdirRecursive($dir); $sdk->generate(__DIR__ . '/sdks/' . $this->language); @@ -159,7 +159,7 @@ public function testHTTPSuccess(): void } } - private function rmdir_recursive($dir) + private function rmdirRecursive($dir) { if (!\is_dir($dir)) { return; @@ -169,7 +169,7 @@ private function rmdir_recursive($dir) continue; } if (\is_dir("$dir/$file")) { - $this->rmdir_recursive("$dir/$file"); + $this->rmdirRecursive("$dir/$file"); } else { \unlink("$dir/$file"); } From 6bc9d13ec072ea5ba55e603848615969a6e12fa3 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 4 Aug 2022 17:16:41 +1200 Subject: [PATCH 199/555] Add lint to travis --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 99e74d2508..6f96037d81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,10 +57,13 @@ before_install: echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin fi - install: - docker --version - composer install -script: - - vendor/bin/phpunit tests/${SDK}Test.php \ No newline at end of file +jobs: + include: + - stage: lint + script: composer lint + - stage: test + script: composer test tests/${SDK}Test.php \ No newline at end of file From 9159fd8763dff94277356886c7b46560515ceb3b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 4 Aug 2022 17:23:19 +1200 Subject: [PATCH 200/555] Only lint once --- .travis.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6f96037d81..593dada6b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,10 +60,7 @@ before_install: install: - docker --version - composer install + - composer lint -jobs: - include: - - stage: lint - script: composer lint - - stage: test - script: composer test tests/${SDK}Test.php \ No newline at end of file +script: + - composer test tests/${SDK}Test.php \ No newline at end of file From b8101df9887835b12203d21b880de078dff6f303 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 5 Aug 2022 14:23:03 +1200 Subject: [PATCH 201/555] Lint as separate job --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 593dada6b9..8ec52dde4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,6 +51,11 @@ notifications: email: - team@appwrite.io +jobs: + include: + - script: + - composer lint + before_install: - > if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then @@ -60,7 +65,6 @@ before_install: install: - docker --version - composer install - - composer lint script: - composer test tests/${SDK}Test.php \ No newline at end of file From 19047aa465183aed595d30806dede85fb914ac3b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 5 Aug 2022 14:32:26 +1200 Subject: [PATCH 202/555] Lint and test stages --- .travis.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8ec52dde4d..63cec40866 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,10 @@ language: php php: - 8.1 +stages: + - lint + - test + env: - SDK=Android11Java8 - SDK=Android11Java11 @@ -53,9 +57,12 @@ notifications: jobs: include: - - script: + - stage: lint + script: - composer lint +stage: test + before_install: - > if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then From 35f726097997c0819a22594f0e44b6e7a7b1b257 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 5 Aug 2022 14:35:56 +1200 Subject: [PATCH 203/555] Env for test only --- .travis.yml | 93 ++++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 48 deletions(-) diff --git a/.travis.yml b/.travis.yml index 63cec40866..01a1734056 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,39 +18,6 @@ stages: - lint - test -env: - - SDK=Android11Java8 - - SDK=Android11Java11 - - SDK=Android12Java8 - - SDK=Android12Java11 - - SDK=CLINode14 - - SDK=CLINode16 - - SDK=DartBeta - - SDK=DartStable - - SDK=Deno1171 - - SDK=FlutterStable - - SDK=Go112 - - SDK=Go118 - - SDK=FlutterBeta - - SDK=KotlinJava8 - - SDK=KotlinJava11 - - SDK=KotlinJava17 - - SDK=Node12 - - SDK=Node14 - - SDK=Node16 - - SDK=PHP74 - - SDK=PHP80 - - SDK=Python38 - - SDK=Python39 - - SDK=Python310 - - SDK=Ruby27 - - SDK=Ruby30 - - SDK=Ruby31 - - SDK=SwiftClient55 - - SDK=SwiftServer55 - - SDK=WebChromium - - SDK=WebNode - notifications: email: - team@appwrite.io @@ -58,20 +25,50 @@ notifications: jobs: include: - stage: lint + name: Lint script: - composer lint - -stage: test - -before_install: - - > - if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then - echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin - fi - -install: - - docker --version - - composer install - -script: - - composer test tests/${SDK}Test.php \ No newline at end of file + - stage: test + name: Test + before_install: + - > + if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then + echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin + fi + install: + - docker --version + - composer install + script: + - composer test tests/${SDK}Test.php + env: + - SDK=Android11Java8 + - SDK=Android11Java11 + - SDK=Android12Java8 + - SDK=Android12Java11 + - SDK=CLINode14 + - SDK=CLINode16 + - SDK=DartBeta + - SDK=DartStable + - SDK=Deno1171 + - SDK=FlutterStable + - SDK=Go112 + - SDK=Go118 + - SDK=FlutterBeta + - SDK=KotlinJava8 + - SDK=KotlinJava11 + - SDK=KotlinJava17 + - SDK=Node12 + - SDK=Node14 + - SDK=Node16 + - SDK=PHP74 + - SDK=PHP80 + - SDK=Python38 + - SDK=Python39 + - SDK=Python310 + - SDK=Ruby27 + - SDK=Ruby30 + - SDK=Ruby31 + - SDK=SwiftClient55 + - SDK=SwiftServer55 + - SDK=WebChromium + - SDK=WebNode \ No newline at end of file From f1e518f4f22b6f91db2bb24efd21a23757180cde Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 5 Aug 2022 14:38:07 +1200 Subject: [PATCH 204/555] Env as matrix --- .travis.yml | 65 +++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index 01a1734056..51f1bbbb54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,35 +40,36 @@ jobs: - composer install script: - composer test tests/${SDK}Test.php - env: - - SDK=Android11Java8 - - SDK=Android11Java11 - - SDK=Android12Java8 - - SDK=Android12Java11 - - SDK=CLINode14 - - SDK=CLINode16 - - SDK=DartBeta - - SDK=DartStable - - SDK=Deno1171 - - SDK=FlutterStable - - SDK=Go112 - - SDK=Go118 - - SDK=FlutterBeta - - SDK=KotlinJava8 - - SDK=KotlinJava11 - - SDK=KotlinJava17 - - SDK=Node12 - - SDK=Node14 - - SDK=Node16 - - SDK=PHP74 - - SDK=PHP80 - - SDK=Python38 - - SDK=Python39 - - SDK=Python310 - - SDK=Ruby27 - - SDK=Ruby30 - - SDK=Ruby31 - - SDK=SwiftClient55 - - SDK=SwiftServer55 - - SDK=WebChromium - - SDK=WebNode \ No newline at end of file + matrix: + env: + - SDK=Android11Java8 + - SDK=Android11Java11 + - SDK=Android12Java8 + - SDK=Android12Java11 + - SDK=CLINode14 + - SDK=CLINode16 + - SDK=DartBeta + - SDK=DartStable + - SDK=Deno1171 + - SDK=FlutterStable + - SDK=Go112 + - SDK=Go118 + - SDK=FlutterBeta + - SDK=KotlinJava8 + - SDK=KotlinJava11 + - SDK=KotlinJava17 + - SDK=Node12 + - SDK=Node14 + - SDK=Node16 + - SDK=PHP74 + - SDK=PHP80 + - SDK=Python38 + - SDK=Python39 + - SDK=Python310 + - SDK=Ruby27 + - SDK=Ruby30 + - SDK=Ruby31 + - SDK=SwiftClient55 + - SDK=SwiftServer55 + - SDK=WebChromium + - SDK=WebNode \ No newline at end of file From da3eb47ba4591892637d3f6936fec44c3be0654c Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 5 Aug 2022 14:42:19 +1200 Subject: [PATCH 205/555] Env key --- .travis.yml | 68 ++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index 51f1bbbb54..f350787114 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,39 @@ stages: - lint - test +env: + - SDK=Android11Java8 + - SDK=Android11Java11 + - SDK=Android12Java8 + - SDK=Android12Java11 + - SDK=CLINode14 + - SDK=CLINode16 + - SDK=DartBeta + - SDK=DartStable + - SDK=Deno1171 + - SDK=FlutterStable + - SDK=Go112 + - SDK=Go118 + - SDK=FlutterBeta + - SDK=KotlinJava8 + - SDK=KotlinJava11 + - SDK=KotlinJava17 + - SDK=Node12 + - SDK=Node14 + - SDK=Node16 + - SDK=PHP74 + - SDK=PHP80 + - SDK=Python38 + - SDK=Python39 + - SDK=Python310 + - SDK=Ruby27 + - SDK=Ruby30 + - SDK=Ruby31 + - SDK=SwiftClient55 + - SDK=SwiftServer55 + - SDK=WebChromium + - SDK=WebNode + notifications: email: - team@appwrite.io @@ -39,37 +72,4 @@ jobs: - docker --version - composer install script: - - composer test tests/${SDK}Test.php - matrix: - env: - - SDK=Android11Java8 - - SDK=Android11Java11 - - SDK=Android12Java8 - - SDK=Android12Java11 - - SDK=CLINode14 - - SDK=CLINode16 - - SDK=DartBeta - - SDK=DartStable - - SDK=Deno1171 - - SDK=FlutterStable - - SDK=Go112 - - SDK=Go118 - - SDK=FlutterBeta - - SDK=KotlinJava8 - - SDK=KotlinJava11 - - SDK=KotlinJava17 - - SDK=Node12 - - SDK=Node14 - - SDK=Node16 - - SDK=PHP74 - - SDK=PHP80 - - SDK=Python38 - - SDK=Python39 - - SDK=Python310 - - SDK=Ruby27 - - SDK=Ruby30 - - SDK=Ruby31 - - SDK=SwiftClient55 - - SDK=SwiftServer55 - - SDK=WebChromium - - SDK=WebNode \ No newline at end of file + - composer test tests/${SDK}Test.php \ No newline at end of file From b04fff3a932f7ef6ee99d0456c79b8aaa56f73b2 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 5 Aug 2022 14:43:17 +1200 Subject: [PATCH 206/555] Install deps for lint job --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index f350787114..d7e14cb864 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,6 +59,8 @@ jobs: include: - stage: lint name: Lint + install: + - composer install script: - composer lint - stage: test From 40eb77c5fcf23b9f31781cd683cbf37c7d707f77 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 5 Aug 2022 16:40:26 +1200 Subject: [PATCH 207/555] Remove test name --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d7e14cb864..414dd59a66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,7 +64,6 @@ jobs: script: - composer lint - stage: test - name: Test before_install: - > if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then From aab9dcc87cc43c965208d72625965d1a0d4efbf7 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 5 Aug 2022 16:44:54 +1200 Subject: [PATCH 208/555] Test as default stage for matrix --- .travis.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 414dd59a66..beb3b3019d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,14 +63,14 @@ jobs: - composer install script: - composer lint - - stage: test - before_install: - - > - if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then - echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin - fi - install: - - docker --version - - composer install - script: - - composer test tests/${SDK}Test.php \ No newline at end of file + +before_install: + - > + if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then + echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin + fi +install: + - docker --version + - composer install +script: + - composer test tests/${SDK}Test.php \ No newline at end of file From af1043245e1c845f9872c2a9544ccc78093b8fb3 Mon Sep 17 00:00:00 2001 From: nohli <43643339+nohli@users.noreply.github.com> Date: Fri, 5 Aug 2022 16:21:29 +0200 Subject: [PATCH 209/555] Update package versions in pubspec.yaml --- templates/dart/pubspec.yaml.twig | 6 +++--- templates/flutter/pubspec.yaml.twig | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/dart/pubspec.yaml.twig b/templates/dart/pubspec.yaml.twig index f7e8ad2c03..48390218b8 100644 --- a/templates/dart/pubspec.yaml.twig +++ b/templates/dart/pubspec.yaml.twig @@ -8,8 +8,8 @@ documentation: {{ spec.contactURL }} environment: sdk: '>=2.14.0 <3.0.0' dependencies: - http: ^0.13.4 + http: ^0.13.5 dev_dependencies: - test: ^1.16.8 - lints: ^2.0.0 \ No newline at end of file + test: ^1.21.4 + lints: ^2.0.0 diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index da671fecd0..fc4977066f 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -11,11 +11,11 @@ dependencies: flutter: sdk: flutter cookie_jar: ^3.0.1 - device_info_plus: ^4.0.0 + device_info_plus: ^4.0.1 flutter_web_auth: ^0.4.1 - http: ^0.13.4 - package_info_plus: 1.4.2 - path_provider: ^2.0.9 + http: ^0.13.5 + package_info_plus: 1.4.3 + path_provider: ^2.0.11 web_socket_channel: ^2.2.0 dev_dependencies: From 6a0d7455e83a41d28c9e9ee7e2b6a64a26406753 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 9 Aug 2022 11:50:37 +0545 Subject: [PATCH 210/555] upgrade dependencies --- templates/flutter/pubspec.yaml.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index da671fecd0..96ababaf90 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -11,10 +11,10 @@ dependencies: flutter: sdk: flutter cookie_jar: ^3.0.1 - device_info_plus: ^4.0.0 + device_info_plus: ^4.0.2 flutter_web_auth: ^0.4.1 http: ^0.13.4 - package_info_plus: 1.4.2 + package_info_plus: 1.4.3 path_provider: ^2.0.9 web_socket_channel: ^2.2.0 From c11d32b6e75c14e254d5c8c33c0598e0567bc50d Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 9 Aug 2022 14:43:13 +0000 Subject: [PATCH 211/555] split headers in Nodejs --- src/SDK/SDK.php | 12 ++++++++++++ templates/node/lib/client.js.twig | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index 436d164464..c1a2a2cd05 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -41,6 +41,7 @@ class SDK 'description' => '', 'shortDescription' => '', 'version' => '', + 'platform'=>'', 'license' => '', 'licenseContent' => '', 'gitURL' => '', @@ -246,6 +247,17 @@ public function setVersion($text) return $this; } + /** + * @param string $text + * @return $this + */ + public function setPlatform($text) + { + $this->setParam('platform', $text); + + return $this; + } + /** * @param string $text * @return $this diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index 5442b8d538..a8d4a53531 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -10,7 +10,10 @@ class Client { this.endpoint = '{{spec.endpoint}}'; this.headers = { 'content-type': '', - 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'x-sdk-name': '{{spec.title}}', + 'x-sdk-platform':'{{sdk.platform}}', + 'x-sdk-language':'{{language.name}}', + 'x-sdk-version':'{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} From a0a6b88f1edfc8011c14014f7d34f5c349a78752 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 9 Aug 2022 14:50:43 +0000 Subject: [PATCH 212/555] add new headers for android --- .../android/library/src/main/java/io/appwrite/Client.kt.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig index 5c7ecaef5d..6107a29a69 100644 --- a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig @@ -85,7 +85,10 @@ class Client @JvmOverloads constructor( "content-type" to "application/json", "origin" to "{{ spec.title | caseLower }}-android://${context.packageName}", "user-agent" to "${context.packageName}/${appVersion}, ${System.getProperty("http.agent")}", - "x-sdk-version" to "{{spec.title | caseDash}}:{{ language.name | caseLower }}:${BuildConfig.SDK_VERSION}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} + "x-sdk-name" to "{{spec.title}}", + "x-sdk-platform" to "{{sdk.platform}}", + "x-sdk-language" to "{{language.name}}", + "x-sdk-version" to "{{ sdk.version }}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} "{{ key | caseLower }}" to "{{ header }}"{% if not loop.last %},{% endif %} From f513d19f47427a11fca3cf86748fddf5dc47560d Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 9 Aug 2022 14:53:17 +0000 Subject: [PATCH 213/555] add new headers to CLI --- templates/cli/lib/client.js.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/cli/lib/client.js.twig b/templates/cli/lib/client.js.twig index fa05257ee6..952b23e13d 100644 --- a/templates/cli/lib/client.js.twig +++ b/templates/cli/lib/client.js.twig @@ -12,7 +12,10 @@ class Client { this.endpoint = '{{spec.endpoint}}'; this.headers = { 'content-type': '', - 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'x-sdk-name': '{{spec.title}}', + 'x-sdk-platform':'{{sdk.platform}}', + 'x-sdk-language':'{{language.name}}', + 'x-sdk-version':'{{ sdk.version }}', 'User-Agent' : `{{spec.title | caseUcfirst}}CLI/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})`, {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', From 0dec7c8953ceb0d372d883020f767cae8d720fd3 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 9 Aug 2022 14:56:29 +0000 Subject: [PATCH 214/555] add new headers to dart --- templates/dart/lib/src/client_browser.dart.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/dart/lib/src/client_browser.dart.twig b/templates/dart/lib/src/client_browser.dart.twig index 69e34fc9ee..dd76b1f72c 100644 --- a/templates/dart/lib/src/client_browser.dart.twig +++ b/templates/dart/lib/src/client_browser.dart.twig @@ -30,7 +30,10 @@ class ClientBrowser extends ClientBase with ClientMixin { _httpClient = BrowserClient(); _headers = { 'content-type': 'application/json', - 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'x-sdk-name': '{{spec.title}}', + 'x-sdk-platform':'{{sdk.platform}}', + 'x-sdk-language':'{{language.name}}', + 'x-sdk-version':'{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} From 041d0b223f706cdde85ee338f406804b0171805c Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 9 Aug 2022 15:02:33 +0000 Subject: [PATCH 215/555] add new headers to deno --- templates/deno/src/client.ts.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/deno/src/client.ts.twig b/templates/deno/src/client.ts.twig index 13e4444963..1b136862c6 100644 --- a/templates/deno/src/client.ts.twig +++ b/templates/deno/src/client.ts.twig @@ -11,7 +11,10 @@ export class Client { endpoint: string = 'https://appwrite.io/v1'; headers: Payload = { 'content-type': '', - 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'x-sdk-name': '{{spec.title}}', + 'x-sdk-platform':'{{sdk.platform}}', + 'x-sdk-language':'{{language.name}}', + 'x-sdk-version':'{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}':'{{header}}', {% endfor %} From 59181e29ea322f3d5686599e64cc1616cd592fba Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 9 Aug 2022 15:08:02 +0000 Subject: [PATCH 216/555] add new headers to dotnet --- templates/dotnet/src/Appwrite/Client.cs.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/dotnet/src/Appwrite/Client.cs.twig b/templates/dotnet/src/Appwrite/Client.cs.twig index e34f399c71..f0680d302a 100644 --- a/templates/dotnet/src/Appwrite/Client.cs.twig +++ b/templates/dotnet/src/Appwrite/Client.cs.twig @@ -30,7 +30,10 @@ namespace {{ spec.title | caseUcfirst }} this.headers = new Dictionary() { { "content-type", "application/json" }, - { "x-sdk-version", "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{sdk.version}}" }{% if spec.global.defaultHeaders | length > 0 %},{% endif %} + { "x-sdk-name", "{{spec.title}}" }, + { "x-sdk-platform", "{{sdk.platform}}" }, + { "x-sdk-language", "{{language.name}}" }, + { "x-sdk-version", "{{ sdk.version }}"}{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} { "{{key}}", "{{header}}" }{% if not loop.last %},{% endif %} From aa9aa6fb904bc54b90a8003561b8e6142d8e62d3 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 9 Aug 2022 15:14:13 +0000 Subject: [PATCH 217/555] add new headers to flutter --- templates/flutter/lib/src/client_browser.dart.twig | 5 ++++- templates/flutter/lib/src/client_io.dart.twig | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/flutter/lib/src/client_browser.dart.twig b/templates/flutter/lib/src/client_browser.dart.twig index 2d7cedba0d..ffa9069fbb 100644 --- a/templates/flutter/lib/src/client_browser.dart.twig +++ b/templates/flutter/lib/src/client_browser.dart.twig @@ -40,7 +40,10 @@ class ClientBrowser extends ClientBase with ClientMixin { .replaceFirst('http://', 'ws://'); _headers = { 'content-type': 'application/json', - 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'x-sdk-name': '{{spec.title}}', + 'x-sdk-platform': '{{sdk.platform}}', + 'x-sdk-language': '{{language.name}}', + 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} diff --git a/templates/flutter/lib/src/client_io.dart.twig b/templates/flutter/lib/src/client_io.dart.twig index e6659b1467..17757264b9 100644 --- a/templates/flutter/lib/src/client_io.dart.twig +++ b/templates/flutter/lib/src/client_io.dart.twig @@ -59,7 +59,10 @@ class ClientIO extends ClientBase with ClientMixin { .replaceFirst('http://', 'ws://'); _headers = { 'content-type': 'application/json', - 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'x-sdk-name': '{{spec.title}}', + 'x-sdk-platform': '{{sdk.platform}}', + 'x-sdk-language': '{{language.name}}', + 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} From 45641a7b6252b2d7263ab07237fff696e63877fa Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 9 Aug 2022 15:18:10 +0000 Subject: [PATCH 218/555] add new headers to Go --- templates/go/client.go.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/go/client.go.twig b/templates/go/client.go.twig index 12a286103d..d5de906ad7 100644 --- a/templates/go/client.go.twig +++ b/templates/go/client.go.twig @@ -65,7 +65,10 @@ func NewClient() Client { headers := map[string]string{ {% for key,header in spec.global.defaultHeaders %} "{{key}}" : "{{header}}", - "x-sdk-version": "{{ sdk.gitUserName|url_encode }}:go:{{sdk.version}}", + "x-sdk-name": "{{spec.title}}", + "x-sdk-platform": "{{sdk.platform}}", + "x-sdk-language": "{{language.name}}", + "x-sdk-version": "{{ sdk.version }}", {% endfor %} } httpClient, err := getDefaultClient(defaultTimeout) From f7655e216c54ae0464980a7db256a81a44204b77 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 9 Aug 2022 15:20:06 +0000 Subject: [PATCH 219/555] add new headers to Kotlin --- templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index de3a8bff99..357fd1e4c8 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -62,7 +62,10 @@ class Client @JvmOverloads constructor( init { headers = mutableMapOf( "content-type" to "application/json", - "x-sdk-version" to "{{spec.title | caseDash}}:{{ language.name | caseLower }}:${BuildConfig.SDK_VERSION}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} + "x-sdk-name" to "{{spec.title}}", + "x-sdk-platform" to "{{sdk.platform}}", + "x-sdk-language" to "{{language.name}}", + "x-sdk-version" to "{{ sdk.version }}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} "{{ key | caseLower }}" to "{{ header }}"{% if not loop.last %},{% endif %} From 1396d874fc11e023be013694d1e3b998529e6ebe Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 9 Aug 2022 15:22:40 +0000 Subject: [PATCH 220/555] add new headers to PHP --- templates/php/src/Client.php.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/php/src/Client.php.twig b/templates/php/src/Client.php.twig index 76bafa344d..29fbdb0ec4 100644 --- a/templates/php/src/Client.php.twig +++ b/templates/php/src/Client.php.twig @@ -37,7 +37,10 @@ class Client */ protected $headers = [ 'content-type' => '', - 'x-sdk-version' => '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'x-sdk-name'=> '{{spec.title}}', + 'x-sdk-platform'=> '{{sdk.platform}}', + 'x-sdk-language'=> '{{language.name}}', + 'x-sdk-version'=> '{{ sdk.version }}', ]; /** From 9a2a97451569839bf75bc1246917681c6f3eeaf6 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 9 Aug 2022 15:33:05 +0000 Subject: [PATCH 221/555] add new headers to templates --- templates/cli/lib/client.js.twig | 6 +++--- templates/dart/lib/src/client_browser.dart.twig | 6 +++--- templates/dart/lib/src/client_io.dart.twig | 5 ++++- templates/deno/src/client.ts.twig | 6 +++--- templates/node/lib/client.js.twig | 6 +++--- templates/python/package/client.py.twig | 5 ++++- templates/ruby/lib/container/client.rb.twig | 5 ++++- templates/swift/Sources/Client.swift.twig | 5 ++++- templates/web/src/client.ts.twig | 5 ++++- 9 files changed, 32 insertions(+), 17 deletions(-) diff --git a/templates/cli/lib/client.js.twig b/templates/cli/lib/client.js.twig index 952b23e13d..30c8bb725e 100644 --- a/templates/cli/lib/client.js.twig +++ b/templates/cli/lib/client.js.twig @@ -13,9 +13,9 @@ class Client { this.headers = { 'content-type': '', 'x-sdk-name': '{{spec.title}}', - 'x-sdk-platform':'{{sdk.platform}}', - 'x-sdk-language':'{{language.name}}', - 'x-sdk-version':'{{ sdk.version }}', + 'x-sdk-platform': '{{sdk.platform}}', + 'x-sdk-language': '{{language.name}}', + 'x-sdk-version': '{{ sdk.version }}', 'User-Agent' : `{{spec.title | caseUcfirst}}CLI/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})`, {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', diff --git a/templates/dart/lib/src/client_browser.dart.twig b/templates/dart/lib/src/client_browser.dart.twig index dd76b1f72c..2bc367b840 100644 --- a/templates/dart/lib/src/client_browser.dart.twig +++ b/templates/dart/lib/src/client_browser.dart.twig @@ -31,9 +31,9 @@ class ClientBrowser extends ClientBase with ClientMixin { _headers = { 'content-type': 'application/json', 'x-sdk-name': '{{spec.title}}', - 'x-sdk-platform':'{{sdk.platform}}', - 'x-sdk-language':'{{language.name}}', - 'x-sdk-version':'{{ sdk.version }}', + 'x-sdk-platform': '{{sdk.platform}}', + 'x-sdk-language': '{{language.name}}', + 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} diff --git a/templates/dart/lib/src/client_io.dart.twig b/templates/dart/lib/src/client_io.dart.twig index 1e9d4da38a..ce7f5cebac 100644 --- a/templates/dart/lib/src/client_io.dart.twig +++ b/templates/dart/lib/src/client_io.dart.twig @@ -39,7 +39,10 @@ class ClientIO extends ClientBase with ClientMixin { _endPoint = endPoint; _headers = { 'content-type': 'application/json', - 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'x-sdk-name': '{{spec.title}}', + 'x-sdk-platform': '{{sdk.platform}}', + 'x-sdk-language': '{{language.name}}', + 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} diff --git a/templates/deno/src/client.ts.twig b/templates/deno/src/client.ts.twig index 1b136862c6..90ba42d31e 100644 --- a/templates/deno/src/client.ts.twig +++ b/templates/deno/src/client.ts.twig @@ -12,9 +12,9 @@ export class Client { headers: Payload = { 'content-type': '', 'x-sdk-name': '{{spec.title}}', - 'x-sdk-platform':'{{sdk.platform}}', - 'x-sdk-language':'{{language.name}}', - 'x-sdk-version':'{{ sdk.version }}', + 'x-sdk-platform': '{{sdk.platform}}', + 'x-sdk-language': '{{language.name}}', + 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}':'{{header}}', {% endfor %} diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index a8d4a53531..27014a8d85 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -11,9 +11,9 @@ class Client { this.headers = { 'content-type': '', 'x-sdk-name': '{{spec.title}}', - 'x-sdk-platform':'{{sdk.platform}}', - 'x-sdk-language':'{{language.name}}', - 'x-sdk-version':'{{ sdk.version }}', + 'x-sdk-platform': '{{sdk.platform}}', + 'x-sdk-language': '{{language.name}}', + 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} diff --git a/templates/python/package/client.py.twig b/templates/python/package/client.py.twig index 5590b9a95c..6532a4384a 100644 --- a/templates/python/package/client.py.twig +++ b/templates/python/package/client.py.twig @@ -11,7 +11,10 @@ class Client: self._endpoint = '{{spec.endpoint}}' self._global_headers = { 'content-type': '', - 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'x-sdk-name': '{{spec.title}}', + 'x-sdk-platform': '{{sdk.platform}}', + 'x-sdk-language': '{{language.name}}', + 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} diff --git a/templates/ruby/lib/container/client.rb.twig b/templates/ruby/lib/container/client.rb.twig index e09b2922f5..5c5edd3b2c 100644 --- a/templates/ruby/lib/container/client.rb.twig +++ b/templates/ruby/lib/container/client.rb.twig @@ -12,7 +12,10 @@ module {{ spec.title | caseUcfirst }} @chunk_size = 5*1024*1024 @headers = { 'user-agent' => RUBY_PLATFORM + ':{{ language.name | caseLower }}-' + RUBY_VERSION, - 'x-sdk-version' => '{{ spec.title | caseDash }}:{{ language.name | caseLower }}:{{ sdk.version }}'{% if spec.global.defaultHeaders | length > 0 %},{% endif %} + 'x-sdk-name'=> '{{spec.title}}', + 'x-sdk-platform'=> '{{sdk.platform}}', + 'x-sdk-language'=> '{{language.name}}', + 'x-sdk-version'=> '{{ sdk.version }}'{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} '{{key}}' => '{{header}}'{% if not loop.last %},{% endif %} diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index 745aec5511..90e737d6ff 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -20,7 +20,10 @@ open class Client { open var headers: [String: String] = [ "content-type": "", - "x-sdk-version": "{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} + "x-sdk-name": "{{spec.title}}", + "x-sdk-platform": "{{sdk.platform}}", + "x-sdk-language": "{{language.name}}", + "x-sdk-version": "{{ sdk.version }}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} "{{key}}": "{{header}}"{% if not loop.last %},{% endif %} diff --git a/templates/web/src/client.ts.twig b/templates/web/src/client.ts.twig index df27427833..74654518a7 100644 --- a/templates/web/src/client.ts.twig +++ b/templates/web/src/client.ts.twig @@ -99,7 +99,10 @@ class Client { {% endfor %} }; headers: Headers = { - 'x-sdk-version': '{{spec.title | caseDash}}:{{ language.name | caseLower }}:{{ sdk.version }}', + 'x-sdk-name': '{{spec.title}}', + 'x-sdk-platform': '{{sdk.platform}}', + 'x-sdk-language': '{{language.name}}', + 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}': '{{header}}', {% endfor %} From c09b1ab9ecc1f91b403002276f5dabc3ad627f38 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 9 Aug 2022 23:29:53 +0530 Subject: [PATCH 222/555] feat: review comments --- src/SDK/SDK.php | 32 +++++++++---------- .../src/main/java/io/appwrite/Client.kt.twig | 6 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index c1a2a2cd05..f1356d3be8 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -193,23 +193,23 @@ public function setDefaultHeaders($headers) { } /** - * @param string $text + * @param string $namespace * @return $this */ - public function setNamespace($text) + public function setNamespace($namespace) { - $this->setParam('namespace', $text); + $this->setParam('namespace', $namespace); return $this; } /** - * @param string $text + * @param string $name * @return $this */ - public function setName($text) + public function setName($name) { - $this->setParam('name', $text); + $this->setParam('name', $name); return $this; } @@ -226,7 +226,7 @@ public function setDescription($text) } /** - * @param string $name + * @param string $text * @return $this */ public function setShortDescription($text) @@ -237,34 +237,34 @@ public function setShortDescription($text) } /** - * @param string $text + * @param string $version * @return $this */ - public function setVersion($text) + public function setVersion($version) { - $this->setParam('version', $text); + $this->setParam('version', $version); return $this; } /** - * @param string $text + * @param string $platform * @return $this */ - public function setPlatform($text) + public function setPlatform($platform) { - $this->setParam('platform', $text); + $this->setParam('platform', $platform); return $this; } /** - * @param string $text + * @param string $license * @return $this */ - public function setLicense($text) + public function setLicense($license) { - $this->setParam('license', $text); + $this->setParam('license', $license); return $this; } diff --git a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig index 6107a29a69..c42be13e97 100644 --- a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig @@ -85,9 +85,9 @@ class Client @JvmOverloads constructor( "content-type" to "application/json", "origin" to "{{ spec.title | caseLower }}-android://${context.packageName}", "user-agent" to "${context.packageName}/${appVersion}, ${System.getProperty("http.agent")}", - "x-sdk-name" to "{{spec.title}}", - "x-sdk-platform" to "{{sdk.platform}}", - "x-sdk-language" to "{{language.name}}", + "x-sdk-name" to "{{ sdk.name }}", + "x-sdk-platform" to "{{ sdk.platform }}", + "x-sdk-language" to "{{ language.name }}", "x-sdk-version" to "{{ sdk.version }}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} From 84a046ba4f67773e645750fb82f5543fb602edab Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 9 Aug 2022 23:30:51 +0530 Subject: [PATCH 223/555] feat: update CLI specs --- templates/cli/lib/client.js.twig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/cli/lib/client.js.twig b/templates/cli/lib/client.js.twig index 30c8bb725e..9c9d9610c5 100644 --- a/templates/cli/lib/client.js.twig +++ b/templates/cli/lib/client.js.twig @@ -12,11 +12,11 @@ class Client { this.endpoint = '{{spec.endpoint}}'; this.headers = { 'content-type': '', - 'x-sdk-name': '{{spec.title}}', - 'x-sdk-platform': '{{sdk.platform}}', - 'x-sdk-language': '{{language.name}}', + 'x-sdk-name': '{{ sdk.name }}', + 'x-sdk-platform': '{{ sdk.platform }}', + 'x-sdk-language': '{{ language.name }}', 'x-sdk-version': '{{ sdk.version }}', - 'User-Agent' : `{{spec.title | caseUcfirst}}CLI/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})`, + 'user-agent' : `{{spec.title | caseUcfirst}}CLI/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})`, {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', {% endfor %} From a76c97e815109fb0bfdc3631174fff536cf3e119 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 9 Aug 2022 23:33:24 +0530 Subject: [PATCH 224/555] feat: review comments --- templates/dart/lib/src/client_io.dart.twig | 6 +++--- templates/deno/src/client.ts.twig | 6 +++--- templates/dotnet/src/Appwrite/Client.cs.twig | 6 +++--- templates/flutter/lib/src/client_browser.dart.twig | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/templates/dart/lib/src/client_io.dart.twig b/templates/dart/lib/src/client_io.dart.twig index ce7f5cebac..d3abedd423 100644 --- a/templates/dart/lib/src/client_io.dart.twig +++ b/templates/dart/lib/src/client_io.dart.twig @@ -39,9 +39,9 @@ class ClientIO extends ClientBase with ClientMixin { _endPoint = endPoint; _headers = { 'content-type': 'application/json', - 'x-sdk-name': '{{spec.title}}', - 'x-sdk-platform': '{{sdk.platform}}', - 'x-sdk-language': '{{language.name}}', + 'x-sdk-name': '{{ sdk.name }}', + 'x-sdk-platform': '{{ sdk.platform }}', + 'x-sdk-language': '{{ language.name }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', diff --git a/templates/deno/src/client.ts.twig b/templates/deno/src/client.ts.twig index 90ba42d31e..b19b3694f0 100644 --- a/templates/deno/src/client.ts.twig +++ b/templates/deno/src/client.ts.twig @@ -11,9 +11,9 @@ export class Client { endpoint: string = 'https://appwrite.io/v1'; headers: Payload = { 'content-type': '', - 'x-sdk-name': '{{spec.title}}', - 'x-sdk-platform': '{{sdk.platform}}', - 'x-sdk-language': '{{language.name}}', + 'x-sdk-name': '{{ sdk.name }}', + 'x-sdk-platform': '{{ sdk.platform }}', + 'x-sdk-language': '{{ language.name }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}':'{{header}}', diff --git a/templates/dotnet/src/Appwrite/Client.cs.twig b/templates/dotnet/src/Appwrite/Client.cs.twig index f0680d302a..30056babb5 100644 --- a/templates/dotnet/src/Appwrite/Client.cs.twig +++ b/templates/dotnet/src/Appwrite/Client.cs.twig @@ -30,9 +30,9 @@ namespace {{ spec.title | caseUcfirst }} this.headers = new Dictionary() { { "content-type", "application/json" }, - { "x-sdk-name", "{{spec.title}}" }, - { "x-sdk-platform", "{{sdk.platform}}" }, - { "x-sdk-language", "{{language.name}}" }, + { "x-sdk-name", "{{ sdk.name }}" }, + { "x-sdk-platform", "{{ sdk.platform }}" }, + { "x-sdk-language", "{{ language.name }}" }, { "x-sdk-version", "{{ sdk.version }}"}{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} diff --git a/templates/flutter/lib/src/client_browser.dart.twig b/templates/flutter/lib/src/client_browser.dart.twig index ffa9069fbb..f04bbac911 100644 --- a/templates/flutter/lib/src/client_browser.dart.twig +++ b/templates/flutter/lib/src/client_browser.dart.twig @@ -40,9 +40,9 @@ class ClientBrowser extends ClientBase with ClientMixin { .replaceFirst('http://', 'ws://'); _headers = { 'content-type': 'application/json', - 'x-sdk-name': '{{spec.title}}', - 'x-sdk-platform': '{{sdk.platform}}', - 'x-sdk-language': '{{language.name}}', + 'x-sdk-name': '{{ sdk.name }}', + 'x-sdk-platform': '{{ sdk.platform }}', + 'x-sdk-language': '{{ language.name }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', From 1b47530e25358e8dcf80a5c31cb6a173fca82073 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 9 Aug 2022 23:36:22 +0530 Subject: [PATCH 225/555] feat: review comments --- templates/dart/lib/src/client_browser.dart.twig | 6 +++--- templates/flutter/lib/src/client_io.dart.twig | 6 +++--- templates/go/client.go.twig | 6 +++--- templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/templates/dart/lib/src/client_browser.dart.twig b/templates/dart/lib/src/client_browser.dart.twig index 2bc367b840..a4a2078b40 100644 --- a/templates/dart/lib/src/client_browser.dart.twig +++ b/templates/dart/lib/src/client_browser.dart.twig @@ -30,9 +30,9 @@ class ClientBrowser extends ClientBase with ClientMixin { _httpClient = BrowserClient(); _headers = { 'content-type': 'application/json', - 'x-sdk-name': '{{spec.title}}', - 'x-sdk-platform': '{{sdk.platform}}', - 'x-sdk-language': '{{language.name}}', + 'x-sdk-name': '{{ sdk.name }}', + 'x-sdk-platform': '{{ sdk.platform }}', + 'x-sdk-language': '{{ language.name }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', diff --git a/templates/flutter/lib/src/client_io.dart.twig b/templates/flutter/lib/src/client_io.dart.twig index 17757264b9..09a084cec5 100644 --- a/templates/flutter/lib/src/client_io.dart.twig +++ b/templates/flutter/lib/src/client_io.dart.twig @@ -59,9 +59,9 @@ class ClientIO extends ClientBase with ClientMixin { .replaceFirst('http://', 'ws://'); _headers = { 'content-type': 'application/json', - 'x-sdk-name': '{{spec.title}}', - 'x-sdk-platform': '{{sdk.platform}}', - 'x-sdk-language': '{{language.name}}', + 'x-sdk-name': '{{ sdk.name }}', + 'x-sdk-platform': '{{ sdk.platform }}', + 'x-sdk-language': '{{ language.name }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', diff --git a/templates/go/client.go.twig b/templates/go/client.go.twig index d5de906ad7..db95eb376f 100644 --- a/templates/go/client.go.twig +++ b/templates/go/client.go.twig @@ -65,9 +65,9 @@ func NewClient() Client { headers := map[string]string{ {% for key,header in spec.global.defaultHeaders %} "{{key}}" : "{{header}}", - "x-sdk-name": "{{spec.title}}", - "x-sdk-platform": "{{sdk.platform}}", - "x-sdk-language": "{{language.name}}", + "x-sdk-name": "{{ sdk.name }}", + "x-sdk-platform": "{{ sdk.platform }}", + "x-sdk-language": "{{ language.name }}", "x-sdk-version": "{{ sdk.version }}", {% endfor %} } diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index 357fd1e4c8..99c473c4b7 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -62,9 +62,9 @@ class Client @JvmOverloads constructor( init { headers = mutableMapOf( "content-type" to "application/json", - "x-sdk-name" to "{{spec.title}}", - "x-sdk-platform" to "{{sdk.platform}}", - "x-sdk-language" to "{{language.name}}", + "x-sdk-name" to "{{ sdk.name }}", + "x-sdk-platform" to "{{ sdk.platform }}", + "x-sdk-language" to "{{ language.name }}", "x-sdk-version" to "{{ sdk.version }}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} From 9fcff35d72095bc844048eccce7acba2961f902b Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 9 Aug 2022 23:40:02 +0530 Subject: [PATCH 226/555] feat: review comments --- templates/node/lib/client.js.twig | 6 +++--- templates/php/src/Client.php.twig | 6 +++--- templates/python/package/client.py.twig | 6 +++--- templates/ruby/lib/container/client.rb.twig | 6 +++--- templates/swift/Sources/Client.swift.twig | 6 +++--- templates/web/src/client.ts.twig | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index 27014a8d85..f622f3e4ee 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -10,9 +10,9 @@ class Client { this.endpoint = '{{spec.endpoint}}'; this.headers = { 'content-type': '', - 'x-sdk-name': '{{spec.title}}', - 'x-sdk-platform': '{{sdk.platform}}', - 'x-sdk-language': '{{language.name}}', + 'x-sdk-name': '{{ sdk.name }}', + 'x-sdk-platform': '{{ sdk.platform }}', + 'x-sdk-language': '{{ language.name }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', diff --git a/templates/php/src/Client.php.twig b/templates/php/src/Client.php.twig index 29fbdb0ec4..d53d763b1b 100644 --- a/templates/php/src/Client.php.twig +++ b/templates/php/src/Client.php.twig @@ -37,9 +37,9 @@ class Client */ protected $headers = [ 'content-type' => '', - 'x-sdk-name'=> '{{spec.title}}', - 'x-sdk-platform'=> '{{sdk.platform}}', - 'x-sdk-language'=> '{{language.name}}', + 'x-sdk-name'=> '{{ sdk.name }}', + 'x-sdk-platform'=> '{{ sdk.platform }}', + 'x-sdk-language'=> '{{ language.name }}', 'x-sdk-version'=> '{{ sdk.version }}', ]; diff --git a/templates/python/package/client.py.twig b/templates/python/package/client.py.twig index 6532a4384a..c7ce505347 100644 --- a/templates/python/package/client.py.twig +++ b/templates/python/package/client.py.twig @@ -11,9 +11,9 @@ class Client: self._endpoint = '{{spec.endpoint}}' self._global_headers = { 'content-type': '', - 'x-sdk-name': '{{spec.title}}', - 'x-sdk-platform': '{{sdk.platform}}', - 'x-sdk-language': '{{language.name}}', + 'x-sdk-name': '{{ sdk.name }}', + 'x-sdk-platform': '{{ sdk.platform }}', + 'x-sdk-language': '{{ language.name }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', diff --git a/templates/ruby/lib/container/client.rb.twig b/templates/ruby/lib/container/client.rb.twig index 5c5edd3b2c..2e20873fb2 100644 --- a/templates/ruby/lib/container/client.rb.twig +++ b/templates/ruby/lib/container/client.rb.twig @@ -12,9 +12,9 @@ module {{ spec.title | caseUcfirst }} @chunk_size = 5*1024*1024 @headers = { 'user-agent' => RUBY_PLATFORM + ':{{ language.name | caseLower }}-' + RUBY_VERSION, - 'x-sdk-name'=> '{{spec.title}}', - 'x-sdk-platform'=> '{{sdk.platform}}', - 'x-sdk-language'=> '{{language.name}}', + 'x-sdk-name'=> '{{ sdk.name }}', + 'x-sdk-platform'=> '{{ sdk.platform }}', + 'x-sdk-language'=> '{{ language.name }}', 'x-sdk-version'=> '{{ sdk.version }}'{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index 90e737d6ff..5877f235ba 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -20,9 +20,9 @@ open class Client { open var headers: [String: String] = [ "content-type": "", - "x-sdk-name": "{{spec.title}}", - "x-sdk-platform": "{{sdk.platform}}", - "x-sdk-language": "{{language.name}}", + "x-sdk-name": "{{ sdk.name }}", + "x-sdk-platform": "{{ sdk.platform }}", + "x-sdk-language": "{{ language.name }}", "x-sdk-version": "{{ sdk.version }}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} diff --git a/templates/web/src/client.ts.twig b/templates/web/src/client.ts.twig index 74654518a7..d7391e3ed5 100644 --- a/templates/web/src/client.ts.twig +++ b/templates/web/src/client.ts.twig @@ -99,9 +99,9 @@ class Client { {% endfor %} }; headers: Headers = { - 'x-sdk-name': '{{spec.title}}', - 'x-sdk-platform': '{{sdk.platform}}', - 'x-sdk-language': '{{language.name}}', + 'x-sdk-name': '{{ sdk.name }}', + 'x-sdk-platform': '{{ sdk.platform }}', + 'x-sdk-language': '{{ language.name }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}': '{{header}}', From c96628c7a1c679431089adccbc6bf754729ce044 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 10 Aug 2022 06:58:17 +0545 Subject: [PATCH 227/555] check if init is already in progress --- templates/flutter/lib/src/client_io.dart.twig | 8 ++++++++ templates/flutter/lib/src/realtime_io.dart.twig | 3 +++ 2 files changed, 11 insertions(+) diff --git a/templates/flutter/lib/src/client_io.dart.twig b/templates/flutter/lib/src/client_io.dart.twig index e6659b1467..7293b52b6d 100644 --- a/templates/flutter/lib/src/client_io.dart.twig +++ b/templates/flutter/lib/src/client_io.dart.twig @@ -34,6 +34,7 @@ class ClientIO extends ClientBase with ClientMixin { @override late Map config; bool selfSigned; + bool _initProgress = false; bool _initialized = false; String? _endPointRealtime; late http.Client _httpClient; @@ -41,6 +42,7 @@ class ClientIO extends ClientBase with ClientMixin { late CookieJar _cookieJar; final List _interceptors = []; + bool get initProgress => _initProgress; bool get initialized => _initialized; CookieJar get cookieJar => _cookieJar; @override @@ -126,6 +128,8 @@ class ClientIO extends ClientBase with ClientMixin { } Future init() async { + if(_initProgress) return; + _initProgress = true; // if web skip cookie implementation and origin header as those are automatically handled by browsers final Directory cookieDir = await _getCookiePath(); _cookieJar = PersistCookieJar(storage: FileStorage(cookieDir.path)); @@ -168,6 +172,7 @@ class ClientIO extends ClientBase with ClientMixin { 'user-agent', '${packageInfo.packageName}/${packageInfo.version} $device'); _initialized = true; + _initProgress = false; } Future _interceptRequest(http.BaseRequest request) async { @@ -326,6 +331,9 @@ class ClientIO extends ClientBase with ClientMixin { Map params = const {}, ResponseType? responseType, }) async { + while (!_initialized && _initProgress) { + await Future.delayed(Duration(milliseconds: 10)); + } if (!_initialized) { await init(); } diff --git a/templates/flutter/lib/src/realtime_io.dart.twig b/templates/flutter/lib/src/realtime_io.dart.twig index c82d7dcdae..819e938f0a 100644 --- a/templates/flutter/lib/src/realtime_io.dart.twig +++ b/templates/flutter/lib/src/realtime_io.dart.twig @@ -23,6 +23,9 @@ class RealtimeIO extends RealtimeBase with RealtimeMixin { Future _getWebSocket(Uri uri) async { Map? headers; + while (!(client as ClientIO).initialized && (client as ClientIO).initProgress) { + await Future.delayed(Duration(milliseconds: 10)); + } if (!(client as ClientIO).initialized) { await (client as ClientIO).init(); } From d655cb7d1a0bce09f6fe305786c256222f8b1be7 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 10 Aug 2022 06:49:31 +0000 Subject: [PATCH 228/555] remove global reference --- templates/kotlin/base/utils.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/kotlin/base/utils.twig b/templates/kotlin/base/utils.twig index 4d933c9513..8770b8a947 100644 --- a/templates/kotlin/base/utils.twig +++ b/templates/kotlin/base/utils.twig @@ -1,6 +1,6 @@ {% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} {% macro method_parameters(parameters, consumes) %} -{% if parameters.all|length > 0 %}{% for parameter in parameters.all | filter((param) => not param.isGlobal) %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} +{% if parameters.all|length > 0 %}{% for parameter in parameters.all %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} {% endmacro %} {% macro methodNeedsSecurityParameters(method) %} {% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} From 4ce931c3bc26278cb143b088a4ee8d84a62e4481 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 10 Aug 2022 07:30:08 +0000 Subject: [PATCH 229/555] fix deno test --- templates/deno/src/services/service.ts.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index 7d38705b4b..90090ca99f 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -58,12 +58,12 @@ export class {{ service.name | caseUcfirst }} extends Service { * {% endif %} {% for parameter in method.parameters.all%} - * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} + * @param {{ '{' }}{{ parameter | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {AppwriteException} * @returns {Promise} */ - async {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): Promise<{% if method.type == 'webAuth' %}Response{% elseif method.type == 'location' %}Response{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}> { + async {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): Promise<{% if method.type == 'webAuth' %}Response{% elseif method.type == 'location' %}Response{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}> { {% for parameter in method.parameters.all %} {% if parameter.required %} if (typeof {{ parameter.name | caseCamel | escapeKeyword }} === 'undefined') { From dc53071163e26dcdabe46e22218af09a30d09eb3 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 10 Aug 2022 07:34:32 +0000 Subject: [PATCH 230/555] fix node template after merge --- templates/node/index.d.ts.twig | 4 ++-- templates/node/lib/services/service.js.twig | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/node/index.d.ts.twig b/templates/node/index.d.ts.twig index 28d4e22715..52720ff1b8 100644 --- a/templates/node/index.d.ts.twig +++ b/templates/node/index.d.ts.twig @@ -196,12 +196,12 @@ declare module "{{ language.params.npmPackage|caseDash }}" { * {% endif %} {% for parameter in method.parameters.all %} - * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel }} + * @param {{ '{' }}{{ parameter | typeName }}{{ '}' }} {{ parameter.name | caseCamel }} {% endfor %} * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {Promise} */ - {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter.type | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}): Promise<{% if method.type == 'location' %}Buffer{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}>; + {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}): Promise<{% if method.type == 'location' %}Buffer{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}>; {% endfor %} } {% endfor %} diff --git a/templates/node/lib/services/service.js.twig b/templates/node/lib/services/service.js.twig index c599c44743..5cc919ab33 100644 --- a/templates/node/lib/services/service.js.twig +++ b/templates/node/lib/services/service.js.twig @@ -23,7 +23,7 @@ class {{ service.name | caseUcfirst }} extends Service { * {% endif %} {% for parameter in method.parameters.all %} - * @param {{ '{' }}{{ parameter.type | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} + * @param {{ '{' }}{{ parameter | typeName }}{{ '}' }} {{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {Promise} From f37570ece289e465dbe94dc937a20c01505cc8a6 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 10 Aug 2022 07:47:51 +0000 Subject: [PATCH 231/555] fix swift template after merge --- templates/swift/Sources/Services/Service.swift.twig | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index 1306f34e4a..714e1514c7 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -7,12 +7,6 @@ import NIO import {{spec.title | caseUcfirst}}Models open class {{ service.name | caseUcfirst }}: Service { - - public init(_ client: client) - { - super.init(client) - } - {% for method in service.methods %} /// /// {{ method.title }} @@ -32,7 +26,7 @@ open class {{ service.name | caseUcfirst }}: Service { {% endif %} open func {{ method.name | caseCamel }}( {% for parameter in method.parameters.all %} - {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} + {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} {% endfor %} {% if 'multipart/form-data' in method.consumes %} @@ -76,7 +70,7 @@ open class {{ service.name | caseUcfirst }}: Service { /// {% endif %} {% for parameter in method.parameters.all %} - /// @param {{ parameter.type | typeName | raw}} {{ parameter.name | caseCamel }} + /// @param {{ parameter | typeName | raw}} {{ parameter.name | caseCamel }} {% endfor %} /// @throws Exception /// @return array @@ -87,7 +81,7 @@ open class {{ service.name | caseUcfirst }}: Service { {% endif %} open func {{ method.name | caseCamel }}( {% for parameter in method.parameters.all %} - {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.type | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}, + {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}, {% endfor %} {% if 'multipart/form-data' in method.consumes %} onProgress: ((UploadProgress) -> Void)? = nil, From 5ab956bf074bc664e3e4177351bbdaae285f9165 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 10 Aug 2022 09:30:16 +0000 Subject: [PATCH 232/555] fix php templates --- templates/php/src/Services/Service.php.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/php/src/Services/Service.php.twig b/templates/php/src/Services/Service.php.twig index 24706fd761..3e110cffea 100644 --- a/templates/php/src/Services/Service.php.twig +++ b/templates/php/src/Services/Service.php.twig @@ -23,13 +23,13 @@ class {{ service.name | caseUcfirst }} extends Service * {% endif %} {% for parameter in method.parameters.all %} - * @param {{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }} + * @param {{ parameter | typeName }}${{ parameter.name | caseCamel | escapeKeyword }} {% endfor %} * @throws {{spec.title | caseUcfirst}}Exception * @return {{ method | getReturn }} */ - public function {{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{{ parameter.type | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, callable $onProgress = null{% endif %}): {{ method | getReturn }} + public function {{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{{ parameter | typeName }}${{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %} = null{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, callable $onProgress = null{% endif %}): {{ method | getReturn }} { $path = str_replace([{% for parameter in method.parameters.path %}'{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}'{% if not loop.last %}, {% endif %}{% endfor %}], [{% for parameter in method.parameters.path %}${{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %}, {% endif %}{% endfor %}], '{{ method.path }}'); From 2a740853fe581070d0f712b9cf70c342a08f56fe Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 10 Aug 2022 15:16:50 +0530 Subject: [PATCH 233/555] feat: add tests --- .../src/main/java/io/appwrite/Client.kt.twig | 2 +- templates/cli/lib/client.js.twig | 2 +- .../dart/lib/src/client_browser.dart.twig | 2 +- templates/dart/lib/src/client_io.dart.twig | 2 +- templates/deno/src/client.ts.twig | 2 +- templates/dotnet/src/Appwrite/Client.cs.twig | 2 +- .../flutter/lib/src/client_browser.dart.twig | 2 +- templates/flutter/lib/src/client_io.dart.twig | 2 +- templates/go/client.go.twig | 2 +- .../main/kotlin/io/appwrite/Client.kt.twig | 2 +- templates/node/lib/client.js.twig | 2 +- templates/php/src/Client.php.twig | 2 +- templates/python/package/client.py.twig | 2 +- templates/ruby/lib/container/client.rb.twig | 2 +- templates/swift/Sources/Client.swift.twig | 2 +- templates/web/src/client.ts.twig | 2 +- tests/Base.php | 14 +- tests/KotlinJava17Test.php | 5 + tests/Node12Test.php | 6 + tests/Node14Test.php | 5 + tests/Node16Test.php | 5 + tests/PHP74Test.php | 5 + tests/languages/kotlin/Tests.kt | 6 + tests/languages/node/test.js | 10 +- tests/languages/php/test.php | 6 + tests/resources/spec.json | 240 +++++++++--------- 26 files changed, 201 insertions(+), 133 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig index c42be13e97..aafc05d50a 100644 --- a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig @@ -87,7 +87,7 @@ class Client @JvmOverloads constructor( "user-agent" to "${context.packageName}/${appVersion}, ${System.getProperty("http.agent")}", "x-sdk-name" to "{{ sdk.name }}", "x-sdk-platform" to "{{ sdk.platform }}", - "x-sdk-language" to "{{ language.name }}", + "x-sdk-language" to "{{ language.name | caseLower }}", "x-sdk-version" to "{{ sdk.version }}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} diff --git a/templates/cli/lib/client.js.twig b/templates/cli/lib/client.js.twig index 9c9d9610c5..b13764a122 100644 --- a/templates/cli/lib/client.js.twig +++ b/templates/cli/lib/client.js.twig @@ -14,7 +14,7 @@ class Client { 'content-type': '', 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', - 'x-sdk-language': '{{ language.name }}', + 'x-sdk-language': '{{ language.name | caseLower }}', 'x-sdk-version': '{{ sdk.version }}', 'user-agent' : `{{spec.title | caseUcfirst}}CLI/{{ sdk.version }} (${os.type()} ${os.version()}; ${os.arch()})`, {% for key,header in spec.global.defaultHeaders %} diff --git a/templates/dart/lib/src/client_browser.dart.twig b/templates/dart/lib/src/client_browser.dart.twig index a4a2078b40..230e345e9b 100644 --- a/templates/dart/lib/src/client_browser.dart.twig +++ b/templates/dart/lib/src/client_browser.dart.twig @@ -32,7 +32,7 @@ class ClientBrowser extends ClientBase with ClientMixin { 'content-type': 'application/json', 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', - 'x-sdk-language': '{{ language.name }}', + 'x-sdk-language': '{{ language.name | caseLower }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', diff --git a/templates/dart/lib/src/client_io.dart.twig b/templates/dart/lib/src/client_io.dart.twig index d3abedd423..5b7e291c83 100644 --- a/templates/dart/lib/src/client_io.dart.twig +++ b/templates/dart/lib/src/client_io.dart.twig @@ -41,7 +41,7 @@ class ClientIO extends ClientBase with ClientMixin { 'content-type': 'application/json', 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', - 'x-sdk-language': '{{ language.name }}', + 'x-sdk-language': '{{ language.name | caseLower }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', diff --git a/templates/deno/src/client.ts.twig b/templates/deno/src/client.ts.twig index b19b3694f0..61f08936ff 100644 --- a/templates/deno/src/client.ts.twig +++ b/templates/deno/src/client.ts.twig @@ -13,7 +13,7 @@ export class Client { 'content-type': '', 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', - 'x-sdk-language': '{{ language.name }}', + 'x-sdk-language': '{{ language.name | caseLower }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}':'{{header}}', diff --git a/templates/dotnet/src/Appwrite/Client.cs.twig b/templates/dotnet/src/Appwrite/Client.cs.twig index 30056babb5..906012d673 100644 --- a/templates/dotnet/src/Appwrite/Client.cs.twig +++ b/templates/dotnet/src/Appwrite/Client.cs.twig @@ -32,7 +32,7 @@ namespace {{ spec.title | caseUcfirst }} { "content-type", "application/json" }, { "x-sdk-name", "{{ sdk.name }}" }, { "x-sdk-platform", "{{ sdk.platform }}" }, - { "x-sdk-language", "{{ language.name }}" }, + { "x-sdk-language", "{{ language.name | caseLower }}" }, { "x-sdk-version", "{{ sdk.version }}"}{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} diff --git a/templates/flutter/lib/src/client_browser.dart.twig b/templates/flutter/lib/src/client_browser.dart.twig index f04bbac911..951699d939 100644 --- a/templates/flutter/lib/src/client_browser.dart.twig +++ b/templates/flutter/lib/src/client_browser.dart.twig @@ -42,7 +42,7 @@ class ClientBrowser extends ClientBase with ClientMixin { 'content-type': 'application/json', 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', - 'x-sdk-language': '{{ language.name }}', + 'x-sdk-language': '{{ language.name | caseLower }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', diff --git a/templates/flutter/lib/src/client_io.dart.twig b/templates/flutter/lib/src/client_io.dart.twig index 09a084cec5..df8aeba08e 100644 --- a/templates/flutter/lib/src/client_io.dart.twig +++ b/templates/flutter/lib/src/client_io.dart.twig @@ -61,7 +61,7 @@ class ClientIO extends ClientBase with ClientMixin { 'content-type': 'application/json', 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', - 'x-sdk-language': '{{ language.name }}', + 'x-sdk-language': '{{ language.name | caseLower }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', diff --git a/templates/go/client.go.twig b/templates/go/client.go.twig index db95eb376f..e9fdf06ef6 100644 --- a/templates/go/client.go.twig +++ b/templates/go/client.go.twig @@ -67,7 +67,7 @@ func NewClient() Client { "{{key}}" : "{{header}}", "x-sdk-name": "{{ sdk.name }}", "x-sdk-platform": "{{ sdk.platform }}", - "x-sdk-language": "{{ language.name }}", + "x-sdk-language": "{{ language.name | caseLower }}", "x-sdk-version": "{{ sdk.version }}", {% endfor %} } diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index 99c473c4b7..d528583db3 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -64,7 +64,7 @@ class Client @JvmOverloads constructor( "content-type" to "application/json", "x-sdk-name" to "{{ sdk.name }}", "x-sdk-platform" to "{{ sdk.platform }}", - "x-sdk-language" to "{{ language.name }}", + "x-sdk-language" to "{{ language.name | caseLower }}", "x-sdk-version" to "{{ sdk.version }}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index f622f3e4ee..07a4928fe6 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -12,7 +12,7 @@ class Client { 'content-type': '', 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', - 'x-sdk-language': '{{ language.name }}', + 'x-sdk-language': '{{ language.name | caseLower }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', diff --git a/templates/php/src/Client.php.twig b/templates/php/src/Client.php.twig index d53d763b1b..040b13aa7a 100644 --- a/templates/php/src/Client.php.twig +++ b/templates/php/src/Client.php.twig @@ -39,7 +39,7 @@ class Client 'content-type' => '', 'x-sdk-name'=> '{{ sdk.name }}', 'x-sdk-platform'=> '{{ sdk.platform }}', - 'x-sdk-language'=> '{{ language.name }}', + 'x-sdk-language'=> '{{ language.name | caseLower }}', 'x-sdk-version'=> '{{ sdk.version }}', ]; diff --git a/templates/python/package/client.py.twig b/templates/python/package/client.py.twig index c7ce505347..0d5b2fbb9f 100644 --- a/templates/python/package/client.py.twig +++ b/templates/python/package/client.py.twig @@ -13,7 +13,7 @@ class Client: 'content-type': '', 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', - 'x-sdk-language': '{{ language.name }}', + 'x-sdk-language': '{{ language.name | caseLower }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}' : '{{header}}', diff --git a/templates/ruby/lib/container/client.rb.twig b/templates/ruby/lib/container/client.rb.twig index 2e20873fb2..fc0762dc97 100644 --- a/templates/ruby/lib/container/client.rb.twig +++ b/templates/ruby/lib/container/client.rb.twig @@ -14,7 +14,7 @@ module {{ spec.title | caseUcfirst }} 'user-agent' => RUBY_PLATFORM + ':{{ language.name | caseLower }}-' + RUBY_VERSION, 'x-sdk-name'=> '{{ sdk.name }}', 'x-sdk-platform'=> '{{ sdk.platform }}', - 'x-sdk-language'=> '{{ language.name }}', + 'x-sdk-language'=> '{{ language.name | caseLower }}', 'x-sdk-version'=> '{{ sdk.version }}'{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index 5877f235ba..fb5b661f84 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -22,7 +22,7 @@ open class Client { "content-type": "", "x-sdk-name": "{{ sdk.name }}", "x-sdk-platform": "{{ sdk.platform }}", - "x-sdk-language": "{{ language.name }}", + "x-sdk-language": "{{ language.name | caseLower }}", "x-sdk-version": "{{ sdk.version }}"{% if spec.global.defaultHeaders | length > 0 %},{% endif %} {% for key,header in spec.global.defaultHeaders %} diff --git a/templates/web/src/client.ts.twig b/templates/web/src/client.ts.twig index d7391e3ed5..f952c31c25 100644 --- a/templates/web/src/client.ts.twig +++ b/templates/web/src/client.ts.twig @@ -101,7 +101,7 @@ class Client { headers: Headers = { 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', - 'x-sdk-language': '{{ language.name }}', + 'x-sdk-language': '{{ language.name | caseLower }}', 'x-sdk-version': '{{ sdk.version }}', {% for key,header in spec.global.defaultHeaders %} '{{key}}': '{{header}}', diff --git a/tests/Base.php b/tests/Base.php index 88f6584c10..8811181762 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -66,6 +66,14 @@ abstract class Base extends TestCase public function setUp(): void { + $headers = [ + "x-sdk-name : {$this->sdkName}", + "x-sdk-platform : {$this->sdkPlatform}", + "x-sdk-language : {$this->sdkLanguage}", + "x-sdk-version : {$this->version}", + ]; + + $this->expectedOutput = array_merge($this->expectedOutput, $headers); } public function tearDown(): void @@ -83,11 +91,13 @@ public function testHTTPSuccess(): void $sdk = new SDK($this->getLanguage(), new Swagger2($spec)); $sdk + ->setName($this->sdkName) + ->setVersion($this->version) + ->setPlatform($this->sdkPlatform) ->setDescription('Repo description goes here') ->setShortDescription('Repo short description goes here') ->setLogo('https://appwrite.io/v1/images/console.png') ->setWarning('**WORK IN PROGRESS - THIS IS JUST A TEST SDK**') - ->setVersion('0.0.1') ->setExamples('**EXAMPLES** ') ->setNamespace("io appwrite") ->setGitUserName('repoowner') @@ -144,7 +154,7 @@ public function testHTTPSuccess(): void $removed = array_shift($output); } while ($removed != 'Test Started' && sizeof($output) != 0); - $this->assertGreaterThanOrEqual(count($this->expectedOutput), count($output)); + $this->assertEquals(count($this->expectedOutput), count($output)); foreach ($this->expectedOutput as $i => $row) { $this->assertEquals($output[$i], $row); diff --git a/tests/KotlinJava17Test.php b/tests/KotlinJava17Test.php index ac86db5b8b..df86b78c5e 100644 --- a/tests/KotlinJava17Test.php +++ b/tests/KotlinJava17Test.php @@ -4,6 +4,11 @@ class KotlinJava17Test extends Base { + protected string $sdkName = 'kotlin'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'kotlin'; + protected string $version = '0.0.1'; + protected string $language = 'kotlin'; protected string $class = 'Appwrite\SDK\Language\Kotlin'; protected array $build = [ diff --git a/tests/Node12Test.php b/tests/Node12Test.php index d7d72158bb..1b464ae1fe 100644 --- a/tests/Node12Test.php +++ b/tests/Node12Test.php @@ -4,7 +4,13 @@ class Node12Test extends Base { + protected string $sdkName = 'node.js'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'nodejs'; + protected string $version = '0.0.1'; + protected string $language = 'node'; + protected string $class = 'Appwrite\SDK\Language\Node'; protected array $build = [ 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/node node:12-alpine npm install', diff --git a/tests/Node14Test.php b/tests/Node14Test.php index 80b6ce7eb6..638b09350d 100644 --- a/tests/Node14Test.php +++ b/tests/Node14Test.php @@ -4,6 +4,11 @@ class Node14Test extends Base { + protected string $sdkName = 'node.js'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'nodejs'; + protected string $version = '0.0.1'; + protected string $language = 'node'; protected string $class = 'Appwrite\SDK\Language\Node'; protected array $build = [ diff --git a/tests/Node16Test.php b/tests/Node16Test.php index 7edda1f12c..80873ceef2 100644 --- a/tests/Node16Test.php +++ b/tests/Node16Test.php @@ -4,6 +4,11 @@ class Node16Test extends Base { + protected string $sdkName = 'node.js'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'nodejs'; + protected string $version = '0.0.1'; + protected string $language = 'node'; protected string $class = 'Appwrite\SDK\Language\Node'; protected array $build = [ diff --git a/tests/PHP74Test.php b/tests/PHP74Test.php index 22f3ef6645..cf8edd9a62 100644 --- a/tests/PHP74Test.php +++ b/tests/PHP74Test.php @@ -4,6 +4,11 @@ class PHP74Test extends Base { + protected string $sdkName = 'php'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'php'; + protected string $version = '0.0.1'; + protected string $language = 'php'; protected string $class = 'Appwrite\SDK\Language\PHP'; protected array $build = []; diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt index 0e449fef2c..360b8156cf 100644 --- a/tests/languages/kotlin/Tests.kt +++ b/tests/languages/kotlin/Tests.kt @@ -115,6 +115,12 @@ class ServiceTest { } general.empty() + + // Header Tests + writeToFile(client.headers['x-sdk-name']); + writeToFile(client.headers['x-sdk-platform']); + writeToFile(client.headers['x-sdk-language']); + writeToFile(client.headers['x-sdk-version']); } } diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index 7f48708bfa..63091e4ec7 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -18,7 +18,6 @@ async function start() { console.log('\nTest Started'); // Foo - response = await foo.get(123, ['string in array']); console.log(response.result); @@ -79,6 +78,15 @@ async function start() { } await general.empty(); + + response = await general.headers(); + console.log(response.result); + + // Header Tests + console.log(`x-sdk-name : ${client.headers['x-sdk-name']}`) + console.log(`x-sdk-platform : ${client.headers['x-sdk-platform']}`) + console.log(`x-sdk-language : ${client.headers['x-sdk-language']}`) + console.log(`x-sdk-version : ${client.headers['x-sdk-version']}`) } start().catch((err) => { diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index 9a6ec906d5..daeafdea11 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -94,3 +94,9 @@ } $general->empty(); + +// Header Tests +echo "x-sdk-name : {$client->headers['x-sdk-name']}" +console.log(`x-sdk-platform : ${client.headers['x-sdk-platform']}`) +console.log(`x-sdk-language : ${client.headers['x-sdk-language']}`) +console.log(`x-sdk-version : ${client.headers['x-sdk-version']}`) \ No newline at end of file diff --git a/tests/resources/spec.json b/tests/resources/spec.json index deeb42d6b6..cbcc8111f0 100644 --- a/tests/resources/spec.json +++ b/tests/resources/spec.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "0.10.4", + "version": "0.15.3", "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", @@ -15,7 +15,7 @@ "url": "https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE" } }, - "host": "appwrite.io", + "host": "HOSTNAME", "basePath": "/v1", "schemes": ["https"], "consumes": ["application/json", "multipart/form-data"], @@ -28,6 +28,13 @@ "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", @@ -60,7 +67,7 @@ }, "x-appwrite": { "method": "get", - "weight": 187, + "weight": 232, "cookies": false, "type": "", "demo": "bar/get.md", @@ -71,9 +78,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }], + "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ { "name": "required", @@ -117,7 +124,7 @@ }, "x-appwrite": { "method": "post", - "weight": 188, + "weight": 233, "cookies": false, "type": "", "demo": "bar/post.md", @@ -128,9 +135,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }], + "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ { "name": "payload", @@ -178,7 +185,7 @@ }, "x-appwrite": { "method": "put", - "weight": 190, + "weight": 235, "cookies": false, "type": "", "demo": "bar/put.md", @@ -189,9 +196,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }], + "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ { "name": "payload", @@ -239,7 +246,7 @@ }, "x-appwrite": { "method": "patch", - "weight": 189, + "weight": 234, "cookies": false, "type": "", "demo": "bar/patch.md", @@ -250,9 +257,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }], + "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ { "name": "payload", @@ -300,7 +307,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 191, + "weight": 236, "cookies": false, "type": "", "demo": "bar/delete.md", @@ -311,9 +318,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }], + "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ { "name": "payload", @@ -363,7 +370,7 @@ }, "x-appwrite": { "method": "get", - "weight": 182, + "weight": 227, "cookies": false, "type": "", "demo": "foo/get.md", @@ -374,16 +381,15 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }], + "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ { "name": "x", "description": "Sample string param", "required": true, "type": "string", - "x-global": true, "x-example": "[]", "in": "query" }, @@ -421,7 +427,7 @@ }, "x-appwrite": { "method": "post", - "weight": 183, + "weight": 228, "cookies": false, "type": "", "demo": "foo/post.md", @@ -432,9 +438,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }], + "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ { "name": "payload", @@ -446,7 +452,6 @@ "type": "string", "description": "Sample string param", "default": null, - "x-global": true, "x-example": "[]" }, "y": { @@ -483,7 +488,7 @@ }, "x-appwrite": { "method": "put", - "weight": 185, + "weight": 230, "cookies": false, "type": "", "demo": "foo/put.md", @@ -494,9 +499,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }], + "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ { "name": "payload", @@ -508,7 +513,6 @@ "type": "string", "description": "Sample string param", "default": null, - "x-global": true, "x-example": "[]" }, "y": { @@ -545,7 +549,7 @@ }, "x-appwrite": { "method": "patch", - "weight": 184, + "weight": 229, "cookies": false, "type": "", "demo": "foo/patch.md", @@ -556,9 +560,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }], + "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ { "name": "payload", @@ -570,7 +574,6 @@ "type": "string", "description": "Sample string param", "default": null, - "x-global": true, "x-example": "[]" }, "y": { @@ -607,7 +610,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 186, + "weight": 231, "cookies": false, "type": "", "demo": "foo/delete.md", @@ -618,9 +621,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }], + "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ { "name": "payload", @@ -632,7 +635,6 @@ "type": "string", "description": "Sample string param", "default": null, - "x-global": true, "x-example": "[]" }, "y": { @@ -671,7 +673,7 @@ }, "x-appwrite": { "method": "error400", - "weight": 199, + "weight": 245, "cookies": false, "type": "", "demo": "general/error400.md", @@ -682,9 +684,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }] + "security": [{ "Project": [], "Key": [], "JWT": [] }] } }, "/mock/tests/general/500-error": { @@ -703,7 +705,7 @@ }, "x-appwrite": { "method": "error500", - "weight": 200, + "weight": 246, "cookies": false, "type": "", "demo": "general/error500.md", @@ -714,41 +716,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } - }, - "security": [{ "Project": [], "JWT": [] }] - } - }, - "/mock/tests/general/502-error": { - "get": { - "summary": "502 Error", - "operationId": "generalError502", - "consumes": ["application/json"], - "produces": ["text/plain"], - "tags": ["general"], - "description": "", - "responses": { - "502": { - "description": "Any", - "schema": { "$ref": "#/definitions/any" } - } - }, - "x-appwrite": { - "method": "error502", - "weight": 201, - "cookies": false, - "type": "", - "demo": "general/error502.md", - "edit": "https://github.com/appwrite/appwrite/edit/masterMock a 502 bad gateway.", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "public", - "platforms": ["client"], - "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [] }] + "security": [{ "Project": [], "Key": [], "JWT": [] }] } }, "/mock/tests/general/download": { @@ -764,7 +734,7 @@ }, "x-appwrite": { "method": "download", - "weight": 192, + "weight": 237, "cookies": false, "type": "location", "demo": "general/download.md", @@ -775,9 +745,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }] + "security": [{ "Project": [], "Key": [], "JWT": [] }] } }, "/mock/tests/general/empty": { @@ -791,7 +761,7 @@ "responses": { "204": { "description": "No content" } }, "x-appwrite": { "method": "empty", - "weight": 198, + "weight": 243, "cookies": false, "type": "", "demo": "general/empty.md", @@ -802,9 +772,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }] + "security": [{ "Project": [], "Key": [], "JWT": [] }] } }, "/mock/tests/general/get-cookie": { @@ -823,7 +793,7 @@ }, "x-appwrite": { "method": "getCookie", - "weight": 197, + "weight": 242, "cookies": false, "type": "", "demo": "general/get-cookie.md", @@ -834,9 +804,41 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } + }, + "security": [{ "Project": [], "Key": [], "JWT": [] }] + } + }, + "/mock/tests/general/headers": { + "get": { + "summary": "Get headers", + "operationId": "generalHeaders", + "consumes": ["application/json"], + "produces": [], + "tags": ["general"], + "description": "", + "responses": { + "200": { + "description": "Mock", + "schema": { "$ref": "#/definitions/mock" } + } + }, + "x-appwrite": { + "method": "headers", + "weight": 244, + "cookies": false, + "type": "", + "demo": "general/headers.md", + "edit": "https://github.com/appwrite/appwrite/edit/masterReturn headers from the request", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": ["client", "server", "server"], + "packaging": false, + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }] + "security": [{ "Project": [], "Key": [], "JWT": [] }] } }, "/mock/tests/general/redirect": { @@ -850,7 +852,7 @@ "responses": { "301": { "description": "No content" } }, "x-appwrite": { "method": "redirect", - "weight": 194, + "weight": 239, "cookies": false, "type": "", "demo": "general/redirect.md", @@ -861,9 +863,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }] + "security": [{ "Project": [], "Key": [], "JWT": [] }] } }, "/mock/tests/general/redirect/done": { @@ -882,7 +884,7 @@ }, "x-appwrite": { "method": "redirected", - "weight": 195, + "weight": 240, "cookies": false, "type": "", "demo": "general/redirected.md", @@ -893,9 +895,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }] + "security": [{ "Project": [], "Key": [], "JWT": [] }] } }, "/mock/tests/general/set-cookie": { @@ -914,7 +916,7 @@ }, "x-appwrite": { "method": "setCookie", - "weight": 196, + "weight": 241, "cookies": false, "type": "", "demo": "general/set-cookie.md", @@ -925,9 +927,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }] + "security": [{ "Project": [], "Key": [], "JWT": [] }] } }, "/mock/tests/general/upload": { @@ -946,7 +948,7 @@ }, "x-appwrite": { "method": "upload", - "weight": 193, + "weight": 238, "cookies": false, "type": "", "demo": "general/upload.md", @@ -957,9 +959,9 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [] } + "auth": { "Project": [], "Key": [] } }, - "security": [{ "Project": [], "JWT": [] }], + "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ { "name": "x", @@ -1000,51 +1002,56 @@ "tags": [ { "name": "account", - "description": "The Account service allows you to authenticate and manage a user account." + "description": "The Account service allows you to authenticate and manage a user account.", + "x-globalAttributes": [] }, { "name": "avatars", - "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.", + "x-globalAttributes": [] }, { - "name": "database", - "description": "The Database service allows you to create structured collections of documents, query and filter lists of documents" + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents", + "x-globalAttributes": ["databaseId"] }, { "name": "locale", - "description": "The Locale service allows you to customize your app based on your users' location." + "description": "The Locale service allows you to customize your app based on your users' location.", + "x-globalAttributes": [] }, { "name": "health", - "description": "The Health service allows you to both validate and monitor your Appwrite server's health." + "description": "The Health service allows you to both validate and monitor your Appwrite server's health.", + "x-globalAttributes": [] }, { "name": "projects", - "description": "The Project service allows you to manage all the projects in your Appwrite server." + "description": "The Project service allows you to manage all the projects in your Appwrite server.", + "x-globalAttributes": [] }, { "name": "storage", - "description": "The Storage service allows you to manage your project files." + "description": "The Storage service allows you to manage your project files.", + "x-globalAttributes": [] }, { "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" + "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", + "x-globalAttributes": [] }, { "name": "users", - "description": "The Users service allows you to manage your project users." + "description": "The Users service allows you to manage your project users.", + "x-globalAttributes": [] }, { "name": "functions", - "description": "The Functions Service allows you view, create and manage your Cloud Functions." + "description": "The Functions Service allows you view, create and manage your Cloud Functions.", + "x-globalAttributes": [] } ], "definitions": { - "any": { - "description": "Any", - "type": "object", - "additionalProperties": true - }, "error": { "description": "Error", "type": "object", @@ -1059,13 +1066,18 @@ "description": "Error code.", "x-example": "404" }, + "type": { + "type": "string", + "description": "Error type. You can learn more about all the error types at https://appwrite.io/docs/error-codes#errorTypes", + "x-example": "not_found" + }, "version": { "type": "string", "description": "Server version number.", "x-example": "1.0" } }, - "required": ["message", "code", "version"] + "required": ["message", "code", "type", "version"] }, "mock": { "description": "Mock", @@ -1084,4 +1096,4 @@ "description": "Full API docs, specs and tutorials", "url": "https://appwrite.io/docs" } -} +} \ No newline at end of file From 3489a24dbc322fb00617664173e43a6ff9d5b7ca Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 10 Aug 2022 18:18:24 +0530 Subject: [PATCH 234/555] feat: add tests --- tests/Android11Java11Test.php | 5 ++ tests/Android11Java8Test.php | 5 ++ tests/Android12Java11Test.php | 5 ++ tests/Android12Java8Test.php | 5 ++ tests/Android5Java11Test.php | 5 ++ tests/Android5Java8Test.php | 5 ++ tests/Base.php | 10 +-- tests/CLINode14Test.php | 5 ++ tests/CLINode16Test.php | 5 ++ tests/DartBetaTest.php | 5 ++ tests/DartStableTest.php | 5 ++ tests/Deno1171Test.php | 5 ++ tests/FlutterBetaTest.php | 5 ++ tests/FlutterStableTest.php | 5 ++ tests/Go112Test.php | 5 ++ tests/Go118Test.php | 5 ++ tests/KotlinJava11Test.php | 5 ++ tests/KotlinJava8Test.php | 5 ++ tests/PHP80Test.php | 5 ++ tests/Python310Test.php | 5 ++ tests/Python38Test.php | 5 ++ tests/Python39Test.php | 5 ++ tests/Ruby27Test.php | 5 ++ tests/Ruby30Test.php | 5 ++ tests/Ruby31Test.php | 5 ++ tests/SwiftClient55Test.php | 5 ++ tests/SwiftServer55Test.php | 5 ++ tests/WebChromiumTest.php | 5 ++ tests/languages/android/Tests.kt | 3 + tests/languages/cli/test.js | 5 +- tests/languages/dart/tests.dart | 3 + tests/languages/deno/tests.ts | 4 + tests/languages/dotnet/tests.ps1 | 5 +- tests/languages/flutter/tests.dart | 3 + tests/languages/go/tests.go | 6 ++ tests/languages/kotlin/Tests.kt | 7 +- tests/languages/node/test.js | 6 -- tests/languages/php/test.php | 7 +- tests/languages/python/tests.py | 5 +- tests/languages/ruby/tests.rb | 5 +- tests/languages/swift-client/Tests.swift | 3 + tests/languages/swift-server/Tests.swift | 3 + tests/languages/web/node.js | 3 + tests/resources/spec.json | 93 +++++++++++++++++------- 44 files changed, 252 insertions(+), 54 deletions(-) diff --git a/tests/Android11Java11Test.php b/tests/Android11Java11Test.php index 6f67eacda5..22020d5f84 100644 --- a/tests/Android11Java11Test.php +++ b/tests/Android11Java11Test.php @@ -4,6 +4,11 @@ class Android11Java11Test extends Base { + protected string $sdkName = 'android'; + protected string $sdkPlatform = 'client'; + protected string $sdkLanguage = 'kotlin'; + protected string $version = '0.0.1'; + protected string $language = 'android'; protected string $class = 'Appwrite\SDK\Language\Android'; protected array $build = [ diff --git a/tests/Android11Java8Test.php b/tests/Android11Java8Test.php index 2c493c03e6..db2558fb2c 100644 --- a/tests/Android11Java8Test.php +++ b/tests/Android11Java8Test.php @@ -4,6 +4,11 @@ class Android11Java8Test extends Base { + protected string $sdkName = 'android'; + protected string $sdkPlatform = 'client'; + protected string $sdkLanguage = 'kotlin'; + protected string $version = '0.0.1'; + protected string $language = 'android'; protected string $class = 'Appwrite\SDK\Language\Android'; protected array $build = [ diff --git a/tests/Android12Java11Test.php b/tests/Android12Java11Test.php index 5f0cb4aa0f..3afc4c3d66 100644 --- a/tests/Android12Java11Test.php +++ b/tests/Android12Java11Test.php @@ -4,6 +4,11 @@ class Android12Java11Test extends Base { + protected string $sdkName = 'android'; + protected string $sdkPlatform = 'client'; + protected string $sdkLanguage = 'kotlin'; + protected string $version = '0.0.1'; + protected string $language = 'android'; protected string $class = 'Appwrite\SDK\Language\Android'; protected array $build = [ diff --git a/tests/Android12Java8Test.php b/tests/Android12Java8Test.php index e9422ee2a4..7dc3ad33b4 100644 --- a/tests/Android12Java8Test.php +++ b/tests/Android12Java8Test.php @@ -4,6 +4,11 @@ class Android12Java8Test extends Base { + protected string $sdkName = 'android'; + protected string $sdkPlatform = 'client'; + protected string $sdkLanguage = 'kotlin'; + protected string $version = '0.0.1'; + protected string $language = 'android'; protected string $class = 'Appwrite\SDK\Language\Android'; protected array $build = [ diff --git a/tests/Android5Java11Test.php b/tests/Android5Java11Test.php index 95d565a9cc..a9be75c390 100644 --- a/tests/Android5Java11Test.php +++ b/tests/Android5Java11Test.php @@ -4,6 +4,11 @@ class Android5Java11Test extends Base { + protected string $sdkName = 'android'; + protected string $sdkPlatform = 'client'; + protected string $sdkLanguage = 'kotlin'; + protected string $version = '0.0.1'; + protected string $language = 'android'; protected string $class = 'Appwrite\SDK\Language\Android'; protected array $build = [ diff --git a/tests/Android5Java8Test.php b/tests/Android5Java8Test.php index f49c1ba1db..cbda5d26c5 100644 --- a/tests/Android5Java8Test.php +++ b/tests/Android5Java8Test.php @@ -4,6 +4,11 @@ class Android5Java8Test extends Base { + protected string $sdkName = 'android'; + protected string $sdkPlatform = 'client'; + protected string $sdkLanguage = 'kotlin'; + protected string $version = '0.0.1'; + protected string $language = 'android'; protected string $class = 'Appwrite\SDK\Language\Android'; protected array $build = [ diff --git a/tests/Base.php b/tests/Base.php index 8811181762..2b3035ae4f 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -66,14 +66,8 @@ abstract class Base extends TestCase public function setUp(): void { - $headers = [ - "x-sdk-name : {$this->sdkName}", - "x-sdk-platform : {$this->sdkPlatform}", - "x-sdk-language : {$this->sdkLanguage}", - "x-sdk-version : {$this->version}", - ]; - - $this->expectedOutput = array_merge($this->expectedOutput, $headers); + $headers = "x-sdk-name: {$this->sdkName}; x-sdk-platform: {$this->sdkPlatform}; x-sdk-language: {$this->sdkLanguage}; x-sdk-version: {$this->version}"; + array_push($this->expectedOutput, $headers); } public function tearDown(): void diff --git a/tests/CLINode14Test.php b/tests/CLINode14Test.php index 934718fbbc..736465e6d3 100644 --- a/tests/CLINode14Test.php +++ b/tests/CLINode14Test.php @@ -7,6 +7,11 @@ class CLINode14Test extends Base { + protected string $sdkName = 'cli'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'cli'; + protected string $version = '0.0.1'; + protected string $language = 'cli'; protected string $class = 'Appwrite\SDK\Language\CLI'; protected array $build = [ diff --git a/tests/CLINode16Test.php b/tests/CLINode16Test.php index e495247599..00ae17535a 100644 --- a/tests/CLINode16Test.php +++ b/tests/CLINode16Test.php @@ -7,6 +7,11 @@ class CLINode16Test extends Base { + protected string $sdkName = 'cli'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'cli'; + protected string $version = '0.0.1'; + protected string $language = 'cli'; protected string $class = 'Appwrite\SDK\Language\CLI'; protected array $build = [ diff --git a/tests/DartBetaTest.php b/tests/DartBetaTest.php index 173b146e27..e6c5698e4f 100644 --- a/tests/DartBetaTest.php +++ b/tests/DartBetaTest.php @@ -4,6 +4,11 @@ class DartBetaTest extends Base { + protected string $sdkName = 'dart'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'dart'; + protected string $version = '0.0.1'; + protected string $language = 'dart'; protected string $class = 'Appwrite\SDK\Language\Dart'; protected array $build = [ diff --git a/tests/DartStableTest.php b/tests/DartStableTest.php index 4d4cf453a4..9691af8bef 100644 --- a/tests/DartStableTest.php +++ b/tests/DartStableTest.php @@ -4,6 +4,11 @@ class DartStableTest extends Base { + protected string $sdkName = 'dart'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'dart'; + protected string $version = '0.0.1'; + protected string $language = 'dart'; protected string $class = 'Appwrite\SDK\Language\Dart'; protected array $build = [ diff --git a/tests/Deno1171Test.php b/tests/Deno1171Test.php index e237b5f430..9dd49b021c 100644 --- a/tests/Deno1171Test.php +++ b/tests/Deno1171Test.php @@ -4,6 +4,11 @@ class Deno1171Test extends Base { + protected string $sdkName = 'deno'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'deno'; + protected string $version = '0.0.1'; + protected string $language = 'deno'; protected string $class = 'Appwrite\SDK\Language\Deno'; protected array $build = []; diff --git a/tests/FlutterBetaTest.php b/tests/FlutterBetaTest.php index 98d6d718d8..6b20e5ec17 100644 --- a/tests/FlutterBetaTest.php +++ b/tests/FlutterBetaTest.php @@ -4,6 +4,11 @@ class FlutterBetaTest extends Base { + protected string $sdkName = 'flutter'; + protected string $sdkPlatform = 'client'; + protected string $sdkLanguage = 'dart'; + protected string $version = '0.0.1'; + protected string $language = 'flutter'; protected string $class = 'Appwrite\SDK\Language\Flutter'; protected array $build = [ diff --git a/tests/FlutterStableTest.php b/tests/FlutterStableTest.php index f93811d1ac..afd00dc00e 100644 --- a/tests/FlutterStableTest.php +++ b/tests/FlutterStableTest.php @@ -4,6 +4,11 @@ class FlutterStableTest extends Base { + protected string $sdkName = 'flutter'; + protected string $sdkPlatform = 'client'; + protected string $sdkLanguage = 'dart'; + protected string $version = '0.0.1'; + protected string $language = 'flutter'; protected string $class = 'Appwrite\SDK\Language\Flutter'; protected array $build = [ diff --git a/tests/Go112Test.php b/tests/Go112Test.php index 3c440a87a7..c845e202f3 100644 --- a/tests/Go112Test.php +++ b/tests/Go112Test.php @@ -4,6 +4,11 @@ class Go112Test extends Base { + protected string $sdkName = 'go'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'go'; + protected string $version = '0.0.1'; + protected string $language = 'go'; protected string $class = 'Appwrite\SDK\Language\Go'; protected array $build = [ diff --git a/tests/Go118Test.php b/tests/Go118Test.php index 7aed71fd15..d05acf7ac1 100644 --- a/tests/Go118Test.php +++ b/tests/Go118Test.php @@ -4,6 +4,11 @@ class Go118Test extends Base { + protected string $sdkName = 'go'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'go'; + protected string $version = '0.0.1'; + protected string $language = 'go'; protected string $class = 'Appwrite\SDK\Language\Go'; protected array $build = [ diff --git a/tests/KotlinJava11Test.php b/tests/KotlinJava11Test.php index c2c733c1ae..3c60139768 100644 --- a/tests/KotlinJava11Test.php +++ b/tests/KotlinJava11Test.php @@ -4,6 +4,11 @@ class KotlinJava11Test extends Base { + protected string $sdkName = 'kotlin'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'kotlin'; + protected string $version = '0.0.1'; + protected string $language = 'kotlin'; protected string $class = 'Appwrite\SDK\Language\Kotlin'; protected array $build = [ diff --git a/tests/KotlinJava8Test.php b/tests/KotlinJava8Test.php index 605564297c..923d39c5b6 100644 --- a/tests/KotlinJava8Test.php +++ b/tests/KotlinJava8Test.php @@ -4,6 +4,11 @@ class KotlinJava8Test extends Base { + protected string $sdkName = 'kotlin'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'kotlin'; + protected string $version = '0.0.1'; + protected string $language = 'kotlin'; protected string $class = 'Appwrite\SDK\Language\Kotlin'; protected array $build = [ diff --git a/tests/PHP80Test.php b/tests/PHP80Test.php index d44a29af7d..cfddae5849 100644 --- a/tests/PHP80Test.php +++ b/tests/PHP80Test.php @@ -4,6 +4,11 @@ class PHP80Test extends Base { + protected string $sdkName = 'php'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'php'; + protected string $version = '0.0.1'; + protected string $language = 'php'; protected string $class = 'Appwrite\SDK\Language\PHP'; protected array $build = []; diff --git a/tests/Python310Test.php b/tests/Python310Test.php index 7f8b587b62..41260aff40 100644 --- a/tests/Python310Test.php +++ b/tests/Python310Test.php @@ -4,6 +4,11 @@ class Python310Test extends Base { + protected string $sdkName = 'python'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'python'; + protected string $version = '0.0.1'; + protected string $language = 'python'; protected string $class = 'Appwrite\SDK\Language\Python'; protected array $build = [ diff --git a/tests/Python38Test.php b/tests/Python38Test.php index 4ea1004c7d..d9a46b600e 100644 --- a/tests/Python38Test.php +++ b/tests/Python38Test.php @@ -4,6 +4,11 @@ class Python38Test extends Base { + protected string $sdkName = 'python'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'python'; + protected string $version = '0.0.1'; + protected string $language = 'python'; protected string $class = 'Appwrite\SDK\Language\Python'; protected array $build = [ diff --git a/tests/Python39Test.php b/tests/Python39Test.php index 5011dfdb4f..9715adbf1c 100644 --- a/tests/Python39Test.php +++ b/tests/Python39Test.php @@ -4,6 +4,11 @@ class Python39Test extends Base { + protected string $sdkName = 'python'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'python'; + protected string $version = '0.0.1'; + protected string $language = 'python'; protected string $class = 'Appwrite\SDK\Language\Python'; protected array $build = [ diff --git a/tests/Ruby27Test.php b/tests/Ruby27Test.php index 86898a1cc1..a60c6dbeea 100644 --- a/tests/Ruby27Test.php +++ b/tests/Ruby27Test.php @@ -4,6 +4,11 @@ class Ruby27Test extends Base { + protected string $sdkName = 'ruby'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'ruby'; + protected string $version = '0.0.1'; + protected string $language = 'ruby'; protected string $class = 'Appwrite\SDK\Language\Ruby'; protected array $build = [ diff --git a/tests/Ruby30Test.php b/tests/Ruby30Test.php index c954b102a7..0de4997a45 100644 --- a/tests/Ruby30Test.php +++ b/tests/Ruby30Test.php @@ -4,6 +4,11 @@ class Ruby30Test extends Base { + protected string $sdkName = 'ruby'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'ruby'; + protected string $version = '0.0.1'; + protected string $language = 'ruby'; protected string $class = 'Appwrite\SDK\Language\Ruby'; protected array $build = [ diff --git a/tests/Ruby31Test.php b/tests/Ruby31Test.php index 0b3223b168..848420fdcd 100644 --- a/tests/Ruby31Test.php +++ b/tests/Ruby31Test.php @@ -4,6 +4,11 @@ class Ruby31Test extends Base { + protected string $sdkName = 'ruby'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'ruby'; + protected string $version = '0.0.1'; + protected string $language = 'ruby'; protected string $class = 'Appwrite\SDK\Language\Ruby'; protected array $build = [ diff --git a/tests/SwiftClient55Test.php b/tests/SwiftClient55Test.php index d2557ea9e7..18a732b658 100644 --- a/tests/SwiftClient55Test.php +++ b/tests/SwiftClient55Test.php @@ -4,6 +4,11 @@ class SwiftClient55Test extends Base { + protected string $sdkName = 'swift'; + protected string $sdkPlatform = 'client'; + protected string $sdkLanguage = 'swift'; + protected string $version = '0.0.1'; + protected string $language = 'swift-client'; protected string $class = 'Appwrite\SDK\Language\SwiftClient'; protected array $build = [ diff --git a/tests/SwiftServer55Test.php b/tests/SwiftServer55Test.php index d2c6ee952c..3466e1c4b1 100644 --- a/tests/SwiftServer55Test.php +++ b/tests/SwiftServer55Test.php @@ -4,6 +4,11 @@ class SwiftServer55Test extends Base { + protected string $sdkName = 'swift'; + protected string $sdkPlatform = 'server'; + protected string $sdkLanguage = 'swift'; + protected string $version = '0.0.1'; + protected string $language = 'swift-server'; protected string $class = 'Appwrite\SDK\Language\Swift'; protected array $build = [ diff --git a/tests/WebChromiumTest.php b/tests/WebChromiumTest.php index 0c70197c35..f1c1301fba 100644 --- a/tests/WebChromiumTest.php +++ b/tests/WebChromiumTest.php @@ -4,6 +4,11 @@ class WebChromiumTest extends Base { + protected string $sdkName = 'web'; + protected string $sdkPlatform = 'client'; + protected string $sdkLanguage = 'web'; + protected string $version = '0.0.1'; + protected string $language = 'web'; protected string $class = 'Appwrite\SDK\Language\Web'; protected array $build = [ diff --git a/tests/languages/android/Tests.kt b/tests/languages/android/Tests.kt index 3993e5eda7..050d3379c3 100644 --- a/tests/languages/android/Tests.kt +++ b/tests/languages/android/Tests.kt @@ -155,6 +155,9 @@ class ServiceTest { writeToFile(mock.result) general.empty() + + mock = general.headers() + writeToFile(mock.result) } } diff --git a/tests/languages/cli/test.js b/tests/languages/cli/test.js index aa8fed9dba..4a5669b32a 100644 --- a/tests/languages/cli/test.js +++ b/tests/languages/cli/test.js @@ -47,4 +47,7 @@ console.log(output.split('\n')[0].split(" : ")[1]); output = execSync("node index general upload --x string --y 123 --z string in array --file ../../resources/large_file.mp4", { stdio: 'pipe'}).toString(); console.log(output.split('\n')[0].split(" : ")[1]); -execSync("node index general empty", { stdio: 'pipe'}); \ No newline at end of file +execSync("node index general empty", { stdio: 'pipe'}); + +output = execSync("node index general headers", { stdio: 'pipe'}).toString(); +console.log(output.split('\n')[0].split(" : ")[1]); \ No newline at end of file diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 7aff91edbe..89f7238349 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -87,4 +87,7 @@ void main() async { // print(response.result); await general.empty(); + + response = await general.headers(); + print(response.result); } diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts index 9833e0cea3..eb16f67447 100644 --- a/tests/languages/deno/tests.ts +++ b/tests/languages/deno/tests.ts @@ -91,6 +91,10 @@ async function start() { } await general.empty(); + + response = await general.headers() + // @ts-ignore + console.log(response.result) } start().catch((err) => { diff --git a/tests/languages/dotnet/tests.ps1 b/tests/languages/dotnet/tests.ps1 index bc4dc70560..bf8b5c8089 100644 --- a/tests/languages/dotnet/tests.ps1 +++ b/tests/languages/dotnet/tests.ps1 @@ -90,4 +90,7 @@ try { $response.GetResult() } catch [Appwrite.AppwriteException] { Write-Host $_.Exception.Message -} \ No newline at end of file +} + +$response = $general.headers() | Await-Task +Print-Response $response.GetResult() \ No newline at end of file diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index b03b3bc585..197f3c0bc0 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -107,4 +107,7 @@ void main() async { print(response.result); await general.empty(); + + response = await general.headers(); + print(response.result); } diff --git a/tests/languages/go/tests.go b/tests/languages/go/tests.go index d283485426..49ae03db73 100644 --- a/tests/languages/go/tests.go +++ b/tests/languages/go/tests.go @@ -120,6 +120,12 @@ func testGeneralService(client appwrite.Client, stringInArray []interface{}) { } general.Empty() + + response, err = general.Headers() + if err != nil { + fmt.Printf("general.Headers => error %v", err) + } + fmt.Printf("%s\n", response.Result) } func testGeneralUpload(client appwrite.Client, stringInArray []interface{}) { diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt index 56b4367dde..56e3af9469 100644 --- a/tests/languages/kotlin/Tests.kt +++ b/tests/languages/kotlin/Tests.kt @@ -116,11 +116,8 @@ class ServiceTest { general.empty() - // Header Tests - writeToFile(client.headers['x-sdk-name']); - writeToFile(client.headers['x-sdk-platform']); - writeToFile(client.headers['x-sdk-language']); - writeToFile(client.headers['x-sdk-version']); + mock = general.headers() + writeToFile(mock.result) } } diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index ea36ae1fa0..6648ecb8fc 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -82,12 +82,6 @@ async function start() { response = await general.headers(); console.log(response.result); - - // Header Tests - console.log(`x-sdk-name : ${client.headers['x-sdk-name']}`) - console.log(`x-sdk-platform : ${client.headers['x-sdk-platform']}`) - console.log(`x-sdk-language : ${client.headers['x-sdk-language']}`) - console.log(`x-sdk-version : ${client.headers['x-sdk-version']}`) } start().catch((err) => { diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index e057edf760..48984d425d 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -95,8 +95,5 @@ $general->empty(); -// Header Tests -echo "x-sdk-name : {$client->headers['x-sdk-name']}" -console.log(`x-sdk-platform : ${client.headers['x-sdk-platform']}`) -console.log(`x-sdk-language : ${client.headers['x-sdk-language']}`) -console.log(`x-sdk-version : ${client.headers['x-sdk-version']}`) \ No newline at end of file +$response = $general->headers(); +echo "{$response['result']}\n"; \ No newline at end of file diff --git a/tests/languages/python/tests.py b/tests/languages/python/tests.py index 18dcbb6337..b7a26f37a3 100644 --- a/tests/languages/python/tests.py +++ b/tests/languages/python/tests.py @@ -85,4 +85,7 @@ except AppwriteException as e: print(e.message) -general.empty() \ No newline at end of file +general.empty() + +response = general.headers() +print(response['result']) \ No newline at end of file diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index 0a5e860d04..10562e392d 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -97,4 +97,7 @@ puts error.message end -general.empty() \ No newline at end of file +general.empty() + +response = general.headers() +puts response.result \ No newline at end of file diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/swift-client/Tests.swift index cffa3f3550..11e6c1edbb 100644 --- a/tests/languages/swift-client/Tests.swift +++ b/tests/languages/swift-client/Tests.swift @@ -142,5 +142,8 @@ class Tests: XCTestCase { print(mock.result) try! await general.empty() + + mock = try await general.headers() + print(mock.result) } } diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index a5782e2329..0d41a3c1bc 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -123,5 +123,8 @@ class Tests: XCTestCase { } try! await general.empty() + + mock = try await general.headers() + print(mock.result) } } diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js index e5fccb359f..0a47238d38 100644 --- a/tests/languages/web/node.js +++ b/tests/languages/web/node.js @@ -69,6 +69,9 @@ async function start() { } console.log('WS:/v1/realtime:passed'); // Skip realtime test on Node.js + + response = await general.headers(); + console.log(response.result); } start(); \ No newline at end of file diff --git a/tests/resources/spec.json b/tests/resources/spec.json index cbcc8111f0..215a2ac3d0 100644 --- a/tests/resources/spec.json +++ b/tests/resources/spec.json @@ -15,9 +15,9 @@ "url": "https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE" } }, - "host": "HOSTNAME", + "host": "192.168.1.47", "basePath": "/v1", - "schemes": ["https"], + "schemes": ["http"], "consumes": ["application/json", "multipart/form-data"], "produces": ["application/json"], "securityDefinitions": { @@ -48,6 +48,13 @@ "description": "", "in": "header", "x-appwrite": { "demo": "en" } + }, + "Mode": { + "type": "apiKey", + "name": "X-Appwrite-Mode", + "description": "", + "in": "header", + "x-appwrite": { "demo": "" } } }, "paths": { @@ -78,7 +85,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ @@ -135,7 +142,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ @@ -196,7 +203,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ @@ -257,7 +264,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ @@ -318,7 +325,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ @@ -381,7 +388,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ @@ -438,7 +445,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ @@ -499,7 +506,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ @@ -560,7 +567,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ @@ -621,7 +628,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ @@ -684,7 +691,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }] } @@ -716,11 +723,43 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }] } }, + "/mock/tests/general/502-error": { + "get": { + "summary": "502 Error", + "operationId": "generalError502", + "consumes": ["application/json"], + "produces": ["text/plain"], + "tags": ["general"], + "description": "", + "responses": { + "502": { + "description": "Any", + "schema": { "$ref": "#/definitions/any" } + } + }, + "x-appwrite": { + "method": "error502", + "weight": 247, + "cookies": false, + "type": "", + "demo": "general/error502.md", + "edit": "https://github.com/appwrite/appwrite/edit/masterMock a 502 bad gateway.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": ["client"], + "packaging": false, + "auth": { "Project": [] } + }, + "security": [{ "Project": [] }] + } + }, "/mock/tests/general/download": { "get": { "summary": "Download File", @@ -745,7 +784,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }] } @@ -772,7 +811,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }] } @@ -804,7 +843,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }] } @@ -818,10 +857,7 @@ "tags": ["general"], "description": "", "responses": { - "200": { - "description": "Mock", - "schema": { "$ref": "#/definitions/mock" } - } + "200": { "description": "File", "schema": { "type": "file" } } }, "x-appwrite": { "method": "headers", @@ -836,7 +872,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }] } @@ -863,7 +899,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }] } @@ -895,7 +931,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }] } @@ -927,7 +963,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }] } @@ -959,7 +995,7 @@ "scope": "public", "platforms": ["client", "server", "server"], "packaging": false, - "auth": { "Project": [], "Key": [] } + "auth": { "Project": [] } }, "security": [{ "Project": [], "Key": [], "JWT": [] }], "parameters": [ @@ -1052,6 +1088,11 @@ } ], "definitions": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true + }, "error": { "description": "Error", "type": "object", From 208affd4026ff1838fa313a3bc89196d8fa2ea13 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 10 Aug 2022 18:48:21 +0530 Subject: [PATCH 235/555] feat: update endpoint --- tests/resources/spec.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/resources/spec.json b/tests/resources/spec.json index 215a2ac3d0..9f295d5053 100644 --- a/tests/resources/spec.json +++ b/tests/resources/spec.json @@ -15,9 +15,9 @@ "url": "https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE" } }, - "host": "192.168.1.47", + "host": "8080-appwrite-appwrite-pdthqc4qqbr.ws-us59.gitpod.io", "basePath": "/v1", - "schemes": ["http"], + "schemes": ["https"], "consumes": ["application/json", "multipart/form-data"], "produces": ["application/json"], "securityDefinitions": { From 53ca45af858958c648c6b0868d00a33d46e14f58 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 10 Aug 2022 23:12:39 +0530 Subject: [PATCH 236/555] feat: update CLI endpoint --- tests/languages/cli/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/languages/cli/test.js b/tests/languages/cli/test.js index 4a5669b32a..e870b88752 100644 --- a/tests/languages/cli/test.js +++ b/tests/languages/cli/test.js @@ -1,6 +1,6 @@ const { exec, execSync } = require('child_process'); -execSync("node index client --endpoint 'https://appwrite.io/v1' --projectId 6013fbefdfa41 --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); +execSync("node index client --endpoint 'https://8080-appwrite-appwrite-pdthqc4qqbr.ws-us59.gitpod.io/v1' --projectId 6013fbefdfa41 --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); var output; console.log('\nTest Started'); From 2f21246b44b93f2bc9e12f2832dfc1138bae3c68 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 10 Aug 2022 23:55:24 +0530 Subject: [PATCH 237/555] feat: update spec --- tests/resources/spec.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/resources/spec.json b/tests/resources/spec.json index 9f295d5053..cd7582e10f 100644 --- a/tests/resources/spec.json +++ b/tests/resources/spec.json @@ -857,7 +857,10 @@ "tags": ["general"], "description": "", "responses": { - "200": { "description": "File", "schema": { "type": "file" } } + "200": { + "description": "Mock", + "schema": { "$ref": "#/definitions/mock" } + } }, "x-appwrite": { "method": "headers", From 53c6d641131a5ec2968be47ff9f1e0006fe08757 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 11 Aug 2022 00:21:37 +0530 Subject: [PATCH 238/555] feat: update mock endpoint spec --- templates/deno/src/client.ts.twig | 2 +- templates/flutter/lib/src/client_io.dart.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/deno/src/client.ts.twig b/templates/deno/src/client.ts.twig index 61f08936ff..fe75b4bb4c 100644 --- a/templates/deno/src/client.ts.twig +++ b/templates/deno/src/client.ts.twig @@ -8,7 +8,7 @@ export class Client { static CHUNK_SIZE = 5*1024*1024; // 5MB static DENO_READ_CHUNK_SIZE = 16384; // 16kb; refference: https://github.com/denoland/deno/discussions/9906 - endpoint: string = 'https://appwrite.io/v1'; + endpoint: string = '{{spec.endpoint}}'; headers: Payload = { 'content-type': '', 'x-sdk-name': '{{ sdk.name }}', diff --git a/templates/flutter/lib/src/client_io.dart.twig b/templates/flutter/lib/src/client_io.dart.twig index cf4546fda2..9e6a0f8b40 100644 --- a/templates/flutter/lib/src/client_io.dart.twig +++ b/templates/flutter/lib/src/client_io.dart.twig @@ -49,7 +49,7 @@ class ClientIO extends ClientBase with ClientMixin { String? get endPointRealtime => _endPointRealtime; ClientIO({ - String endPoint = 'https://appwrite.io/v1', + String endPoint = '{{spec.endpoint}}', this.selfSigned = false, }) : _endPoint = endPoint { _nativeClient = HttpClient() From b9ba8025f35bf7cca8112aa3b9f32671b0e13e32 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 11 Aug 2022 00:44:13 +0530 Subject: [PATCH 239/555] feat: update mock endpoint spec --- .../android/library/src/main/java/io/appwrite/Client.kt.twig | 2 +- templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig index aafc05d50a..12892655a1 100644 --- a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig @@ -40,7 +40,7 @@ import kotlin.coroutines.resume class Client @JvmOverloads constructor( context: Context, - var endPoint: String = "https://appwrite.io/v1", + var endPoint: String = "{{spec.endpoint}}", var endPointRealtime: String? = null, private var selfSigned: Boolean = false ) : CoroutineScope { diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index d528583db3..09c6365289 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -34,7 +34,7 @@ import kotlin.coroutines.CoroutineContext import kotlin.coroutines.resume class Client @JvmOverloads constructor( - var endPoint: String = "https://appwrite.io/v1", + var endPoint: String = "{{spec.endpoint}}", private var selfSigned: Boolean = false ) : CoroutineScope { From 7caee664690deb206823310e4eb7f77cf8139aa3 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 11 Aug 2022 01:33:54 +0530 Subject: [PATCH 240/555] feat: update mock endpoint spec --- templates/go/client.go.twig | 2 +- tests/Base.php | 2 +- tests/languages/go/tests.go | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/go/client.go.twig b/templates/go/client.go.twig index e9fdf06ef6..9c9d5a9fd8 100644 --- a/templates/go/client.go.twig +++ b/templates/go/client.go.twig @@ -74,7 +74,7 @@ func NewClient() Client { httpClient, err := getDefaultClient(defaultTimeout) if err != nil { panic(err) } return Client { - endpoint: "https://{{ sdk.gitUserName|url_encode }}.io/v1", + endpoint: "{{spec.endpoint}}", client: httpClient, timeout: defaultTimeout, headers: headers, diff --git a/tests/Base.php b/tests/Base.php index 2b3035ae4f..eb2a40ef69 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -36,7 +36,7 @@ abstract class Base extends TestCase ]; const EXTENDED_GENERAL_RESPONSES = [ - 'Download test passed.', + 'GET:/v1/mock/tests/general/download:passed', ]; const COOKIE_RESPONSES = [ diff --git a/tests/languages/go/tests.go b/tests/languages/go/tests.go index 49ae03db73..ecf818614c 100644 --- a/tests/languages/go/tests.go +++ b/tests/languages/go/tests.go @@ -16,7 +16,6 @@ func main() { if err != nil { panic(err) } - client.SetEndpoint("https://appwrite.io/v1") client.AddHeader("Origin", "http://localhost") fmt.Print("\n\nTest Started\n") testFooService(client, stringInArray) From db5cc7cf18ddbc44a434bf8f9d05d2c1f577e3b6 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 11 Aug 2022 10:39:09 +0530 Subject: [PATCH 241/555] feat: update tests --- tests/Android11Java11Test.php | 2 +- tests/Android11Java8Test.php | 2 +- tests/Android12Java11Test.php | 2 +- tests/Android12Java8Test.php | 2 +- tests/Android5Java11Test.php | 2 +- tests/Android5Java8Test.php | 2 +- tests/Base.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/Android11Java11Test.php b/tests/Android11Java11Test.php index 22020d5f84..ccda6a6ef8 100644 --- a/tests/Android11Java11Test.php +++ b/tests/Android11Java11Test.php @@ -6,7 +6,7 @@ class Android11Java11Test extends Base { protected string $sdkName = 'android'; protected string $sdkPlatform = 'client'; - protected string $sdkLanguage = 'kotlin'; + protected string $sdkLanguage = 'android'; protected string $version = '0.0.1'; protected string $language = 'android'; diff --git a/tests/Android11Java8Test.php b/tests/Android11Java8Test.php index db2558fb2c..20240c90bd 100644 --- a/tests/Android11Java8Test.php +++ b/tests/Android11Java8Test.php @@ -6,7 +6,7 @@ class Android11Java8Test extends Base { protected string $sdkName = 'android'; protected string $sdkPlatform = 'client'; - protected string $sdkLanguage = 'kotlin'; + protected string $sdkLanguage = 'android'; protected string $version = '0.0.1'; protected string $language = 'android'; diff --git a/tests/Android12Java11Test.php b/tests/Android12Java11Test.php index 3afc4c3d66..42d764f020 100644 --- a/tests/Android12Java11Test.php +++ b/tests/Android12Java11Test.php @@ -6,7 +6,7 @@ class Android12Java11Test extends Base { protected string $sdkName = 'android'; protected string $sdkPlatform = 'client'; - protected string $sdkLanguage = 'kotlin'; + protected string $sdkLanguage = 'android'; protected string $version = '0.0.1'; protected string $language = 'android'; diff --git a/tests/Android12Java8Test.php b/tests/Android12Java8Test.php index 7dc3ad33b4..1c9f20980e 100644 --- a/tests/Android12Java8Test.php +++ b/tests/Android12Java8Test.php @@ -6,7 +6,7 @@ class Android12Java8Test extends Base { protected string $sdkName = 'android'; protected string $sdkPlatform = 'client'; - protected string $sdkLanguage = 'kotlin'; + protected string $sdkLanguage = 'android'; protected string $version = '0.0.1'; protected string $language = 'android'; diff --git a/tests/Android5Java11Test.php b/tests/Android5Java11Test.php index a9be75c390..ece1008dfd 100644 --- a/tests/Android5Java11Test.php +++ b/tests/Android5Java11Test.php @@ -6,7 +6,7 @@ class Android5Java11Test extends Base { protected string $sdkName = 'android'; protected string $sdkPlatform = 'client'; - protected string $sdkLanguage = 'kotlin'; + protected string $sdkLanguage = 'android'; protected string $version = '0.0.1'; protected string $language = 'android'; diff --git a/tests/Android5Java8Test.php b/tests/Android5Java8Test.php index cbda5d26c5..2db07d0808 100644 --- a/tests/Android5Java8Test.php +++ b/tests/Android5Java8Test.php @@ -6,7 +6,7 @@ class Android5Java8Test extends Base { protected string $sdkName = 'android'; protected string $sdkPlatform = 'client'; - protected string $sdkLanguage = 'kotlin'; + protected string $sdkLanguage = 'android'; protected string $version = '0.0.1'; protected string $language = 'android'; diff --git a/tests/Base.php b/tests/Base.php index eb2a40ef69..85da42d8c8 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -148,7 +148,7 @@ public function testHTTPSuccess(): void $removed = array_shift($output); } while ($removed != 'Test Started' && sizeof($output) != 0); - $this->assertEquals(count($this->expectedOutput), count($output)); + $this->assertGreaterThanOrEqual(count($this->expectedOutput), count($output)); foreach ($this->expectedOutput as $i => $row) { $this->assertEquals($output[$i], $row); From c61d0e11cfbf0f39972686c69a31286f48e92b91 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 11 Aug 2022 11:14:05 +0530 Subject: [PATCH 242/555] feat: update tests --- tests/languages/cli/test.js | 2 +- tests/resources/spec.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/languages/cli/test.js b/tests/languages/cli/test.js index e870b88752..bda54412d7 100644 --- a/tests/languages/cli/test.js +++ b/tests/languages/cli/test.js @@ -1,6 +1,6 @@ const { exec, execSync } = require('child_process'); -execSync("node index client --endpoint 'https://8080-appwrite-appwrite-pdthqc4qqbr.ws-us59.gitpod.io/v1' --projectId 6013fbefdfa41 --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); +execSync("node index client --endpoint 'https://8080-appwrite-appwrite-pdthqc4qqbr.ws-us60.gitpod.io/v1' --projectId 6013fbefdfa41 --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); var output; console.log('\nTest Started'); diff --git a/tests/resources/spec.json b/tests/resources/spec.json index cd7582e10f..ab364c05b3 100644 --- a/tests/resources/spec.json +++ b/tests/resources/spec.json @@ -15,7 +15,7 @@ "url": "https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE" } }, - "host": "8080-appwrite-appwrite-pdthqc4qqbr.ws-us59.gitpod.io", + "host": "8080-appwrite-appwrite-pdthqc4qqbr.ws-us60.gitpod.io", "basePath": "/v1", "schemes": ["https"], "consumes": ["application/json", "multipart/form-data"], From bad646270d84ef207f9bf1aaff10c28807cb2203 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 11 Aug 2022 11:47:43 +0530 Subject: [PATCH 243/555] feat: update tests --- tests/SwiftClient55Test.php | 2 +- tests/WebNodeTest.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/SwiftClient55Test.php b/tests/SwiftClient55Test.php index 18a732b658..7c21e41bc7 100644 --- a/tests/SwiftClient55Test.php +++ b/tests/SwiftClient55Test.php @@ -6,7 +6,7 @@ class SwiftClient55Test extends Base { protected string $sdkName = 'swift'; protected string $sdkPlatform = 'client'; - protected string $sdkLanguage = 'swift'; + protected string $sdkLanguage = 'swiftclient'; protected string $version = '0.0.1'; protected string $language = 'swift-client'; diff --git a/tests/WebNodeTest.php b/tests/WebNodeTest.php index ac3dad3656..b7b28c2839 100644 --- a/tests/WebNodeTest.php +++ b/tests/WebNodeTest.php @@ -4,6 +4,11 @@ class WebNodeTest extends Base { + protected string $sdkName = 'web'; + protected string $sdkPlatform = 'client'; + protected string $sdkLanguage = 'web'; + protected string $version = '0.0.1'; + protected string $language = 'web'; protected string $class = 'Appwrite\SDK\Language\Web'; protected array $build = [ From 428e139f1a4c888cae872f206cc76097f922fb28 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 11 Aug 2022 11:54:21 +0530 Subject: [PATCH 244/555] feat: update tests --- tests/languages/cli/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/languages/cli/test.js b/tests/languages/cli/test.js index bda54412d7..e74efe4be1 100644 --- a/tests/languages/cli/test.js +++ b/tests/languages/cli/test.js @@ -1,6 +1,6 @@ const { exec, execSync } = require('child_process'); -execSync("node index client --endpoint 'https://8080-appwrite-appwrite-pdthqc4qqbr.ws-us60.gitpod.io/v1' --projectId 6013fbefdfa41 --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); +execSync("node index client --endpoint 'https://8080-appwrite-appwrite-pdthqc4qqbr.ws-us60.gitpod.io/v1' --projectId console --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); var output; console.log('\nTest Started'); From 6c6366d66a87274c156a5ee10167ab13e56a9c78 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 11 Aug 2022 12:37:19 +0530 Subject: [PATCH 245/555] feat: update tests --- tests/FlutterBetaTest.php | 2 +- tests/FlutterStableTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/FlutterBetaTest.php b/tests/FlutterBetaTest.php index 6b20e5ec17..ed7e507e5a 100644 --- a/tests/FlutterBetaTest.php +++ b/tests/FlutterBetaTest.php @@ -6,7 +6,7 @@ class FlutterBetaTest extends Base { protected string $sdkName = 'flutter'; protected string $sdkPlatform = 'client'; - protected string $sdkLanguage = 'dart'; + protected string $sdkLanguage = 'flutter'; protected string $version = '0.0.1'; protected string $language = 'flutter'; diff --git a/tests/FlutterStableTest.php b/tests/FlutterStableTest.php index afd00dc00e..3f661c2d9b 100644 --- a/tests/FlutterStableTest.php +++ b/tests/FlutterStableTest.php @@ -6,7 +6,7 @@ class FlutterStableTest extends Base { protected string $sdkName = 'flutter'; protected string $sdkPlatform = 'client'; - protected string $sdkLanguage = 'dart'; + protected string $sdkLanguage = 'flutter'; protected string $version = '0.0.1'; protected string $language = 'flutter'; From 4dcceff0526bca86481cc63d03b496959a811d0f Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 11 Aug 2022 12:40:47 +0530 Subject: [PATCH 246/555] feat: update web tests --- tests/languages/web/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index 79abf18829..6c678f00f8 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -109,6 +109,9 @@ console.log(error.message); } + response = await general.headers(); + console.log(response.result); + await Promise.resolve(resolve=>setTimeout(() => resolve, 5000)); console.log(responseRealtime) From 241da8302a52c380b0f67df37d33246f1b07a468 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 11 Aug 2022 14:03:03 +0530 Subject: [PATCH 247/555] feat: update web tests --- tests/WebChromiumTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/WebChromiumTest.php b/tests/WebChromiumTest.php index f1c1301fba..c4433de98b 100644 --- a/tests/WebChromiumTest.php +++ b/tests/WebChromiumTest.php @@ -26,7 +26,12 @@ class WebChromiumTest extends Base ...Base::BAR_RESPONSES, ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, - ...Base::EXCEPTION_RESPONSES, - ...Base::REALTIME_RESPONSES, + ...Base::EXCEPTION_RESPONSES ]; + + public function setUp(): void + { + $headers = "x-sdk-name: {$this->sdkName}; x-sdk-platform: {$this->sdkPlatform}; x-sdk-language: {$this->sdkLanguage}; x-sdk-version: {$this->version}"; + array_push($this->expectedOutput, $headers, ...Base::REALTIME_RESPONSES); + } } From a92c290ade38918a5fb60db69f070b13e868f436 Mon Sep 17 00:00:00 2001 From: Dom Jocubeit Date: Fri, 12 Aug 2022 09:16:27 +0800 Subject: [PATCH 248/555] Fix typos in client endpoint, projectId & key opts --- templates/cli/lib/commands/generic.js.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/cli/lib/commands/generic.js.twig b/templates/cli/lib/commands/generic.js.twig index 0195da2702..1b99644afb 100644 --- a/templates/cli/lib/commands/generic.js.twig +++ b/templates/cli/lib/commands/generic.js.twig @@ -44,9 +44,9 @@ const logout = new Command("logout") const client = new Command("client") .description(commandDescriptions['client']) .option("--selfSigned ", "Configure the CLI to use a self-signed certificate ( true or false )", parseBool) - .option("--endpoint ", "Set your Apwrite server endpoint") - .option("--projectId ", "Set your Apwrite project ID") - .option("--key ", "Set your Apwrite server's API key") + .option("--endpoint ", "Set your Appwrite server endpoint") + .option("--projectId ", "Set your Appwrite project ID") + .option("--key ", "Set your Appwrite server's API key") .option("--debug", "Print CLI debug information") .option("--reset", "Reset the CLI configuration") .action(actionRunner(async ({ selfSigned, endpoint, projectId, key, debug, reset }, command) => { From cf8ca417d148ce15373169e7c3857ff2ebb237a0 Mon Sep 17 00:00:00 2001 From: nohli <43643339+nohli@users.noreply.github.com> Date: Fri, 12 Aug 2022 13:18:45 +0200 Subject: [PATCH 249/555] Update versions --- templates/flutter/pubspec.yaml.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 0281303cf9..c53aef9d5b 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -11,10 +11,10 @@ dependencies: flutter: sdk: flutter cookie_jar: ^3.0.1 - device_info_plus: ^4.0.2 + device_info_plus: ^4.1.0 flutter_web_auth: ^0.4.1 http: ^0.13.5 - package_info_plus: 1.4.3 + package_info_plus: 1.4.3+1 path_provider: ^2.0.11 web_socket_channel: ^2.2.0 From 2866549101cdb43568d0fdbc1d92d3d59c909a3d Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Sun, 14 Aug 2022 20:07:24 +0200 Subject: [PATCH 250/555] Update pubspec.yaml.twig --- templates/flutter/pubspec.yaml.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 33ab345587..7bec28d344 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -11,7 +11,7 @@ dependencies: flutter: sdk: flutter cookie_jar: ^3.0.1 - device_info_plus: ^4.1.0 + device_info_plus: ^4.1.2 flutter_web_auth: ^0.4.1 http: ^0.13.5 package_info_plus: 1.4.3+1 From 8c4a23d8b8919c28792dccb967de0a34790ec40a Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Mon, 15 Aug 2022 09:18:27 +0200 Subject: [PATCH 251/555] Add caret --- templates/flutter/pubspec.yaml.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 7bec28d344..7faf90a466 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -14,7 +14,7 @@ dependencies: device_info_plus: ^4.1.2 flutter_web_auth: ^0.4.1 http: ^0.13.5 - package_info_plus: 1.4.3+1 + package_info_plus: ^1.4.3+1 path_provider: ^2.0.11 web_socket_channel: ^2.2.0 From 9a3125323c68e5f68a164cc552d896f56d0f781d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 08:53:20 +0000 Subject: [PATCH 252/555] update permissions class spec --- .../main/java/io/appwrite/Permissions.kt.twig | 89 +++------------ templates/dart/lib/permissions.dart.twig | 103 ++---------------- templates/deno/src/permissions.ts.twig | 74 ++----------- templates/flutter/lib/permissions.dart.twig | 103 ++---------------- .../kotlin/io/appwrite/Permissions.kt.twig | 89 +++------------ templates/node/lib/permissions.js.twig | 73 ++----------- templates/php/src/Permissions.php.twig | 98 ++--------------- templates/python/package/permissions.py.twig | 53 ++------- .../ruby/lib/container/permissions.rb.twig | 58 ++-------- .../swift/Sources/Permissions.swift.twig | 99 ++--------------- templates/web/src/permissions.ts.twig | 74 ++----------- 11 files changed, 120 insertions(+), 793 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig b/templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig index 5e5200e607..5b8b890ae6 100644 --- a/templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig @@ -2,79 +2,20 @@ package {{ sdk.namespace | caseDot }} class Permissions { companion object { - - fun from( - read: List = listOf(), - write: List = listOf(), - create: List = listOf(), - update: List = listOf(), - delete: List = listOf(), - admin: List = listOf(), - ): List { - val permissions = mutableListOf() - - if (read.isNotEmpty()) { - permissions.add(read(*read.toTypedArray())) - } - if (write.isNotEmpty()) { - permissions.add(write(*write.toTypedArray())) - } - if (create.isNotEmpty()) { - permissions.add(create(*create.toTypedArray())) - } - if (update.isNotEmpty()) { - permissions.add(update(*update.toTypedArray())) - } - if (delete.isNotEmpty()) { - permissions.add(delete(*delete.toTypedArray())) - } - if (admin.isNotEmpty()) { - permissions.add(admin(*admin.toTypedArray())) - } - - return permissions - } - - fun read(vararg permissions: String): String { - if (permissions.isEmpty()) { - throw IllegalArgumentException("At least one permission must be provided.") - } - return "read(${permissions.joinToString(",")})" - } - - fun write(vararg permissions: String): String { - if (permissions.isEmpty()) { - throw IllegalArgumentException("At least one permission must be provided.") - } - return "write(${permissions.joinToString(",")})" - } - - fun create(vararg permissions: String): String { - if (permissions.isEmpty()) { - throw IllegalArgumentException("At least one permission must be provided.") - } - return "create(${permissions.joinToString(",")})" - } - - fun update(vararg permissions: String): String { - if (permissions.isEmpty()) { - throw IllegalArgumentException("At least one permission must be provided.") - } - return "update(${permissions.joinToString(",")})" - } - - fun delete(vararg permissions: String): String { - if (permissions.isEmpty()) { - throw IllegalArgumentException("At least one permission must be provided.") - } - return "delete(${permissions.joinToString(",")})" - } - - fun admin(vararg permissions: String): String { - if (permissions.isEmpty()) { - throw IllegalArgumentException("At least one permission must be provided.") - } - return "admin(${permissions.joinToString(",")})" - } + fun read(var role: String): String { + return "read(\"${role}\")" + } + fun write(var role: String): String { + return "write(\"${role}\")" + } + fun create(var role: String): String { + return "create(\"${role}\")" + } + fun update(var role: String): String { + return "update(\"${role}\")" + } + fun delete(var role: String): String { + return "delete(\"${role}\")" + } } } \ No newline at end of file diff --git a/templates/dart/lib/permissions.dart.twig b/templates/dart/lib/permissions.dart.twig index 961a40ed83..1b68d3890b 100644 --- a/templates/dart/lib/permissions.dart.twig +++ b/templates/dart/lib/permissions.dart.twig @@ -1,102 +1,19 @@ part of {{ language.params.packageName }}; class Permissions { - - static List from( - List read = [], - List write = [], - List create = [], - List update = [], - List delete = [], - List admin = [], - ) { - final permissions = []; - - if (read.isNotEmpty) { - permissions.add(Permissions.read(read)); - } - if (write.isNotEmpty) { - permissions.add(Permissions.write(write)); - } - if (create.isNotEmpty) { - permissions.add(Permissions.create(create)); - } - if (update.isNotEmpty) { - permissions.add(Permissions.update(update)); - } - if (delete.isNotEmpty) { - permissions.add(Permissions.delete(delete)); - } - if (admin.isNotEmpty) { - permissions.add(Permissions.admin(admin)); - } - - return permissions; - } - - static String read(List permissions) { - if (read.isEmpty) { - throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); - } - return "read(${permissions.join(",")})"; - } - - static String read(String permission) { - return Permissions.read([permission]); - } - - static String write(List permissions) { - if (write.isEmpty) { - throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); - } - return "write(${permissions.join(",")})"; + static String read(String role) { + return 'read("$role")'; } - - static String write(String permission) { - return Permissions.write([permission]); + static String write(String role) { + return 'write("$role")'; } - - static String create(List permissions) { - if (create.isEmpty) { - throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); - } - return "create(${permissions.join(",")})"; + static String create(String role) { + return 'create("$role")'; } - - static String create(String permission) { - return Permissions.create([permission]); + static String update(String role) { + return 'update("$role")'; } - - static String update(List permissions) { - if (update.isEmpty) { - throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); - } - return "update(${permissions.join(",")})"; - } - - static String update(String permission) { - return Permissions.update([permission]); - } - - static String delete(List permissions) { - if (delete.isEmpty) { - throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); - } - return "delete(${permissions.join(",")})"; - } - - static String delete(String permission) { - return Permissions.delete([permission]); - } - - static String admin(List permissions) { - if (admin.isEmpty) { - throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); - } - return "admin(${permissions.join(",")})"; - } - - static String admin(String permission) { - return Permissions.admin([permission]); + static String delete(String role) { + return 'delete("$role")'; } } diff --git a/templates/deno/src/permissions.ts.twig b/templates/deno/src/permissions.ts.twig index 601bde469a..ae396e7f90 100644 --- a/templates/deno/src/permissions.ts.twig +++ b/templates/deno/src/permissions.ts.twig @@ -1,76 +1,22 @@ export class Permissions { - static from = ( - read: string[] = [], - write: string[] = [], - create: string[] = [], - update: string[] = [], - xdelete: string[] = [], - admin: string[] = [], - ): string[] => { - const permissions = []; - - if (read.length > 0) { - permissions.push(Permissions.read(read)); - } - if (write.length > 0) { - permissions.push(Permissions.write(write)); - } - if (create.length > 0) { - permissions.push(Permissions.create(create)); - } - if (update.length > 0) { - permissions.push(Permissions.update(update)); - } - if (xdelete.length > 0) { - permissions.push(Permissions.delete(xdelete)); - } - if (admin.length > 0) { - permissions.push(Permissions.admin(admin)); - } - - return permissions - } - - static read = (...permissions: string[]): string => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `read(${permissions.join(',')})` - } - - static write = (...permissions: string[]): string => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `write(${permissions.join(',')})` + static read = (role: string[]): string => { + return `read("${role}")` } - static create = (...permissions: string[]): string => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `create(${permissions.join(',')})` + static write = (role: string[]): string => { + return `write("${role}")` } - static update = (...permissions: string[]): string => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `update(${permissions.join(',')})` + static create = (role: string[]): string => { + return `create("${role}")` } - static delete = (...permissions: string[]): string => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `delete(${permissions.join(',')})` + static update = (role: string[]): string => { + return `update("${role}")` } - static admin = (...permissions: string[]): string => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `admin(${permissions.join(',')})` + static delete = (role: string[]): string => { + return `delete("${role}")` } } diff --git a/templates/flutter/lib/permissions.dart.twig b/templates/flutter/lib/permissions.dart.twig index 961a40ed83..1b68d3890b 100644 --- a/templates/flutter/lib/permissions.dart.twig +++ b/templates/flutter/lib/permissions.dart.twig @@ -1,102 +1,19 @@ part of {{ language.params.packageName }}; class Permissions { - - static List from( - List read = [], - List write = [], - List create = [], - List update = [], - List delete = [], - List admin = [], - ) { - final permissions = []; - - if (read.isNotEmpty) { - permissions.add(Permissions.read(read)); - } - if (write.isNotEmpty) { - permissions.add(Permissions.write(write)); - } - if (create.isNotEmpty) { - permissions.add(Permissions.create(create)); - } - if (update.isNotEmpty) { - permissions.add(Permissions.update(update)); - } - if (delete.isNotEmpty) { - permissions.add(Permissions.delete(delete)); - } - if (admin.isNotEmpty) { - permissions.add(Permissions.admin(admin)); - } - - return permissions; - } - - static String read(List permissions) { - if (read.isEmpty) { - throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); - } - return "read(${permissions.join(",")})"; - } - - static String read(String permission) { - return Permissions.read([permission]); - } - - static String write(List permissions) { - if (write.isEmpty) { - throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); - } - return "write(${permissions.join(",")})"; + static String read(String role) { + return 'read("$role")'; } - - static String write(String permission) { - return Permissions.write([permission]); + static String write(String role) { + return 'write("$role")'; } - - static String create(List permissions) { - if (create.isEmpty) { - throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); - } - return "create(${permissions.join(",")})"; + static String create(String role) { + return 'create("$role")'; } - - static String create(String permission) { - return Permissions.create([permission]); + static String update(String role) { + return 'update("$role")'; } - - static String update(List permissions) { - if (update.isEmpty) { - throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); - } - return "update(${permissions.join(",")})"; - } - - static String update(String permission) { - return Permissions.update([permission]); - } - - static String delete(List permissions) { - if (delete.isEmpty) { - throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); - } - return "delete(${permissions.join(",")})"; - } - - static String delete(String permission) { - return Permissions.delete([permission]); - } - - static String admin(List permissions) { - if (admin.isEmpty) { - throw {{ spec.title | caseUcfirst }}Exception('At least one permission is required.'); - } - return "admin(${permissions.join(",")})"; - } - - static String admin(String permission) { - return Permissions.admin([permission]); + static String delete(String role) { + return 'delete("$role")'; } } diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig index 5e5200e607..5b8b890ae6 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig @@ -2,79 +2,20 @@ package {{ sdk.namespace | caseDot }} class Permissions { companion object { - - fun from( - read: List = listOf(), - write: List = listOf(), - create: List = listOf(), - update: List = listOf(), - delete: List = listOf(), - admin: List = listOf(), - ): List { - val permissions = mutableListOf() - - if (read.isNotEmpty()) { - permissions.add(read(*read.toTypedArray())) - } - if (write.isNotEmpty()) { - permissions.add(write(*write.toTypedArray())) - } - if (create.isNotEmpty()) { - permissions.add(create(*create.toTypedArray())) - } - if (update.isNotEmpty()) { - permissions.add(update(*update.toTypedArray())) - } - if (delete.isNotEmpty()) { - permissions.add(delete(*delete.toTypedArray())) - } - if (admin.isNotEmpty()) { - permissions.add(admin(*admin.toTypedArray())) - } - - return permissions - } - - fun read(vararg permissions: String): String { - if (permissions.isEmpty()) { - throw IllegalArgumentException("At least one permission must be provided.") - } - return "read(${permissions.joinToString(",")})" - } - - fun write(vararg permissions: String): String { - if (permissions.isEmpty()) { - throw IllegalArgumentException("At least one permission must be provided.") - } - return "write(${permissions.joinToString(",")})" - } - - fun create(vararg permissions: String): String { - if (permissions.isEmpty()) { - throw IllegalArgumentException("At least one permission must be provided.") - } - return "create(${permissions.joinToString(",")})" - } - - fun update(vararg permissions: String): String { - if (permissions.isEmpty()) { - throw IllegalArgumentException("At least one permission must be provided.") - } - return "update(${permissions.joinToString(",")})" - } - - fun delete(vararg permissions: String): String { - if (permissions.isEmpty()) { - throw IllegalArgumentException("At least one permission must be provided.") - } - return "delete(${permissions.joinToString(",")})" - } - - fun admin(vararg permissions: String): String { - if (permissions.isEmpty()) { - throw IllegalArgumentException("At least one permission must be provided.") - } - return "admin(${permissions.joinToString(",")})" - } + fun read(var role: String): String { + return "read(\"${role}\")" + } + fun write(var role: String): String { + return "write(\"${role}\")" + } + fun create(var role: String): String { + return "create(\"${role}\")" + } + fun update(var role: String): String { + return "update(\"${role}\")" + } + fun delete(var role: String): String { + return "delete(\"${role}\")" + } } } \ No newline at end of file diff --git a/templates/node/lib/permissions.js.twig b/templates/node/lib/permissions.js.twig index ec55ef5e25..73b15a7836 100644 --- a/templates/node/lib/permissions.js.twig +++ b/templates/node/lib/permissions.js.twig @@ -1,78 +1,25 @@ class Permissions { - static from = ( - read = [], - write = [], - create = [], - update = [], - xdelete = [], - admin = [] - ) => { - const permissions = []; - - if (read.length > 0) { - permissions.push(Permissions.read(read)); - } - if (write.length > 0) { - permissions.push(Permissions.write(write)); - } - if (create.length > 0) { - permissions.push(Permissions.create(create)); - } - if (update.length > 0) { - permissions.push(Permissions.update(update)); - } - if (xdelete.length > 0) { - permissions.push(Permissions.delete(xdelete)); - } - if (admin.length > 0) { - permissions.push(Permissions.admin(admin)); - } - - return permissions + static read = (role) => { + return `read("${role}")` } - static read = (...permissions) => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `read(${permissions.join(',')})` + static write = (role) => { + return `write("${role}")` } - static write = (...permissions) => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `write(${permissions.join(',')})` + static create = (role) => { + return `create("${role}")` } - static create = (...permissions) => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `create(${permissions.join(',')})` + static update = (role) => { + return `update("${role}")` } - static update = (...permissions) => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `update(${permissions.join(',')})` + static delete = (role) => { + return `delete("${role}")` } - static delete = (...permissions) => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `delete(${permissions.join(',')})` - } - - static admin = (...permissions) => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `admin(${permissions.join(',')})` - } } module.exports = Permissions; diff --git a/templates/php/src/Permissions.php.twig b/templates/php/src/Permissions.php.twig index 14f0d5aabd..12d82c9834 100644 --- a/templates/php/src/Permissions.php.twig +++ b/templates/php/src/Permissions.php.twig @@ -4,102 +4,24 @@ namespace {{ spec.title | caseUcfirst }}; class Permissions { - public static function from( - array $read = [], - array $write = [], - array $create = [], - array $update = [], - array $delete = [], - array $admin = [] - ): array + public static function read(string $role): string { - $permissions = []; - - if (!empty($read)) { - $permissions[] = self::read(...$read); - } - if (!empty($write)) { - $permissions[] = self::write(...$write); - } - if (!empty($create)) { - $permissions[] = self::create(...$create); - } - if (!empty($update)) { - $permissions[] = self::update(...$update); - } - if (!empty($delete)) { - $permissions[] = self::delete(...$delete); - } - if (!empty($admin)) { - $permissions[] = self::admin(...$admin); - } - - return $permissions; - } - - /** - * @throws {{ spec.title | caseUcfirst Exception - */ - public static function read(string ...$permissions): string - { - if (empty($permissions)) { - throw new {{ spec.title | caseUcfirst Exception('At least one permission must be provided.'); - } - return 'read(' . implode(',', $permissions) . ')'; - } - - /** - * @throws {{ spec.title | caseUcfirst Exception - */ - public static function write(string ...$permissions): string - { - if (empty($permissions)) { - throw new {{ spec.title | caseUcfirst Exception('At least one permission must be provided.'); - } - return 'write(' . implode(',', $permissions) . ')'; + return 'read("' $role . '")'; } - - /** - * @throws {{ spec.title | caseUcfirst Exception - */ - public static function create(string ...$permissions): string + public static function write(string $role): string { - if (empty($permissions)) { - throw new {{ spec.title | caseUcfirst Exception('At least one permission must be provided.'); - } - return 'create(' . implode(',', $permissions) . ')'; + return 'write("' $role . '")'; } - - /** - * @throws {{ spec.title | caseUcfirst Exception - */ - public static function update(string ...$permissions): string + public static function create(string $role): string { - if (empty($permissions)) { - throw new {{ spec.title | caseUcfirst Exception('At least one permission must be provided.'); - } - return 'update(' . implode(',', $permissions) . ')'; + return 'create("' $role . '")'; } - - /** - * @throws {{ spec.title | caseUcfirst Exception - */ - public static function delete(string ...$permissions): string + public static function update(string $role): string { - if (empty($permissions)) { - throw new {{ spec.title | caseUcfirst Exception('At least one permission must be provided.'); - } - return 'delete(' . implode(',', $permissions) . ')'; + return 'update("' $role . '")'; } - - /** - * @throws {{ spec.title | caseUcfirst Exception - */ - public static function admin(string ...$permissions): string + public static function delete(string $role): string { - if (empty($permissions)) { - throw new {{ spec.title | caseUcfirst Exception('At least one permission must be provided.'); - } - return 'admin(' . implode(',', $permissions) . ')'; + return 'delete("' $role . '")'; } } diff --git a/templates/python/package/permissions.py.twig b/templates/python/package/permissions.py.twig index b49b92233a..5ff72fff2a 100644 --- a/templates/python/package/permissions.py.twig +++ b/templates/python/package/permissions.py.twig @@ -1,54 +1,21 @@ class Permissions: @staticmethod - def from(read = [], write = [], create = [], update = [], delete = [], admin = []): - permissions = [] - if read: - permissions.append(Permissions.read(read)) - if write: - permissions.append(Permissions.write(write)) - if create: - permissions.append(Permissions.create(create)) - if update: - permissions.append(Permissions.update(update)) - if delete: - permissions.append(Permissions.delete(delete)) - if admin: - permissions.append(Permissions.admin(admin)) - return permissions + def read(role): + return f'read("{role}")' @staticmethod - def read(*permissions): - if !permissions: - raise {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided') - return f'read({",".join(permissions)})' + def write(role): + return f'write("{role}")' @staticmethod - def write(*permissions): - if !permissions: - raise {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided') - return f'write({",".join(permissions)})' + def create(role): + return f'create("{role}")' @staticmethod - def create(*permissions): - if !permissions: - raise {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided') - return f'create({",".join(permissions)})' + def update(role): + return f'update("{role}")' @staticmethod - def update(*permissions): - if !permissions: - raise {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided') - return f'update({",".join(permissions)})' - - @staticmethod - def delete(*permissions): - if !permissions: - raise {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided') - return f'delete({",".join(permissions)})' - - @staticmethod - def admin(*permissions): - if !permissions: - raise {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided') - return f'admin({",".join(permissions)})' \ No newline at end of file + def delete(role): + return f'delete("{role}")' diff --git a/templates/ruby/lib/container/permissions.rb.twig b/templates/ruby/lib/container/permissions.rb.twig index 3e1abb9397..9724b4d0c6 100644 --- a/templates/ruby/lib/container/permissions.rb.twig +++ b/templates/ruby/lib/container/permissions.rb.twig @@ -1,58 +1,20 @@ module {{spec.title | caseUcfirst}} class Permissions class << Permissions - - def from(read = [], write = [], create = [], update = [], delete = [], admin = []) - permissions = [] - permissions << Permissions.read(read) unless read.empty? - permissions << Permissions.write(write) unless write.empty? - permissions << Permissions.create(create) unless create.empty? - permissions << Permissions.update(update) unless update.empty? - permissions << Permissions.delete(delete) unless delete.empty? - permissions << Permissions.admin(admin) unless admin.empty? - permissions + def read(*role) + return "read(\"#{role}\")" end - - def read(*permissions) - if permissions.empty? - raise {{ spec.title | caseUcfirst }}::Exception.new('At least one permission must be provided') - end - return "read(#{permissions.join(",")})" + def write(*role) + return "write(\"#{role}\")" end - - def write(*permissions) - if permissions.empty? - raise {{ spec.title | caseUcfirst }}::Exception.new('At least one permission must be provided') - end - return "write(#{permissions.join(",")})" + def create(*role) + return "create(\"#{role}\")" end - - def create(*permissions) - if permissions.empty? - raise {{ spec.title | caseUcfirst }}::Exception.new('At least one permission must be provided') - end - return "create(#{permissions.join(",")})" + def update(*role) + return "update(\"#{role}\")" end - - def update(*permissions) - if permissions.empty? - raise {{ spec.title | caseUcfirst }}::Exception.new('At least one permission must be provided') - end - return "update(#{permissions.join(",")})" - end - - def delete(*permissions) - if permissions.empty? - raise {{ spec.title | caseUcfirst }}::Exception.new('At least one permission must be provided') - end - return "delete(#{permissions.join(",")})" - end - - def admin(*permissions) - if permissions.empty? - raise {{ spec.title | caseUcfirst }}::Exception.new('At least one permission must be provided') - end - return "admin(#{permissions.join(",")})" + def delete(*role) + return "delete(\"#{role}\")" end end end diff --git a/templates/swift/Sources/Permissions.swift.twig b/templates/swift/Sources/Permissions.swift.twig index c818796f97..87b0b2eda5 100644 --- a/templates/swift/Sources/Permissions.swift.twig +++ b/templates/swift/Sources/Permissions.swift.twig @@ -1,100 +1,21 @@ public class Permissions { - - public static func from( - read: [String] = [], - write: [String] = [], - create: [String] = [], - update: [String] = [], - delete: [String] = [], - admin: [String] = [], - ) -> [String] { - let permissions = [] - - if read.count > 0 { - permissions.append(Permissions.read(read)) - } - if write.count > 0 { - permissions.append(Permissions.write(write)) - } - if create.count > 0 { - permissions.append(Permissions.create(create)) - } - if update.count > 0 { - permissions.append(Permissions.update(update)) - } - if delete.count > 0 { - permissions.append(Permissions.delete(delete)) - } - if admin.count > 0 { - permissions.append(Permissions.admin(admin)) - } - - return permissions - } - - public static func read(_ permissions: [String]) -> String { - if permissions.count == 0 { - throw {{ spec.title | caseUcfirst }}Error(message: "At least one permission must be provided.") - } - return "read(\(permissions.joined(separator: ","))" - } - - public static func read(_ permissions: String...) -> String { - return Permissions.read(permissions) - } - - public static func write(_ permissions: [String]) -> String { - if permissions.count == 0 { - throw {{ spec.title | caseUcfirst }}Error(message: "At least one permission must be provided.") - } - return "write(\(permissions.joined(separator: ","))" - } - - public static func write(_ permissions: String...) -> String { - return Permissions.write(permissions) - } - - public static func create(_ permissions: [String]) -> String { - if permissions.count == 0 { - throw {{ spec.title | caseUcfirst }}Error(message: "At least one permission must be provided.") - } - return "create(\(permissions.joined(separator: ","))" - } - - public static func create(_ permissions: String...) -> String { - return Permissions.create(permissions) - } - - public static func update(_ permissions: [String]) -> String { - if permissions.count == 0 { - throw {{ spec.title | caseUcfirst }}Error(message: "At least one permission must be provided.") - } - return "update(\(permissions.joined(separator: ","))" - } - - public static func update(_ permissions: String...) -> String { - return Permissions.update(permissions) + public static func read(_ role: String) -> String { + return "read(\"\(role)\")" } - public static func delete(_ permissions: [String]) -> String { - if permissions.count == 0 { - throw {{ spec.title | caseUcfirst }}Error(message: "At least one permission must be provided.") - } - return "delete(\(permissions.joined(separator: ","))" + public static func write(_ role: String) -> String { + return "write(\"\(role)\")" } - public static func delete(_ permissions: String...) -> String { - return Permissions.delete(permissions) + public static func create(_ role: String) -> String { + return "create(\"\(role)\")" } - public static func admin(_ permissions: [String]) -> String { - if permissions.count == 0 { - throw {{ spec.title | caseUcfirst }}Error(message: "At least one permission must be provided.") - } - return "admin(\(permissions.joined(separator: ","))" + public static func update(_ role: String) -> String { + return "update(\"\(role)\")" } - public static func admin(_ permissions: String...) -> String { - return Permissions.admin(permissions) + public static func delete(_ role: String) -> String { + return "delete(\"\(role)\")" } } \ No newline at end of file diff --git a/templates/web/src/permissions.ts.twig b/templates/web/src/permissions.ts.twig index 601bde469a..ae396e7f90 100644 --- a/templates/web/src/permissions.ts.twig +++ b/templates/web/src/permissions.ts.twig @@ -1,76 +1,22 @@ export class Permissions { - static from = ( - read: string[] = [], - write: string[] = [], - create: string[] = [], - update: string[] = [], - xdelete: string[] = [], - admin: string[] = [], - ): string[] => { - const permissions = []; - - if (read.length > 0) { - permissions.push(Permissions.read(read)); - } - if (write.length > 0) { - permissions.push(Permissions.write(write)); - } - if (create.length > 0) { - permissions.push(Permissions.create(create)); - } - if (update.length > 0) { - permissions.push(Permissions.update(update)); - } - if (xdelete.length > 0) { - permissions.push(Permissions.delete(xdelete)); - } - if (admin.length > 0) { - permissions.push(Permissions.admin(admin)); - } - - return permissions - } - - static read = (...permissions: string[]): string => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `read(${permissions.join(',')})` - } - - static write = (...permissions: string[]): string => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `write(${permissions.join(',')})` + static read = (role: string[]): string => { + return `read("${role}")` } - static create = (...permissions: string[]): string => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `create(${permissions.join(',')})` + static write = (role: string[]): string => { + return `write("${role}")` } - static update = (...permissions: string[]): string => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `update(${permissions.join(',')})` + static create = (role: string[]): string => { + return `create("${role}")` } - static delete = (...permissions: string[]): string => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `delete(${permissions.join(',')})` + static update = (role: string[]): string => { + return `update("${role}")` } - static admin = (...permissions: string[]): string => { - if (permissions.length === 0) { - throw new {{ spec.title | caseUcfirst }}Exception('At least one permission must be provided'); - } - return `admin(${permissions.join(',')})` + static delete = (role: string[]): string => { + return `delete("${role}")` } } From a9821f90888d1b01c15ec9be99db75ca7794c85e Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 09:06:01 +0000 Subject: [PATCH 253/555] fix permission class --- .../src/main/java/io/appwrite/Permissions.kt.twig | 10 +++++----- .../src/main/kotlin/io/appwrite/Permissions.kt.twig | 10 +++++----- templates/ruby/lib/container/permissions.rb.twig | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig b/templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig index 5b8b890ae6..7f47feaf67 100644 --- a/templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig @@ -2,19 +2,19 @@ package {{ sdk.namespace | caseDot }} class Permissions { companion object { - fun read(var role: String): String { + fun read(role: String): String { return "read(\"${role}\")" } - fun write(var role: String): String { + fun write(role: String): String { return "write(\"${role}\")" } - fun create(var role: String): String { + fun create(role: String): String { return "create(\"${role}\")" } - fun update(var role: String): String { + fun update(role: String): String { return "update(\"${role}\")" } - fun delete(var role: String): String { + fun delete(role: String): String { return "delete(\"${role}\")" } } diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig index 5b8b890ae6..7f47feaf67 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig @@ -2,19 +2,19 @@ package {{ sdk.namespace | caseDot }} class Permissions { companion object { - fun read(var role: String): String { + fun read(role: String): String { return "read(\"${role}\")" } - fun write(var role: String): String { + fun write(role: String): String { return "write(\"${role}\")" } - fun create(var role: String): String { + fun create(role: String): String { return "create(\"${role}\")" } - fun update(var role: String): String { + fun update(role: String): String { return "update(\"${role}\")" } - fun delete(var role: String): String { + fun delete(role: String): String { return "delete(\"${role}\")" } } diff --git a/templates/ruby/lib/container/permissions.rb.twig b/templates/ruby/lib/container/permissions.rb.twig index 9724b4d0c6..a5212abd5f 100644 --- a/templates/ruby/lib/container/permissions.rb.twig +++ b/templates/ruby/lib/container/permissions.rb.twig @@ -1,19 +1,19 @@ module {{spec.title | caseUcfirst}} class Permissions class << Permissions - def read(*role) + def read(role) return "read(\"#{role}\")" end - def write(*role) + def write(role) return "write(\"#{role}\")" end - def create(*role) + def create(role) return "create(\"#{role}\")" end - def update(*role) + def update(role) return "update(\"#{role}\")" end - def delete(*role) + def delete(role) return "delete(\"#{role}\")" end end From f6ccbfff4cb5b196f01b1252ea4d11d796a0cd93 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 09:16:32 +0000 Subject: [PATCH 254/555] swift: ID and Role helper class --- src/SDK/Language/Swift.php | 12 +++++++++++ templates/swift/Sources/ID.swift.twig | 9 ++++++++ templates/swift/Sources/Role.swift.twig | 28 +++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 templates/swift/Sources/ID.swift.twig create mode 100644 templates/swift/Sources/Role.swift.twig diff --git a/src/SDK/Language/Swift.php b/src/SDK/Language/Swift.php index 176e4c12ef..5f5539e9a5 100644 --- a/src/SDK/Language/Swift.php +++ b/src/SDK/Language/Swift.php @@ -164,6 +164,18 @@ public function getFiles() 'template' => 'swift/Sources/Permissions.swift.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Role.swift', + 'template' => 'swift/Sources/Role.swift.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/ID.swift', + 'template' => 'swift/Sources/ID.swift.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Query.swift', diff --git a/templates/swift/Sources/ID.swift.twig b/templates/swift/Sources/ID.swift.twig new file mode 100644 index 0000000000..78f28ec802 --- /dev/null +++ b/templates/swift/Sources/ID.swift.twig @@ -0,0 +1,9 @@ +public class ID { + public static func custom(_ id: String) -> String { + return id + } + + public static func unique() -> String { + return 'unique()' + } +} \ No newline at end of file diff --git a/templates/swift/Sources/Role.swift.twig b/templates/swift/Sources/Role.swift.twig new file mode 100644 index 0000000000..0a90f18ade --- /dev/null +++ b/templates/swift/Sources/Role.swift.twig @@ -0,0 +1,28 @@ +public class Role { + public static func any() -> String { + return 'any' + } + + public static func user(_ id: String) -> String { + return 'user:\(id)' + } + + public static func users() -> String { + return 'users' + } + + public static func guests() -> String { + return 'guests' + } + + public static func team(_ id: String, _ role: String = "") -> String { + if(role == "") { + return 'team:\(id)' + } + return 'team:\(id)/\(role)' + } + + public static func status(_ status: String) -> String { + return 'status:\(status)' + } +} \ No newline at end of file From 3f0fabb4c7f0bc971fedef0a57a34719f8ec5cbe Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 09:24:00 +0000 Subject: [PATCH 255/555] PHP: Role and ID helper classes --- src/SDK/Language/PHP.php | 12 ++++++++++++ templates/php/src/ID.php.twig | 15 +++++++++++++++ templates/php/src/Role.php.twig | 34 +++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 templates/php/src/ID.php.twig create mode 100644 templates/php/src/Role.php.twig diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index ffc2d87488..95f85f7de6 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -184,6 +184,18 @@ public function getFiles() 'template' => 'php/src/Permissions.php.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'src/{{ spec.title | caseUcfirst}}/Role.php', + 'template' => 'php/src/Role.php.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => 'src/{{ spec.title | caseUcfirst}}/ID.php', + 'template' => 'php/src/ID.php.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'src/{{ spec.title | caseUcfirst}}/Query.php', diff --git a/templates/php/src/ID.php.twig b/templates/php/src/ID.php.twig new file mode 100644 index 0000000000..48514d84cc --- /dev/null +++ b/templates/php/src/ID.php.twig @@ -0,0 +1,15 @@ + Date: Mon, 15 Aug 2022 09:46:47 +0000 Subject: [PATCH 256/555] Dart & Flutter: Role and ID helper classes --- src/SDK/Language/Dart.php | 12 ++++++++++++ src/SDK/Language/Flutter.php | 12 ++++++++++++ templates/dart/lib/id.dart.twig | 11 +++++++++++ templates/dart/lib/package.dart.twig | 4 ++++ templates/dart/lib/role.dart.twig | 26 +++++++++++++++++++++++++ templates/flutter/lib/id.dart.twig | 11 +++++++++++ templates/flutter/lib/package.dart.twig | 3 +++ templates/flutter/lib/role.dart.twig | 26 +++++++++++++++++++++++++ 8 files changed, 105 insertions(+) create mode 100644 templates/dart/lib/id.dart.twig create mode 100644 templates/dart/lib/role.dart.twig create mode 100644 templates/flutter/lib/id.dart.twig create mode 100644 templates/flutter/lib/role.dart.twig diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index ef75419130..01d472b455 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -347,6 +347,18 @@ public function getFiles() 'template' => 'dart/lib/permissions.dart.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '/lib/role.dart', + 'template' => 'flutter/lib/role.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/lib/id.dart', + 'template' => 'flutter/lib/id.dart.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/lib/query.dart', diff --git a/src/SDK/Language/Flutter.php b/src/SDK/Language/Flutter.php index 36d9f2e0ef..9226dbe06c 100644 --- a/src/SDK/Language/Flutter.php +++ b/src/SDK/Language/Flutter.php @@ -247,6 +247,18 @@ public function getFiles() 'template' => 'flutter/lib/permissions.dart.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '/lib/role.dart', + 'template' => 'flutter/lib/role.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/lib/id.dart', + 'template' => 'flutter/lib/id.dart.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/lib/query.dart', diff --git a/templates/dart/lib/id.dart.twig b/templates/dart/lib/id.dart.twig new file mode 100644 index 0000000000..12a034738d --- /dev/null +++ b/templates/dart/lib/id.dart.twig @@ -0,0 +1,11 @@ +part of {{ language.params.packageName }}; + +class ID { + static String unique() { + return 'unique()'; + } + + static String custom(String id) { + return id; + } +} \ No newline at end of file diff --git a/templates/dart/lib/package.dart.twig b/templates/dart/lib/package.dart.twig index 6e550eae40..b5b2e3a7fa 100644 --- a/templates/dart/lib/package.dart.twig +++ b/templates/dart/lib/package.dart.twig @@ -16,6 +16,10 @@ export 'src/input_file.dart'; export 'src/upload_progress.dart'; part 'query.dart'; +part 'query.dart'; +part 'permissions.dart'; +part 'role.dart'; +part 'id.dart'; {% for service in spec.services %} part 'services/{{service.name | caseDash}}.dart'; {% endfor %} diff --git a/templates/dart/lib/role.dart.twig b/templates/dart/lib/role.dart.twig new file mode 100644 index 0000000000..dc60884c28 --- /dev/null +++ b/templates/dart/lib/role.dart.twig @@ -0,0 +1,26 @@ +part of {{ language.params.packageName }}; + +class Role { + static String any() { + return 'any'; + } + + static String user(String id) { + return 'user:$id'; + } + + static String users() { + return 'users'; + } + + static String guests() { + return 'guests'; + } + + static String team(String id, [String? role]) { + if(role != null) { + return 'team:$id/$role'; + } + return 'team:$id'; + } +} \ No newline at end of file diff --git a/templates/flutter/lib/id.dart.twig b/templates/flutter/lib/id.dart.twig new file mode 100644 index 0000000000..12a034738d --- /dev/null +++ b/templates/flutter/lib/id.dart.twig @@ -0,0 +1,11 @@ +part of {{ language.params.packageName }}; + +class ID { + static String unique() { + return 'unique()'; + } + + static String custom(String id) { + return id; + } +} \ No newline at end of file diff --git a/templates/flutter/lib/package.dart.twig b/templates/flutter/lib/package.dart.twig index c7a935ca73..b090280d81 100644 --- a/templates/flutter/lib/package.dart.twig +++ b/templates/flutter/lib/package.dart.twig @@ -19,6 +19,9 @@ export 'src/realtime_message.dart'; export 'src/input_file.dart'; part 'query.dart'; +part 'permissions.dart'; +part 'role.dart'; +part 'id.dart'; {% for service in spec.services %} part 'services/{{service.name | caseDash}}.dart'; {% endfor %} \ No newline at end of file diff --git a/templates/flutter/lib/role.dart.twig b/templates/flutter/lib/role.dart.twig new file mode 100644 index 0000000000..dc60884c28 --- /dev/null +++ b/templates/flutter/lib/role.dart.twig @@ -0,0 +1,26 @@ +part of {{ language.params.packageName }}; + +class Role { + static String any() { + return 'any'; + } + + static String user(String id) { + return 'user:$id'; + } + + static String users() { + return 'users'; + } + + static String guests() { + return 'guests'; + } + + static String team(String id, [String? role]) { + if(role != null) { + return 'team:$id/$role'; + } + return 'team:$id'; + } +} \ No newline at end of file From 133b8aa82ec22f68162c6a210309a4ea68beac65 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 09:57:57 +0000 Subject: [PATCH 257/555] python: Role and ID helpers --- src/SDK/Language/Python.php | 12 ++++++++++++ templates/python/package/id.py.twig | 8 ++++++++ templates/python/package/role.py.twig | 26 ++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 templates/python/package/id.py.twig create mode 100644 templates/python/package/role.py.twig diff --git a/src/SDK/Language/Python.php b/src/SDK/Language/Python.php index 7308899106..e828f7aa9a 100644 --- a/src/SDK/Language/Python.php +++ b/src/SDK/Language/Python.php @@ -161,6 +161,18 @@ public function getFiles() 'template' => 'python/package/permissions.py.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '{{ spec.title | caseSnake}}/role.py', + 'template' => 'python/package/role.py.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '{{ spec.title | caseSnake}}/id.py', + 'template' => 'python/package/id.py.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '{{ spec.title | caseSnake}}/query.py', diff --git a/templates/python/package/id.py.twig b/templates/python/package/id.py.twig new file mode 100644 index 0000000000..a9ed5f3264 --- /dev/null +++ b/templates/python/package/id.py.twig @@ -0,0 +1,8 @@ +class ID: + @staticmethod + def custom(id): + return id + + @staticmethod + def unique(): + return 'unique()' \ No newline at end of file diff --git a/templates/python/package/role.py.twig b/templates/python/package/role.py.twig new file mode 100644 index 0000000000..4ebe1b4908 --- /dev/null +++ b/templates/python/package/role.py.twig @@ -0,0 +1,26 @@ +class Role: + @staticmethod + def any(): + return 'any' + + @staticmethod + def user(id): + return 'user:\(id)' + + @staticmethod + def users(): + return 'users' + + @staticmethod + def guests(): + return 'guests' + + @staticmethod + def team(id, role = ""): + if(role == ""): + return 'team:\(id)' + return 'team:\(id)/\(role)' + + @staticmethod + def status(status): + return 'status:\(status)' \ No newline at end of file From 616ef4318f0751cefb71887d0ecd2bc61aff0537 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 10:01:34 +0000 Subject: [PATCH 258/555] Kotlin & Android: Role and ID helper class --- src/SDK/Language/Android.php | 10 +++++++++ src/SDK/Language/Kotlin.php | 12 ++++++++++ .../src/main/java/io/appwrite/ID.kt.twig | 10 +++++++++ .../src/main/java/io/appwrite/Role.kt.twig | 22 +++++++++++++++++++ .../src/main/kotlin/io/appwrite/ID.kt.twig | 10 +++++++++ .../src/main/kotlin/io/appwrite/Role.kt.twig | 22 +++++++++++++++++++ 6 files changed, 86 insertions(+) create mode 100644 templates/android/library/src/main/java/io/appwrite/ID.kt.twig create mode 100644 templates/android/library/src/main/java/io/appwrite/Role.kt.twig create mode 100644 templates/kotlin/src/main/kotlin/io/appwrite/ID.kt.twig create mode 100644 templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig diff --git a/src/SDK/Language/Android.php b/src/SDK/Language/Android.php index 89d8da98da..4527d111f5 100644 --- a/src/SDK/Language/Android.php +++ b/src/SDK/Language/Android.php @@ -111,6 +111,16 @@ public function getFiles() 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/Permissions.kt', 'template' => '/android/library/src/main/java/io/appwrite/Permissions.kt.twig', ], + [ + 'scope' => 'default', + 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/Role.kt', + 'template' => '/android/library/src/main/java/io/appwrite/Role.kt.twig', + ], + [ + 'scope' => 'default', + 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/ID.kt', + 'template' => '/android/library/src/main/java/io/appwrite/ID.kt.twig', + ], [ 'scope' => 'default', 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/Query.kt', diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index bfe43b966a..a119af180a 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -363,6 +363,18 @@ public function getFiles() 'template' => '/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/Role.kt', + 'template' => '/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/ID.kt', + 'template' => '/kotlin/src/main/kotlin/io/appwrite/ID.kt.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/Query.kt', diff --git a/templates/android/library/src/main/java/io/appwrite/ID.kt.twig b/templates/android/library/src/main/java/io/appwrite/ID.kt.twig new file mode 100644 index 0000000000..3ac3c98b04 --- /dev/null +++ b/templates/android/library/src/main/java/io/appwrite/ID.kt.twig @@ -0,0 +1,10 @@ +package {{ sdk.namespace | caseDot }} + +class ID { + companion object { + fun custom(id: String): String + = id + fun unique(): String + = "unique()" + } +} \ No newline at end of file diff --git a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig new file mode 100644 index 0000000000..88acd0261b --- /dev/null +++ b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig @@ -0,0 +1,22 @@ +package {{ sdk.namespace | caseDot }} + +class Role { + companion object { + fun any(): String + = "any" + fun user(id: String): String + = "user:$id" + fun users(): String + = "users" + fun guests(): String + = "guests" + fun team(id: String, role: String = ""): String + = if(role == "") { + "team:$id" + } else { + "team:$id/$role" + } + fun status(status: String): String + = "status:$status" + } +} \ No newline at end of file diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/ID.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/ID.kt.twig new file mode 100644 index 0000000000..3ac3c98b04 --- /dev/null +++ b/templates/kotlin/src/main/kotlin/io/appwrite/ID.kt.twig @@ -0,0 +1,10 @@ +package {{ sdk.namespace | caseDot }} + +class ID { + companion object { + fun custom(id: String): String + = id + fun unique(): String + = "unique()" + } +} \ No newline at end of file diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig new file mode 100644 index 0000000000..88acd0261b --- /dev/null +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig @@ -0,0 +1,22 @@ +package {{ sdk.namespace | caseDot }} + +class Role { + companion object { + fun any(): String + = "any" + fun user(id: String): String + = "user:$id" + fun users(): String + = "users" + fun guests(): String + = "guests" + fun team(id: String, role: String = ""): String + = if(role == "") { + "team:$id" + } else { + "team:$id/$role" + } + fun status(status: String): String + = "status:$status" + } +} \ No newline at end of file From eef6e1606d75024eade20b68dc95f1d74d23a76c Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 10:04:11 +0000 Subject: [PATCH 259/555] Ruby: Role and ID helper classes --- src/SDK/Language/Ruby.php | 12 +++++++++ templates/ruby/lib/container/id.rb.twig | 11 ++++++++ templates/ruby/lib/container/role.rb.twig | 31 +++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 templates/ruby/lib/container/id.rb.twig create mode 100644 templates/ruby/lib/container/role.rb.twig diff --git a/src/SDK/Language/Ruby.php b/src/SDK/Language/Ruby.php index 51b40f26aa..1c52aec75d 100644 --- a/src/SDK/Language/Ruby.php +++ b/src/SDK/Language/Ruby.php @@ -139,6 +139,18 @@ public function getFiles() 'template' => 'ruby/lib/container/permissions.rb.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'lib/{{ spec.title | caseDash }}/role.rb', + 'template' => 'ruby/lib/container/role.rb.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => 'lib/{{ spec.title | caseDash }}/id.rb', + 'template' => 'ruby/lib/container/id.rb.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'lib/{{ spec.title | caseDash }}/query.rb', diff --git a/templates/ruby/lib/container/id.rb.twig b/templates/ruby/lib/container/id.rb.twig new file mode 100644 index 0000000000..29ed99b0df --- /dev/null +++ b/templates/ruby/lib/container/id.rb.twig @@ -0,0 +1,11 @@ +module {{spec.title | caseUcfirst}} + class ID + def self.custom(id) + id + end + + def self.unique + 'unique()' + end + end +end \ No newline at end of file diff --git a/templates/ruby/lib/container/role.rb.twig b/templates/ruby/lib/container/role.rb.twig new file mode 100644 index 0000000000..c4d4f978b3 --- /dev/null +++ b/templates/ruby/lib/container/role.rb.twig @@ -0,0 +1,31 @@ +module {{spec.title | caseUcfirst}} + class Role + def self.any + 'any' + end + + def self.user(id) + "user:#{id}" + end + + def self.users + 'users' + end + + def self.guests + 'guests' + end + + def self.team(id, role = "") + if(role == "") + "team:#{id}" + else + "team:#{id}/#{role}" + end + end + + def self.status(status) + "status:#{status}" + end + end +end \ No newline at end of file From 511db667512a2778ae5c617d2fef1612f16586bf Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 10:13:23 +0000 Subject: [PATCH 260/555] Deno: Role and ID helper classes --- src/SDK/Language/Deno.php | 12 ++++++++++++ templates/deno/src/id.ts.twig | 9 +++++++++ templates/deno/src/role.ts.twig | 28 ++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 templates/deno/src/id.ts.twig create mode 100644 templates/deno/src/role.ts.twig diff --git a/src/SDK/Language/Deno.php b/src/SDK/Language/Deno.php index b5d2fdee32..4133313301 100644 --- a/src/SDK/Language/Deno.php +++ b/src/SDK/Language/Deno.php @@ -36,6 +36,18 @@ public function getFiles() 'template' => 'deno/src/permissions.ts.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'src/role.ts', + 'template' => 'deno/src/role.ts.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => 'src/id.ts', + 'template' => 'deno/src/id.ts.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'src/query.ts', diff --git a/templates/deno/src/id.ts.twig b/templates/deno/src/id.ts.twig new file mode 100644 index 0000000000..9577e4b179 --- /dev/null +++ b/templates/deno/src/id.ts.twig @@ -0,0 +1,9 @@ +export class ID { + public static custom(id: string): string { + return id + } + + public static unique(): string { + return 'unique()' + } +} \ No newline at end of file diff --git a/templates/deno/src/role.ts.twig b/templates/deno/src/role.ts.twig new file mode 100644 index 0000000000..55dff0c8db --- /dev/null +++ b/templates/deno/src/role.ts.twig @@ -0,0 +1,28 @@ +export class Role { + public static any(): string { + return 'any' + } + + public static user(id: string): string { + return 'user:\(id)' + } + + public static users(): string { + return 'users' + } + + public static guests(): string { + return 'guests' + } + + public static team(id: string, role: string = ''): string { + if(role == '') { + return 'team:\(id)' + } + return 'team:\(id)/\(role)' + } + + public static status(status: string): string { + return 'status:\(status)' + } +} \ No newline at end of file From c5877ea9a1c23ab08a728b2c6c0cdab5e3ecaca7 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 10:13:51 +0000 Subject: [PATCH 261/555] Node: Role and ID helpers --- src/SDK/Language/Node.php | 12 ++++++++++++ templates/node/lib/id.js.twig | 13 +++++++++++++ templates/node/lib/role.js.twig | 25 +++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 templates/node/lib/id.js.twig create mode 100644 templates/node/lib/role.js.twig diff --git a/src/SDK/Language/Node.php b/src/SDK/Language/Node.php index 66c7e6597a..c50b378221 100644 --- a/src/SDK/Language/Node.php +++ b/src/SDK/Language/Node.php @@ -65,6 +65,18 @@ public function getFiles() 'template' => 'node/lib/permissions.js.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'lib/role.js', + 'template' => 'node/lib/role.js.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => 'lib/id.js', + 'template' => 'node/lib/id.js.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'lib/query.js', diff --git a/templates/node/lib/id.js.twig b/templates/node/lib/id.js.twig new file mode 100644 index 0000000000..9d0256d3dc --- /dev/null +++ b/templates/node/lib/id.js.twig @@ -0,0 +1,13 @@ +class ID { + + static unique = () => { + return 'unique()' + } + + static custom = (id) => { + return id + } + +} + +module.exports = ID; diff --git a/templates/node/lib/role.js.twig b/templates/node/lib/role.js.twig new file mode 100644 index 0000000000..0606dd4925 --- /dev/null +++ b/templates/node/lib/role.js.twig @@ -0,0 +1,25 @@ +class Role { + static any = () => { + return 'any' + } + static user = (id) => { + return 'user:' + id + } + static users = () => { + return 'users' + } + static guests = () => { + return 'guests' + } + static team = (id, role = '') => { + if(role == '') { + return 'team:' + id + } + return 'team:' + id + '/' + role + } + static status = (status) => { + return 'status:' + status + } +} + +module.exports = Role; \ No newline at end of file From e20ae0c1c3b30f9088206f4b5568fd7bbcc0aedd Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 10:14:17 +0000 Subject: [PATCH 262/555] Web: Role and ID helper classes --- src/SDK/Language/Web.php | 12 ++++++++++++ templates/web/src/id.ts.twig | 9 +++++++++ templates/web/src/role.ts.twig | 28 ++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 templates/web/src/id.ts.twig create mode 100644 templates/web/src/role.ts.twig diff --git a/src/SDK/Language/Web.php b/src/SDK/Language/Web.php index 31b86b0c68..9bcd5a6416 100644 --- a/src/SDK/Language/Web.php +++ b/src/SDK/Language/Web.php @@ -58,6 +58,18 @@ public function getFiles() 'template' => 'web/src/permissions.ts.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => 'src/role.ts', + 'template' => 'web/src/role.ts.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => 'src/id.ts', + 'template' => 'web/src/id.ts.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'src/query.ts', diff --git a/templates/web/src/id.ts.twig b/templates/web/src/id.ts.twig new file mode 100644 index 0000000000..9577e4b179 --- /dev/null +++ b/templates/web/src/id.ts.twig @@ -0,0 +1,9 @@ +export class ID { + public static custom(id: string): string { + return id + } + + public static unique(): string { + return 'unique()' + } +} \ No newline at end of file diff --git a/templates/web/src/role.ts.twig b/templates/web/src/role.ts.twig new file mode 100644 index 0000000000..55dff0c8db --- /dev/null +++ b/templates/web/src/role.ts.twig @@ -0,0 +1,28 @@ +export class Role { + public static any(): string { + return 'any' + } + + public static user(id: string): string { + return 'user:\(id)' + } + + public static users(): string { + return 'users' + } + + public static guests(): string { + return 'guests' + } + + public static team(id: string, role: string = ''): string { + if(role == '') { + return 'team:\(id)' + } + return 'team:\(id)/\(role)' + } + + public static status(status: string): string { + return 'status:\(status)' + } +} \ No newline at end of file From b7ba4d376ea37dd8322c8c3c979c54e7a91a45dc Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 10:27:01 +0000 Subject: [PATCH 263/555] remove duplicate --- templates/dart/lib/package.dart.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/dart/lib/package.dart.twig b/templates/dart/lib/package.dart.twig index b5b2e3a7fa..6841b4a4b3 100644 --- a/templates/dart/lib/package.dart.twig +++ b/templates/dart/lib/package.dart.twig @@ -15,7 +15,6 @@ export 'src/exception.dart'; export 'src/input_file.dart'; export 'src/upload_progress.dart'; -part 'query.dart'; part 'query.dart'; part 'permissions.dart'; part 'role.dart'; From 334b3eaba14a55acc1a1027bf3b55d20456a9be9 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 10:28:58 +0000 Subject: [PATCH 264/555] POC test for helper classes --- tests/Base.php | 8 ++++++++ tests/DartStableTest.php | 2 ++ tests/languages/dart/tests.dart | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/tests/Base.php b/tests/Base.php index 88f6584c10..fd049fe029 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -58,6 +58,14 @@ abstract class Base extends TestCase 'WS:/v1/realtime:passed', ]; + const QUERY_HELPER_RESPONSES = [ + 'movie.equal("Spiderman","Dr. Strange")' + ]; + + const PERMISSIONS_HELPER_RESPONSES = [ + 'read("user:userid")' + ]; + protected string $class = ''; protected string $language = ''; protected array $build = []; diff --git a/tests/DartStableTest.php b/tests/DartStableTest.php index 4d4cf453a4..465b14180d 100644 --- a/tests/DartStableTest.php +++ b/tests/DartStableTest.php @@ -19,5 +19,7 @@ class DartStableTest extends Base ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, ]; } diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 7aff91edbe..95ec9017f1 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -87,4 +87,8 @@ void main() async { // print(response.result); await general.empty(); + + print(Query.equal('movie', ['Spiderman', 'Dr. Strange'])); + print(Permissions.read(Role.user(ID.custom('userid')))); + } From 9d5e81dbb65975168b87322bcf195406db4c6887 Mon Sep 17 00:00:00 2001 From: nohli <43643339+nohli@users.noreply.github.com> Date: Mon, 15 Aug 2022 12:41:02 +0200 Subject: [PATCH 265/555] Add new line --- templates/flutter/pubspec.yaml.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 7faf90a466..1d1a02b424 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -7,6 +7,7 @@ issue_tracker: https://github.com/appwrite/sdk-generator/issues documentation: {{ spec.contactURL }} environment: sdk: '>=2.17.0 <3.0.0' + dependencies: flutter: sdk: flutter From f536d2e6b848cca696754c96720850d56791909d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 10:49:27 +0000 Subject: [PATCH 266/555] more variety to helper classes tests --- tests/Base.php | 14 ++++++++++++-- tests/languages/dart/tests.dart | 17 +++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/tests/Base.php b/tests/Base.php index fd049fe029..91a4ee09e9 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -59,11 +59,21 @@ abstract class Base extends TestCase ]; const QUERY_HELPER_RESPONSES = [ - 'movie.equal("Spiderman","Dr. Strange")' + 'title.equal("Spiderman","Dr. Strange")', + 'title.notEqual("Spiderman")', + 'releasedYear.lesser(1990)', + 'releasedYear.greater(1990,1999)', + 'name.search("john")', ]; const PERMISSIONS_HELPER_RESPONSES = [ - 'read("user:userid")' + 'read("any")', + 'write("user:userid")', + 'create("users")', + 'update("guests")', + 'delete("team:teamId/owner")', + 'delete("team:teamId")', + 'unique()', ]; protected string $class = ''; diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 95ec9017f1..51c2728a70 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -88,7 +88,20 @@ void main() async { await general.empty(); - print(Query.equal('movie', ['Spiderman', 'Dr. Strange'])); - print(Permissions.read(Role.user(ID.custom('userid')))); + // Query helper tests + print(Query.equal('title', ['Spiderman', 'Dr. Strange'])); + print(Query.notEqual('title', 'Spiderman')); + print(Query.lesser('releasedYear', 1990)); + print(Query.greater('releasedYear', [1990, 1999])); + print(Query.search('name', "john")); + + // Permissions, Role and ID helper tests + print(Permissions.read(Role.any())); + print(Permissions.write(Role.user(ID.custom('userid')))); + print(Permissions.create(Role.users())); + print(Permissions.update(Role.guests())); + print(Permissions.delete(Role.team('teamId', 'owner'))); + print(Permissions.delete(Role.team('teamId'))); + print(ID.unique()); } From a700c279d78f0c330fff663367c78f8bd1a3d970 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 10:52:17 +0000 Subject: [PATCH 267/555] update all flutter and dart tests for include the helper tests --- tests/DartBetaTest.php | 2 ++ tests/FlutterBetaTest.php | 2 ++ tests/FlutterStableTest.php | 2 ++ tests/languages/flutter/tests.dart | 16 ++++++++++++++++ 4 files changed, 22 insertions(+) diff --git a/tests/DartBetaTest.php b/tests/DartBetaTest.php index 173b146e27..22bc81dbf0 100644 --- a/tests/DartBetaTest.php +++ b/tests/DartBetaTest.php @@ -19,5 +19,7 @@ class DartBetaTest extends Base ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, ]; } diff --git a/tests/FlutterBetaTest.php b/tests/FlutterBetaTest.php index 98d6d718d8..dbd6b57ed4 100644 --- a/tests/FlutterBetaTest.php +++ b/tests/FlutterBetaTest.php @@ -21,5 +21,7 @@ class FlutterBetaTest extends Base ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, ]; } diff --git a/tests/FlutterStableTest.php b/tests/FlutterStableTest.php index f93811d1ac..11992ac74c 100644 --- a/tests/FlutterStableTest.php +++ b/tests/FlutterStableTest.php @@ -21,5 +21,7 @@ class FlutterStableTest extends Base ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, ]; } diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index b03b3bc585..839489a2dc 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -107,4 +107,20 @@ void main() async { print(response.result); await general.empty(); + + // Query helper tests + print(Query.equal('title', ['Spiderman', 'Dr. Strange'])); + print(Query.notEqual('title', 'Spiderman')); + print(Query.lesser('releasedYear', 1990)); + print(Query.greater('releasedYear', [1990, 1999])); + print(Query.search('name', "john")); + + // Permissions, Role and ID helper tests + print(Permissions.read(Role.any())); + print(Permissions.write(Role.user(ID.custom('userid')))); + print(Permissions.create(Role.users())); + print(Permissions.update(Role.guests())); + print(Permissions.delete(Role.team('teamId', 'owner'))); + print(Permissions.delete(Role.team('teamId'))); + print(ID.unique()); } From f4b87d2446448a7d5f8bf35a0dda29295f6aa7de Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Aug 2022 16:46:40 +0545 Subject: [PATCH 268/555] Apply suggestions from code review Co-authored-by: Jake Barnby --- templates/php/src/Role.php.twig | 2 +- templates/python/package/role.py.twig | 2 +- templates/ruby/lib/container/role.rb.twig | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/php/src/Role.php.twig b/templates/php/src/Role.php.twig index bf3357586b..9071530399 100644 --- a/templates/php/src/Role.php.twig +++ b/templates/php/src/Role.php.twig @@ -10,7 +10,7 @@ class Role } public static function user(string $id): string { - return 'read("' $role . '")'; + return 'user:' . $id; } public static function users(): string { diff --git a/templates/python/package/role.py.twig b/templates/python/package/role.py.twig index 4ebe1b4908..697a8d64e5 100644 --- a/templates/python/package/role.py.twig +++ b/templates/python/package/role.py.twig @@ -5,7 +5,7 @@ class Role: @staticmethod def user(id): - return 'user:\(id)' + return f'user:{id}' @staticmethod def users(): diff --git a/templates/ruby/lib/container/role.rb.twig b/templates/ruby/lib/container/role.rb.twig index c4d4f978b3..393da16393 100644 --- a/templates/ruby/lib/container/role.rb.twig +++ b/templates/ruby/lib/container/role.rb.twig @@ -17,7 +17,7 @@ module {{spec.title | caseUcfirst}} end def self.team(id, role = "") - if(role == "") + if(role.empty?) "team:#{id}" else "team:#{id}/#{role}" From 7d41b99127f4aea01fda9cbbe26a57cf0a5cb8bf Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 23:15:46 +0530 Subject: [PATCH 269/555] Apply suggestions from code review --- .../library/src/main/java/io/appwrite/Role.kt.twig | 2 +- templates/dart/lib/role.dart.twig | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig index 88acd0261b..39ee8f7393 100644 --- a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig @@ -11,7 +11,7 @@ class Role { fun guests(): String = "guests" fun team(id: String, role: String = ""): String - = if(role == "") { + = if(role.isEmpty()) { "team:$id" } else { "team:$id/$role" diff --git a/templates/dart/lib/role.dart.twig b/templates/dart/lib/role.dart.twig index dc60884c28..42af0b38e2 100644 --- a/templates/dart/lib/role.dart.twig +++ b/templates/dart/lib/role.dart.twig @@ -17,10 +17,10 @@ class Role { return 'guests'; } - static String team(String id, [String? role]) { - if(role != null) { - return 'team:$id/$role'; + static String team(String id, [String role = '']) { + if(role.isEmpty) { + return 'team:$id'; } - return 'team:$id'; + return 'team:$id/$role'; } } \ No newline at end of file From dc92a8a05aebc4e45260faa8a365dbd05343b6b4 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 23:16:09 +0530 Subject: [PATCH 270/555] Update templates/php/src/Role.php.twig Co-authored-by: Jake Barnby --- templates/php/src/Role.php.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/php/src/Role.php.twig b/templates/php/src/Role.php.twig index 9071530399..675a6cfa62 100644 --- a/templates/php/src/Role.php.twig +++ b/templates/php/src/Role.php.twig @@ -22,7 +22,7 @@ class Role } public static function team(string $id, string $role = ""): string { - if($role == "") { + if(empty($role)) { return 'team:' . $id; } return 'team:' . $id . '/' . $role; From 8053422221aa24631e77f00b5916e1889474e945 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 23:16:15 +0530 Subject: [PATCH 271/555] Update templates/python/package/role.py.twig Co-authored-by: Jake Barnby --- templates/python/package/role.py.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/python/package/role.py.twig b/templates/python/package/role.py.twig index 697a8d64e5..7ef5e6507b 100644 --- a/templates/python/package/role.py.twig +++ b/templates/python/package/role.py.twig @@ -17,7 +17,7 @@ class Role: @staticmethod def team(id, role = ""): - if(role == ""): + if role: return 'team:\(id)' return 'team:\(id)/\(role)' From 3a248bc008f92c28354dcd57dbefe184ccc293fc Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 23:16:21 +0530 Subject: [PATCH 272/555] Update templates/python/package/role.py.twig Co-authored-by: Jake Barnby --- templates/python/package/role.py.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/python/package/role.py.twig b/templates/python/package/role.py.twig index 7ef5e6507b..50111b58bd 100644 --- a/templates/python/package/role.py.twig +++ b/templates/python/package/role.py.twig @@ -18,7 +18,7 @@ class Role: @staticmethod def team(id, role = ""): if role: - return 'team:\(id)' + return f'team:{id}' return 'team:\(id)/\(role)' @staticmethod From 0a9852ff658cdb43effac5d3e89a932d61625440 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 23:16:27 +0530 Subject: [PATCH 273/555] Update templates/python/package/role.py.twig Co-authored-by: Jake Barnby --- templates/python/package/role.py.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/python/package/role.py.twig b/templates/python/package/role.py.twig index 50111b58bd..27af7942dc 100644 --- a/templates/python/package/role.py.twig +++ b/templates/python/package/role.py.twig @@ -19,7 +19,7 @@ class Role: def team(id, role = ""): if role: return f'team:{id}' - return 'team:\(id)/\(role)' + return f'team:{id}/{role}' @staticmethod def status(status): From d5db579060fdeaea80d69bb2f5d936e1edad39b1 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 23:16:33 +0530 Subject: [PATCH 274/555] Update templates/python/package/role.py.twig Co-authored-by: Jake Barnby --- templates/python/package/role.py.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/python/package/role.py.twig b/templates/python/package/role.py.twig index 27af7942dc..2d8a5d80ea 100644 --- a/templates/python/package/role.py.twig +++ b/templates/python/package/role.py.twig @@ -23,4 +23,4 @@ class Role: @staticmethod def status(status): - return 'status:\(status)' \ No newline at end of file + return f'status:{status}' \ No newline at end of file From 772e3acb53494f620a36fa9129c03735e55a7837 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 23:17:12 +0530 Subject: [PATCH 275/555] Update templates/node/lib/permissions.js.twig --- templates/node/lib/permissions.js.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/node/lib/permissions.js.twig b/templates/node/lib/permissions.js.twig index 73b15a7836..d61ecd40ee 100644 --- a/templates/node/lib/permissions.js.twig +++ b/templates/node/lib/permissions.js.twig @@ -19,7 +19,6 @@ class Permissions { static delete = (role) => { return `delete("${role}")` } - } module.exports = Permissions; From 15984736844707b3c1f3b3cadcf944f6c4d1d2c5 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 23:17:18 +0530 Subject: [PATCH 276/555] Update templates/node/lib/id.js.twig --- templates/node/lib/id.js.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/node/lib/id.js.twig b/templates/node/lib/id.js.twig index 9d0256d3dc..d168caf6bb 100644 --- a/templates/node/lib/id.js.twig +++ b/templates/node/lib/id.js.twig @@ -7,7 +7,6 @@ class ID { static custom = (id) => { return id } - } module.exports = ID; From bba7e78805ef711d6232d4112a478fe458ae00c4 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 23:17:40 +0530 Subject: [PATCH 277/555] Update templates/php/src/Permissions.php.twig --- templates/php/src/Permissions.php.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/php/src/Permissions.php.twig b/templates/php/src/Permissions.php.twig index 12d82c9834..ce809c4020 100644 --- a/templates/php/src/Permissions.php.twig +++ b/templates/php/src/Permissions.php.twig @@ -14,7 +14,7 @@ class Permissions } public static function create(string $role): string { - return 'create("' $role . '")'; + return "create('$role')"; } public static function update(string $role): string { From 3cbf9d51941cb8cb00303e8d489ce14d2a2cb72b Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 23:17:47 +0530 Subject: [PATCH 278/555] Update templates/php/src/Role.php.twig --- templates/php/src/Role.php.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/php/src/Role.php.twig b/templates/php/src/Role.php.twig index 675a6cfa62..039a8c9b72 100644 --- a/templates/php/src/Role.php.twig +++ b/templates/php/src/Role.php.twig @@ -10,7 +10,7 @@ class Role } public static function user(string $id): string { - return 'user:' . $id; + return "user:$id"; } public static function users(): string { From f3e4f29375055c4bcc34604cba4d807b1c478736 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 23:17:55 +0530 Subject: [PATCH 279/555] Update templates/web/src/role.ts.twig --- templates/web/src/role.ts.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/web/src/role.ts.twig b/templates/web/src/role.ts.twig index 55dff0c8db..8ff82fc552 100644 --- a/templates/web/src/role.ts.twig +++ b/templates/web/src/role.ts.twig @@ -16,7 +16,7 @@ export class Role { } public static team(id: string, role: string = ''): string { - if(role == '') { + if(role === '') { return 'team:\(id)' } return 'team:\(id)/\(role)' From 5df760cf06eb84c344fe1078b78447f6d1fc4a4e Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 23:18:07 +0530 Subject: [PATCH 280/555] Update templates/swift/Sources/Role.swift.twig --- templates/swift/Sources/Role.swift.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/swift/Sources/Role.swift.twig b/templates/swift/Sources/Role.swift.twig index 0a90f18ade..73ac3bf2f2 100644 --- a/templates/swift/Sources/Role.swift.twig +++ b/templates/swift/Sources/Role.swift.twig @@ -16,7 +16,7 @@ public class Role { } public static func team(_ id: String, _ role: String = "") -> String { - if(role == "") { + if(role.isEmpty) { return 'team:\(id)' } return 'team:\(id)/\(role)' From b33dc17433f16ada6f31f41bb583bcb375801d9a Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 23:18:25 +0530 Subject: [PATCH 281/555] Update templates/node/lib/role.js.twig --- templates/node/lib/role.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/lib/role.js.twig b/templates/node/lib/role.js.twig index 0606dd4925..bb35d0f8e8 100644 --- a/templates/node/lib/role.js.twig +++ b/templates/node/lib/role.js.twig @@ -12,7 +12,7 @@ class Role { return 'guests' } static team = (id, role = '') => { - if(role == '') { + if(role === '') { return 'team:' + id } return 'team:' + id + '/' + role From 375e8e3f4dca9fe0132b0563a1246bbe7e5599d2 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 18:10:32 +0000 Subject: [PATCH 282/555] feat: fix permission clases name --- src/SDK/Language/Android.php | 4 ++-- src/SDK/Language/Dart.php | 4 ++-- src/SDK/Language/Deno.php | 4 ++-- src/SDK/Language/Flutter.php | 4 ++-- src/SDK/Language/Kotlin.php | 4 ++-- src/SDK/Language/Node.php | 4 ++-- src/SDK/Language/PHP.php | 4 ++-- src/SDK/Language/Python.php | 4 ++-- src/SDK/Language/Ruby.php | 4 ++-- src/SDK/Language/Swift.php | 4 ++-- src/SDK/Language/Web.php | 4 ++-- .../io/appwrite/{Permissions.kt.twig => Permission.kt.twig} | 2 +- templates/dart/lib/package.dart.twig | 2 +- .../dart/lib/{permissions.dart.twig => permission.dart.twig} | 2 +- .../src/permissions.ts.twig => deno/src/permission.ts.twig} | 2 +- templates/flutter/lib/package.dart.twig | 2 +- .../lib/{permissions.dart.twig => permission.dart.twig} | 2 +- .../io/appwrite/{Permissions.kt.twig => Permission.kt.twig} | 2 +- .../node/lib/{permissions.js.twig => permission.js.twig} | 4 ++-- .../php/src/{Permissions.php.twig => Permission.php.twig} | 2 +- .../package/{permissions.py.twig => permission.py.twig} | 2 +- .../lib/container/{permissions.rb.twig => permission.rb.twig} | 4 ++-- .../Sources/{Permissions.swift.twig => Permission.swift.twig} | 2 +- .../src/permissions.ts.twig => web/src/permission.ts.twig} | 2 +- 24 files changed, 37 insertions(+), 37 deletions(-) rename templates/android/library/src/main/java/io/appwrite/{Permissions.kt.twig => Permission.kt.twig} (96%) rename templates/dart/lib/{permissions.dart.twig => permission.dart.twig} (95%) rename templates/{web/src/permissions.ts.twig => deno/src/permission.ts.twig} (94%) rename templates/flutter/lib/{permissions.dart.twig => permission.dart.twig} (95%) rename templates/kotlin/src/main/kotlin/io/appwrite/{Permissions.kt.twig => Permission.kt.twig} (96%) rename templates/node/lib/{permissions.js.twig => permission.js.twig} (88%) rename templates/php/src/{Permissions.php.twig => Permission.php.twig} (97%) rename templates/python/package/{permissions.py.twig => permission.py.twig} (95%) rename templates/ruby/lib/container/{permissions.rb.twig => permission.rb.twig} (90%) rename templates/swift/Sources/{Permissions.swift.twig => Permission.swift.twig} (94%) rename templates/{deno/src/permissions.ts.twig => web/src/permission.ts.twig} (94%) diff --git a/src/SDK/Language/Android.php b/src/SDK/Language/Android.php index 4527d111f5..38a48df9ab 100644 --- a/src/SDK/Language/Android.php +++ b/src/SDK/Language/Android.php @@ -108,8 +108,8 @@ public function getFiles() ], [ 'scope' => 'default', - 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/Permissions.kt', - 'template' => '/android/library/src/main/java/io/appwrite/Permissions.kt.twig', + 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/Permission.kt', + 'template' => '/android/library/src/main/java/io/appwrite/Permission.kt.twig', ], [ 'scope' => 'default', diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index 01d472b455..9040855fe7 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -343,8 +343,8 @@ public function getFiles() ], [ 'scope' => 'default', - 'destination' => '/lib/permissions.dart', - 'template' => 'dart/lib/permissions.dart.twig', + 'destination' => '/lib/permission.dart', + 'template' => 'dart/lib/permission.dart.twig', 'minify' => false, ], [ diff --git a/src/SDK/Language/Deno.php b/src/SDK/Language/Deno.php index 4133313301..3bc8d26a9b 100644 --- a/src/SDK/Language/Deno.php +++ b/src/SDK/Language/Deno.php @@ -32,8 +32,8 @@ public function getFiles() ], [ 'scope' => 'default', - 'destination' => 'src/permissions.ts', - 'template' => 'deno/src/permissions.ts.twig', + 'destination' => 'src/permission.ts', + 'template' => 'deno/src/permission.ts.twig', 'minify' => false, ], [ diff --git a/src/SDK/Language/Flutter.php b/src/SDK/Language/Flutter.php index 9226dbe06c..3a3261defb 100644 --- a/src/SDK/Language/Flutter.php +++ b/src/SDK/Language/Flutter.php @@ -243,8 +243,8 @@ public function getFiles() ], [ 'scope' => 'default', - 'destination' => '/lib/permissions.dart', - 'template' => 'flutter/lib/permissions.dart.twig', + 'destination' => '/lib/permission.dart', + 'template' => 'flutter/lib/permission.dart.twig', 'minify' => false, ], [ diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index a119af180a..9aa02dc7e7 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -359,8 +359,8 @@ public function getFiles() ], [ 'scope' => 'default', - 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/Permissions.kt', - 'template' => '/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig', + 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/Permission.kt', + 'template' => '/kotlin/src/main/kotlin/io/appwrite/Permission.kt.twig', 'minify' => false, ], [ diff --git a/src/SDK/Language/Node.php b/src/SDK/Language/Node.php index c50b378221..cc7af4a6e5 100644 --- a/src/SDK/Language/Node.php +++ b/src/SDK/Language/Node.php @@ -61,8 +61,8 @@ public function getFiles() ], [ 'scope' => 'default', - 'destination' => 'lib/permissions.js', - 'template' => 'node/lib/permissions.js.twig', + 'destination' => 'lib/permission.js', + 'template' => 'node/lib/permission.js.twig', 'minify' => false, ], [ diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index 95f85f7de6..fed234bc37 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -180,8 +180,8 @@ public function getFiles() ], [ 'scope' => 'default', - 'destination' => 'src/{{ spec.title | caseUcfirst}}/Permissions.php', - 'template' => 'php/src/Permissions.php.twig', + 'destination' => 'src/{{ spec.title | caseUcfirst}}/Permission.php', + 'template' => 'php/src/Permission.php.twig', 'minify' => false, ], [ diff --git a/src/SDK/Language/Python.php b/src/SDK/Language/Python.php index e828f7aa9a..2d67a6ae0f 100644 --- a/src/SDK/Language/Python.php +++ b/src/SDK/Language/Python.php @@ -157,8 +157,8 @@ public function getFiles() ], [ 'scope' => 'default', - 'destination' => '{{ spec.title | caseSnake}}/permissions.py', - 'template' => 'python/package/permissions.py.twig', + 'destination' => '{{ spec.title | caseSnake}}/permission.py', + 'template' => 'python/package/permission.py.twig', 'minify' => false, ], [ diff --git a/src/SDK/Language/Ruby.php b/src/SDK/Language/Ruby.php index 1c52aec75d..eaba242f7e 100644 --- a/src/SDK/Language/Ruby.php +++ b/src/SDK/Language/Ruby.php @@ -135,8 +135,8 @@ public function getFiles() ], [ 'scope' => 'default', - 'destination' => 'lib/{{ spec.title | caseDash }}/permissions.rb', - 'template' => 'ruby/lib/container/permissions.rb.twig', + 'destination' => 'lib/{{ spec.title | caseDash }}/permission.rb', + 'template' => 'ruby/lib/container/permission.rb.twig', 'minify' => false, ], [ diff --git a/src/SDK/Language/Swift.php b/src/SDK/Language/Swift.php index 5f5539e9a5..b2da289a0e 100644 --- a/src/SDK/Language/Swift.php +++ b/src/SDK/Language/Swift.php @@ -160,8 +160,8 @@ public function getFiles() ], [ 'scope' => 'default', - 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Permissions.swift', - 'template' => 'swift/Sources/Permissions.swift.twig', + 'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Permission.swift', + 'template' => 'swift/Sources/Permission.swift.twig', 'minify' => false, ], [ diff --git a/src/SDK/Language/Web.php b/src/SDK/Language/Web.php index 9bcd5a6416..985eac46bd 100644 --- a/src/SDK/Language/Web.php +++ b/src/SDK/Language/Web.php @@ -54,8 +54,8 @@ public function getFiles() ], [ 'scope' => 'default', - 'destination' => 'src/permissions.ts', - 'template' => 'web/src/permissions.ts.twig', + 'destination' => 'src/permission.ts', + 'template' => 'web/src/permission.ts.twig', 'minify' => false, ], [ diff --git a/templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig b/templates/android/library/src/main/java/io/appwrite/Permission.kt.twig similarity index 96% rename from templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig rename to templates/android/library/src/main/java/io/appwrite/Permission.kt.twig index 7f47feaf67..33e5b741c9 100644 --- a/templates/android/library/src/main/java/io/appwrite/Permissions.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Permission.kt.twig @@ -1,6 +1,6 @@ package {{ sdk.namespace | caseDot }} -class Permissions { +class Permission { companion object { fun read(role: String): String { return "read(\"${role}\")" diff --git a/templates/dart/lib/package.dart.twig b/templates/dart/lib/package.dart.twig index b5b2e3a7fa..333d733783 100644 --- a/templates/dart/lib/package.dart.twig +++ b/templates/dart/lib/package.dart.twig @@ -17,7 +17,7 @@ export 'src/upload_progress.dart'; part 'query.dart'; part 'query.dart'; -part 'permissions.dart'; +part 'permission.dart'; part 'role.dart'; part 'id.dart'; {% for service in spec.services %} diff --git a/templates/dart/lib/permissions.dart.twig b/templates/dart/lib/permission.dart.twig similarity index 95% rename from templates/dart/lib/permissions.dart.twig rename to templates/dart/lib/permission.dart.twig index 1b68d3890b..675d8184b3 100644 --- a/templates/dart/lib/permissions.dart.twig +++ b/templates/dart/lib/permission.dart.twig @@ -1,6 +1,6 @@ part of {{ language.params.packageName }}; -class Permissions { +class Permission { static String read(String role) { return 'read("$role")'; } diff --git a/templates/web/src/permissions.ts.twig b/templates/deno/src/permission.ts.twig similarity index 94% rename from templates/web/src/permissions.ts.twig rename to templates/deno/src/permission.ts.twig index ae396e7f90..a326bdc3fa 100644 --- a/templates/web/src/permissions.ts.twig +++ b/templates/deno/src/permission.ts.twig @@ -1,4 +1,4 @@ -export class Permissions { +export class Permission { static read = (role: string[]): string => { return `read("${role}")` diff --git a/templates/flutter/lib/package.dart.twig b/templates/flutter/lib/package.dart.twig index b090280d81..406b3ee1bb 100644 --- a/templates/flutter/lib/package.dart.twig +++ b/templates/flutter/lib/package.dart.twig @@ -19,7 +19,7 @@ export 'src/realtime_message.dart'; export 'src/input_file.dart'; part 'query.dart'; -part 'permissions.dart'; +part 'permission.dart'; part 'role.dart'; part 'id.dart'; {% for service in spec.services %} diff --git a/templates/flutter/lib/permissions.dart.twig b/templates/flutter/lib/permission.dart.twig similarity index 95% rename from templates/flutter/lib/permissions.dart.twig rename to templates/flutter/lib/permission.dart.twig index 1b68d3890b..675d8184b3 100644 --- a/templates/flutter/lib/permissions.dart.twig +++ b/templates/flutter/lib/permission.dart.twig @@ -1,6 +1,6 @@ part of {{ language.params.packageName }}; -class Permissions { +class Permission { static String read(String role) { return 'read("$role")'; } diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Permission.kt.twig similarity index 96% rename from templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig rename to templates/kotlin/src/main/kotlin/io/appwrite/Permission.kt.twig index 7f47feaf67..33e5b741c9 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Permissions.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Permission.kt.twig @@ -1,6 +1,6 @@ package {{ sdk.namespace | caseDot }} -class Permissions { +class Permission { companion object { fun read(role: String): String { return "read(\"${role}\")" diff --git a/templates/node/lib/permissions.js.twig b/templates/node/lib/permission.js.twig similarity index 88% rename from templates/node/lib/permissions.js.twig rename to templates/node/lib/permission.js.twig index d61ecd40ee..67a7003508 100644 --- a/templates/node/lib/permissions.js.twig +++ b/templates/node/lib/permission.js.twig @@ -1,4 +1,4 @@ -class Permissions { +class Permission { static read = (role) => { return `read("${role}")` @@ -21,4 +21,4 @@ class Permissions { } } -module.exports = Permissions; +module.exports = Permission; diff --git a/templates/php/src/Permissions.php.twig b/templates/php/src/Permission.php.twig similarity index 97% rename from templates/php/src/Permissions.php.twig rename to templates/php/src/Permission.php.twig index ce809c4020..7ad2d4f369 100644 --- a/templates/php/src/Permissions.php.twig +++ b/templates/php/src/Permission.php.twig @@ -2,7 +2,7 @@ namespace {{ spec.title | caseUcfirst }}; -class Permissions +class Permission { public static function read(string $role): string { diff --git a/templates/python/package/permissions.py.twig b/templates/python/package/permission.py.twig similarity index 95% rename from templates/python/package/permissions.py.twig rename to templates/python/package/permission.py.twig index 5ff72fff2a..7178b8c429 100644 --- a/templates/python/package/permissions.py.twig +++ b/templates/python/package/permission.py.twig @@ -1,4 +1,4 @@ -class Permissions: +class Permission: @staticmethod def read(role): diff --git a/templates/ruby/lib/container/permissions.rb.twig b/templates/ruby/lib/container/permission.rb.twig similarity index 90% rename from templates/ruby/lib/container/permissions.rb.twig rename to templates/ruby/lib/container/permission.rb.twig index a5212abd5f..01cb4ca4a7 100644 --- a/templates/ruby/lib/container/permissions.rb.twig +++ b/templates/ruby/lib/container/permission.rb.twig @@ -1,6 +1,6 @@ module {{spec.title | caseUcfirst}} - class Permissions - class << Permissions + class Permission + class << Permission def read(role) return "read(\"#{role}\")" end diff --git a/templates/swift/Sources/Permissions.swift.twig b/templates/swift/Sources/Permission.swift.twig similarity index 94% rename from templates/swift/Sources/Permissions.swift.twig rename to templates/swift/Sources/Permission.swift.twig index 87b0b2eda5..4e053dba83 100644 --- a/templates/swift/Sources/Permissions.swift.twig +++ b/templates/swift/Sources/Permission.swift.twig @@ -1,4 +1,4 @@ -public class Permissions { +public class Permission { public static func read(_ role: String) -> String { return "read(\"\(role)\")" } diff --git a/templates/deno/src/permissions.ts.twig b/templates/web/src/permission.ts.twig similarity index 94% rename from templates/deno/src/permissions.ts.twig rename to templates/web/src/permission.ts.twig index ae396e7f90..a326bdc3fa 100644 --- a/templates/deno/src/permissions.ts.twig +++ b/templates/web/src/permission.ts.twig @@ -1,4 +1,4 @@ -export class Permissions { +export class Permission { static read = (role: string[]): string => { return `read("${role}")` From 19334775a69f08351475877ba2e0b390c8c35a56 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 18:25:48 +0000 Subject: [PATCH 283/555] feat: address string concatenation in php classes --- templates/php/src/Permission.php.twig | 8 ++++---- templates/php/src/Role.php.twig | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/php/src/Permission.php.twig b/templates/php/src/Permission.php.twig index 7ad2d4f369..bfdc4d50ba 100644 --- a/templates/php/src/Permission.php.twig +++ b/templates/php/src/Permission.php.twig @@ -6,11 +6,11 @@ class Permission { public static function read(string $role): string { - return 'read("' $role . '")'; + return "read('$role')"; } public static function write(string $role): string { - return 'write("' $role . '")'; + return "write('$role')"; } public static function create(string $role): string { @@ -18,10 +18,10 @@ class Permission } public static function update(string $role): string { - return 'update("' $role . '")'; + return "update('$role')"; } public static function delete(string $role): string { - return 'delete("' $role . '")'; + return "delete('$role')"; } } diff --git a/templates/php/src/Role.php.twig b/templates/php/src/Role.php.twig index 039a8c9b72..e950712135 100644 --- a/templates/php/src/Role.php.twig +++ b/templates/php/src/Role.php.twig @@ -23,12 +23,12 @@ class Role public static function team(string $id, string $role = ""): string { if(empty($role)) { - return 'team:' . $id; + return "team:$id"; } - return 'team:' . $id . '/' . $role; + return "team:$id/$role"; } public static function status(string $status): string { - return 'status:' . $status; + return "status:$status"; } } \ No newline at end of file From f78863f5ed1c14d33f67f54122c5cffef93e9122 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 18:27:13 +0000 Subject: [PATCH 284/555] feat: change function params to string --- templates/deno/src/permission.ts.twig | 10 +++++----- templates/web/src/permission.ts.twig | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/templates/deno/src/permission.ts.twig b/templates/deno/src/permission.ts.twig index a326bdc3fa..bfc330a166 100644 --- a/templates/deno/src/permission.ts.twig +++ b/templates/deno/src/permission.ts.twig @@ -1,22 +1,22 @@ export class Permission { - static read = (role: string[]): string => { + static read = (role: string): string => { return `read("${role}")` } - static write = (role: string[]): string => { + static write = (role: string): string => { return `write("${role}")` } - static create = (role: string[]): string => { + static create = (role: string): string => { return `create("${role}")` } - static update = (role: string[]): string => { + static update = (role: string): string => { return `update("${role}")` } - static delete = (role: string[]): string => { + static delete = (role: string): string => { return `delete("${role}")` } } diff --git a/templates/web/src/permission.ts.twig b/templates/web/src/permission.ts.twig index a326bdc3fa..bfc330a166 100644 --- a/templates/web/src/permission.ts.twig +++ b/templates/web/src/permission.ts.twig @@ -1,22 +1,22 @@ export class Permission { - static read = (role: string[]): string => { + static read = (role: string): string => { return `read("${role}")` } - static write = (role: string[]): string => { + static write = (role: string): string => { return `write("${role}")` } - static create = (role: string[]): string => { + static create = (role: string): string => { return `create("${role}")` } - static update = (role: string[]): string => { + static update = (role: string): string => { return `update("${role}")` } - static delete = (role: string[]): string => { + static delete = (role: string): string => { return `delete("${role}")` } } From 0e32c904bf796a5fb9521bcb1c1e3a7bcbfbb816 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 18:43:03 +0000 Subject: [PATCH 285/555] feat: update dart function signatures --- templates/dart/lib/role.dart.twig | 2 +- templates/flutter/lib/role.dart.twig | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/dart/lib/role.dart.twig b/templates/dart/lib/role.dart.twig index 42af0b38e2..604a482c9a 100644 --- a/templates/dart/lib/role.dart.twig +++ b/templates/dart/lib/role.dart.twig @@ -19,7 +19,7 @@ class Role { static String team(String id, [String role = '']) { if(role.isEmpty) { - return 'team:$id'; + return 'team:$id'; } return 'team:$id/$role'; } diff --git a/templates/flutter/lib/role.dart.twig b/templates/flutter/lib/role.dart.twig index dc60884c28..604a482c9a 100644 --- a/templates/flutter/lib/role.dart.twig +++ b/templates/flutter/lib/role.dart.twig @@ -17,10 +17,10 @@ class Role { return 'guests'; } - static String team(String id, [String? role]) { - if(role != null) { - return 'team:$id/$role'; + static String team(String id, [String role = '']) { + if(role.isEmpty) { + return 'team:$id'; } - return 'team:$id'; + return 'team:$id/$role'; } } \ No newline at end of file From 8a194331cbd35aad8bc98d00833462aaf0bb37bd Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 18:49:43 +0000 Subject: [PATCH 286/555] feat: update ts functions --- templates/deno/src/role.ts.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/deno/src/role.ts.twig b/templates/deno/src/role.ts.twig index 55dff0c8db..8ff82fc552 100644 --- a/templates/deno/src/role.ts.twig +++ b/templates/deno/src/role.ts.twig @@ -16,7 +16,7 @@ export class Role { } public static team(id: string, role: string = ''): string { - if(role == '') { + if(role === '') { return 'team:\(id)' } return 'team:\(id)/\(role)' From 2caf635f10a32e824b19527baeb6f5a1d8851852 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 18:51:05 +0000 Subject: [PATCH 287/555] feat: update kotlin function --- templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig index 88acd0261b..39ee8f7393 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig @@ -11,7 +11,7 @@ class Role { fun guests(): String = "guests" fun team(id: String, role: String = ""): String - = if(role == "") { + = if(role.isEmpty()) { "team:$id" } else { "team:$id/$role" From 6e6607b95e200cd140e2a4fce73560cdd182e973 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 19:22:12 +0000 Subject: [PATCH 288/555] feat: remove redundant query declaration --- templates/dart/lib/package.dart.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/dart/lib/package.dart.twig b/templates/dart/lib/package.dart.twig index 333d733783..ea7931d7dc 100644 --- a/templates/dart/lib/package.dart.twig +++ b/templates/dart/lib/package.dart.twig @@ -15,7 +15,6 @@ export 'src/exception.dart'; export 'src/input_file.dart'; export 'src/upload_progress.dart'; -part 'query.dart'; part 'query.dart'; part 'permission.dart'; part 'role.dart'; From e13f12a1ff4d48f7fd46e5dd5177d4afcbd5042c Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 19:51:35 +0000 Subject: [PATCH 289/555] feat: update tests --- composer.lock | 12 ++++++------ tests/Android11Java11Test.php | 3 +++ tests/Android11Java8Test.php | 3 +++ tests/Android12Java11Test.php | 3 +++ tests/Android12Java8Test.php | 3 +++ tests/Android5Java11Test.php | 3 +++ tests/Android5Java8Test.php | 3 +++ tests/Base.php | 6 +++++- tests/DartBetaTest.php | 1 + tests/DartStableTest.php | 1 + tests/Deno1171Test.php | 3 +++ tests/FlutterBetaTest.php | 1 + tests/FlutterStableTest.php | 1 + tests/KotlinJava11Test.php | 5 ++++- tests/KotlinJava17Test.php | 5 ++++- tests/KotlinJava8Test.php | 5 ++++- tests/Node12Test.php | 3 +++ tests/Node14Test.php | 3 +++ tests/Node16Test.php | 3 +++ tests/PHP74Test.php | 3 +++ tests/PHP80Test.php | 3 +++ tests/Python310Test.php | 3 +++ tests/Python38Test.php | 3 +++ tests/Python39Test.php | 3 +++ tests/Ruby27Test.php | 5 ++++- tests/Ruby30Test.php | 5 ++++- tests/Ruby31Test.php | 5 ++++- tests/SwiftClient55Test.php | 3 +++ tests/SwiftServer55Test.php | 3 +++ tests/WebChromiumTest.php | 3 +++ tests/WebNodeTest.php | 3 +++ tests/languages/dart/tests.dart | 1 + tests/languages/flutter/tests.dart | 1 + 33 files changed, 98 insertions(+), 13 deletions(-) diff --git a/composer.lock b/composer.lock index 89ffddcc93..4c12e880b5 100644 --- a/composer.lock +++ b/composer.lock @@ -296,16 +296,16 @@ }, { "name": "twig/twig", - "version": "v3.4.1", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342" + "reference": "e07cdd3d430cd7e453c31b36eb5ad6c0c5e43077" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/e939eae92386b69b49cfa4599dd9bead6bf4a342", - "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/e07cdd3d430cd7e453c31b36eb5ad6c0c5e43077", + "reference": "e07cdd3d430cd7e453c31b36eb5ad6c0c5e43077", "shasum": "" }, "require": { @@ -356,7 +356,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.4.1" + "source": "https://github.com/twigphp/Twig/tree/v3.4.2" }, "funding": [ { @@ -368,7 +368,7 @@ "type": "tidelift" } ], - "time": "2022-05-17T05:48:52+00:00" + "time": "2022-08-12T06:47:24+00:00" } ], "packages-dev": [ diff --git a/tests/Android11Java11Test.php b/tests/Android11Java11Test.php index 6f67eacda5..9cd3c7a482 100644 --- a/tests/Android11Java11Test.php +++ b/tests/Android11Java11Test.php @@ -24,5 +24,8 @@ class Android11Java11Test extends Base ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android11Java8Test.php b/tests/Android11Java8Test.php index 2c493c03e6..5e65383746 100644 --- a/tests/Android11Java8Test.php +++ b/tests/Android11Java8Test.php @@ -24,5 +24,8 @@ class Android11Java8Test extends Base ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android12Java11Test.php b/tests/Android12Java11Test.php index 5f0cb4aa0f..1c11329275 100644 --- a/tests/Android12Java11Test.php +++ b/tests/Android12Java11Test.php @@ -24,5 +24,8 @@ class Android12Java11Test extends Base ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android12Java8Test.php b/tests/Android12Java8Test.php index e9422ee2a4..8e5234fc93 100644 --- a/tests/Android12Java8Test.php +++ b/tests/Android12Java8Test.php @@ -24,5 +24,8 @@ class Android12Java8Test extends Base ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android5Java11Test.php b/tests/Android5Java11Test.php index 95d565a9cc..b22d674c30 100644 --- a/tests/Android5Java11Test.php +++ b/tests/Android5Java11Test.php @@ -24,5 +24,8 @@ class Android5Java11Test extends Base ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android5Java8Test.php b/tests/Android5Java8Test.php index f49c1ba1db..46313b3334 100644 --- a/tests/Android5Java8Test.php +++ b/tests/Android5Java8Test.php @@ -24,5 +24,8 @@ class Android5Java8Test extends Base ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Base.php b/tests/Base.php index 91a4ee09e9..59dbbe9329 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -72,8 +72,12 @@ abstract class Base extends TestCase 'create("users")', 'update("guests")', 'delete("team:teamId/owner")', - 'delete("team:teamId")', + 'delete("team:teamId")' + ]; + + const ID_HELPER_RESPONSES = [ 'unique()', + 'custom_id' ]; protected string $class = ''; diff --git a/tests/DartBetaTest.php b/tests/DartBetaTest.php index 22bc81dbf0..97be44f0db 100644 --- a/tests/DartBetaTest.php +++ b/tests/DartBetaTest.php @@ -21,5 +21,6 @@ class DartBetaTest extends Base ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/DartStableTest.php b/tests/DartStableTest.php index 465b14180d..ece7784821 100644 --- a/tests/DartStableTest.php +++ b/tests/DartStableTest.php @@ -21,5 +21,6 @@ class DartStableTest extends Base ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Deno1171Test.php b/tests/Deno1171Test.php index e237b5f430..4d7188e9e0 100644 --- a/tests/Deno1171Test.php +++ b/tests/Deno1171Test.php @@ -16,5 +16,8 @@ class Deno1171Test extends Base ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/FlutterBetaTest.php b/tests/FlutterBetaTest.php index dbd6b57ed4..39717226ed 100644 --- a/tests/FlutterBetaTest.php +++ b/tests/FlutterBetaTest.php @@ -23,5 +23,6 @@ class FlutterBetaTest extends Base ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/FlutterStableTest.php b/tests/FlutterStableTest.php index 11992ac74c..3dc03e5df8 100644 --- a/tests/FlutterStableTest.php +++ b/tests/FlutterStableTest.php @@ -23,5 +23,6 @@ class FlutterStableTest extends Base ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/KotlinJava11Test.php b/tests/KotlinJava11Test.php index c2c733c1ae..2ee223b735 100644 --- a/tests/KotlinJava11Test.php +++ b/tests/KotlinJava11Test.php @@ -21,6 +21,9 @@ class KotlinJava11Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, - ...Base::EXCEPTION_RESPONSES + ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/KotlinJava17Test.php b/tests/KotlinJava17Test.php index ac86db5b8b..19744d5aae 100644 --- a/tests/KotlinJava17Test.php +++ b/tests/KotlinJava17Test.php @@ -21,6 +21,9 @@ class KotlinJava17Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, - ...Base::EXCEPTION_RESPONSES + ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/KotlinJava8Test.php b/tests/KotlinJava8Test.php index 605564297c..ed32159182 100644 --- a/tests/KotlinJava8Test.php +++ b/tests/KotlinJava8Test.php @@ -21,6 +21,9 @@ class KotlinJava8Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, - ...Base::EXCEPTION_RESPONSES + ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Node12Test.php b/tests/Node12Test.php index d7d72158bb..5d6fc280a4 100644 --- a/tests/Node12Test.php +++ b/tests/Node12Test.php @@ -18,5 +18,8 @@ class Node12Test extends Base ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Node14Test.php b/tests/Node14Test.php index 80b6ce7eb6..9284f3206f 100644 --- a/tests/Node14Test.php +++ b/tests/Node14Test.php @@ -18,5 +18,8 @@ class Node14Test extends Base ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Node16Test.php b/tests/Node16Test.php index 7edda1f12c..9ce9d77ea7 100644 --- a/tests/Node16Test.php +++ b/tests/Node16Test.php @@ -18,5 +18,8 @@ class Node16Test extends Base ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/PHP74Test.php b/tests/PHP74Test.php index 22f3ef6645..a19ee4dd78 100644 --- a/tests/PHP74Test.php +++ b/tests/PHP74Test.php @@ -18,5 +18,8 @@ class PHP74Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/PHP80Test.php b/tests/PHP80Test.php index d44a29af7d..9a45c4d526 100644 --- a/tests/PHP80Test.php +++ b/tests/PHP80Test.php @@ -18,5 +18,8 @@ class PHP80Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Python310Test.php b/tests/Python310Test.php index 7f8b587b62..84191eb5df 100644 --- a/tests/Python310Test.php +++ b/tests/Python310Test.php @@ -22,5 +22,8 @@ class Python310Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Python38Test.php b/tests/Python38Test.php index 4ea1004c7d..1bc47b22be 100644 --- a/tests/Python38Test.php +++ b/tests/Python38Test.php @@ -22,5 +22,8 @@ class Python38Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Python39Test.php b/tests/Python39Test.php index 5011dfdb4f..ece79ac492 100644 --- a/tests/Python39Test.php +++ b/tests/Python39Test.php @@ -22,5 +22,8 @@ class Python39Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Ruby27Test.php b/tests/Ruby27Test.php index 86898a1cc1..9b3f488756 100644 --- a/tests/Ruby27Test.php +++ b/tests/Ruby27Test.php @@ -19,6 +19,9 @@ class Ruby27Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, - ...Base::EXCEPTION_RESPONSES + ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Ruby30Test.php b/tests/Ruby30Test.php index c954b102a7..a32faf4f97 100644 --- a/tests/Ruby30Test.php +++ b/tests/Ruby30Test.php @@ -19,6 +19,9 @@ class Ruby30Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, - ...Base::EXCEPTION_RESPONSES + ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Ruby31Test.php b/tests/Ruby31Test.php index 0b3223b168..6c7b1b6d54 100644 --- a/tests/Ruby31Test.php +++ b/tests/Ruby31Test.php @@ -19,6 +19,9 @@ class Ruby31Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, - ...Base::EXCEPTION_RESPONSES + ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/SwiftClient55Test.php b/tests/SwiftClient55Test.php index d2557ea9e7..16852b1873 100644 --- a/tests/SwiftClient55Test.php +++ b/tests/SwiftClient55Test.php @@ -23,5 +23,8 @@ class SwiftClient55Test extends Base ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/SwiftServer55Test.php b/tests/SwiftServer55Test.php index d2c6ee952c..e1593dbcea 100644 --- a/tests/SwiftServer55Test.php +++ b/tests/SwiftServer55Test.php @@ -21,5 +21,8 @@ class SwiftServer55Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/WebChromiumTest.php b/tests/WebChromiumTest.php index 0c70197c35..c85c4879f9 100644 --- a/tests/WebChromiumTest.php +++ b/tests/WebChromiumTest.php @@ -23,5 +23,8 @@ class WebChromiumTest extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/WebNodeTest.php b/tests/WebNodeTest.php index ac3dad3656..659d7d4dde 100644 --- a/tests/WebNodeTest.php +++ b/tests/WebNodeTest.php @@ -23,5 +23,8 @@ class WebNodeTest extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, + ...Base::QUERY_HELPER_RESPONSES, + ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 51c2728a70..83a9fb79cf 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -103,5 +103,6 @@ void main() async { print(Permissions.delete(Role.team('teamId', 'owner'))); print(Permissions.delete(Role.team('teamId'))); print(ID.unique()); + print(ID.custom('custom_id')); } diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index 839489a2dc..d8737d613f 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -123,4 +123,5 @@ void main() async { print(Permissions.delete(Role.team('teamId', 'owner'))); print(Permissions.delete(Role.team('teamId'))); print(ID.unique()); + print(ID.custom('custom_id')); } From 0abcf10517f453f18aca5d7efd6fc4403cd09d84 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 20:00:57 +0000 Subject: [PATCH 290/555] feat: update tests --- tests/languages/android/Tests.kt | 11 +++++++++++ tests/languages/dart/tests.dart | 4 +++- tests/languages/flutter/tests.dart | 16 +++++++++------- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/tests/languages/android/Tests.kt b/tests/languages/android/Tests.kt index 3993e5eda7..ab2c19893c 100644 --- a/tests/languages/android/Tests.kt +++ b/tests/languages/android/Tests.kt @@ -4,6 +4,10 @@ import androidx.test.core.app.ApplicationProvider import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.gson.Gson import io.appwrite.exceptions.AppwriteException +import io.appwrite.Permission +import io.appwrite.Role +import io.appwrite.ID +import io.appwrite.Query import io.appwrite.extensions.fromJson import io.appwrite.extensions.toJson import io.appwrite.models.Error @@ -155,6 +159,13 @@ class ServiceTest { writeToFile(mock.result) general.empty() + + // Query helper tests + writeToFile(Query.equal("title", ['Spiderman', 'Dr. Strange'])); + writeToFile(Query.notEqual("title', 'Spiderman')); + writeToFile(Query.lesser("releasedYear', 1990)); + writeToFile(Query.greater("releasedYear", [1990, 1999])); + writeToFile(Query.search("name", "john")); } } diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 83a9fb79cf..b929506b6b 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -95,13 +95,15 @@ void main() async { print(Query.greater('releasedYear', [1990, 1999])); print(Query.search('name', "john")); - // Permissions, Role and ID helper tests + // Permission & Role helper tests print(Permissions.read(Role.any())); print(Permissions.write(Role.user(ID.custom('userid')))); print(Permissions.create(Role.users())); print(Permissions.update(Role.guests())); print(Permissions.delete(Role.team('teamId', 'owner'))); print(Permissions.delete(Role.team('teamId'))); + + // ID helper tests print(ID.unique()); print(ID.custom('custom_id')); diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index d8737d613f..ba1d5ec63f 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -115,13 +115,15 @@ void main() async { print(Query.greater('releasedYear', [1990, 1999])); print(Query.search('name', "john")); - // Permissions, Role and ID helper tests - print(Permissions.read(Role.any())); - print(Permissions.write(Role.user(ID.custom('userid')))); - print(Permissions.create(Role.users())); - print(Permissions.update(Role.guests())); - print(Permissions.delete(Role.team('teamId', 'owner'))); - print(Permissions.delete(Role.team('teamId'))); + // Permission & Role helper tests + print(Permission.read(Role.any())); + print(Permission.write(Role.user(ID.custom('userid')))); + print(Permission.create(Role.users())); + print(Permission.update(Role.guests())); + print(Permission.delete(Role.team('teamId', 'owner'))); + print(Permission.delete(Role.team('teamId'))); + + // ID helper tests print(ID.unique()); print(ID.custom('custom_id')); } From 4ae137e808742acf3cd84a3987e14bcf8840ef99 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 20:26:09 +0000 Subject: [PATCH 291/555] feat: android tests --- templates/dart/lib/package.dart.twig | 2 +- tests/Android11Java11Test.php | 2 +- tests/Android11Java8Test.php | 2 +- tests/Android12Java11Test.php | 2 +- tests/Android12Java8Test.php | 2 +- tests/Android5Java11Test.php | 2 +- tests/Android5Java8Test.php | 2 +- tests/Base.php | 2 +- tests/DartBetaTest.php | 2 +- tests/DartStableTest.php | 2 +- tests/Deno1171Test.php | 2 +- tests/FlutterBetaTest.php | 2 +- tests/FlutterStableTest.php | 2 +- tests/KotlinJava11Test.php | 2 +- tests/KotlinJava17Test.php | 2 +- tests/KotlinJava8Test.php | 2 +- tests/Node12Test.php | 2 +- tests/Node14Test.php | 2 +- tests/Node16Test.php | 2 +- tests/PHP74Test.php | 2 +- tests/PHP80Test.php | 2 +- tests/Python310Test.php | 2 +- tests/Python38Test.php | 2 +- tests/Python39Test.php | 2 +- tests/Ruby27Test.php | 2 +- tests/Ruby30Test.php | 2 +- tests/Ruby31Test.php | 2 +- tests/SwiftClient55Test.php | 2 +- tests/SwiftServer55Test.php | 2 +- tests/WebChromiumTest.php | 2 +- tests/WebNodeTest.php | 2 +- tests/languages/android/Tests.kt | 20 ++++++++++++++++---- tests/languages/dart/tests.dart | 12 ++++++------ 33 files changed, 53 insertions(+), 41 deletions(-) diff --git a/templates/dart/lib/package.dart.twig b/templates/dart/lib/package.dart.twig index 6841b4a4b3..ea7931d7dc 100644 --- a/templates/dart/lib/package.dart.twig +++ b/templates/dart/lib/package.dart.twig @@ -16,7 +16,7 @@ export 'src/input_file.dart'; export 'src/upload_progress.dart'; part 'query.dart'; -part 'permissions.dart'; +part 'permission.dart'; part 'role.dart'; part 'id.dart'; {% for service in spec.services %} diff --git a/tests/Android11Java11Test.php b/tests/Android11Java11Test.php index 9cd3c7a482..b241d250fe 100644 --- a/tests/Android11Java11Test.php +++ b/tests/Android11Java11Test.php @@ -25,7 +25,7 @@ class Android11Java11Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android11Java8Test.php b/tests/Android11Java8Test.php index 5e65383746..2333da7ed5 100644 --- a/tests/Android11Java8Test.php +++ b/tests/Android11Java8Test.php @@ -25,7 +25,7 @@ class Android11Java8Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android12Java11Test.php b/tests/Android12Java11Test.php index 1c11329275..3c07c0c8b3 100644 --- a/tests/Android12Java11Test.php +++ b/tests/Android12Java11Test.php @@ -25,7 +25,7 @@ class Android12Java11Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android12Java8Test.php b/tests/Android12Java8Test.php index 8e5234fc93..5e88d1283a 100644 --- a/tests/Android12Java8Test.php +++ b/tests/Android12Java8Test.php @@ -25,7 +25,7 @@ class Android12Java8Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android5Java11Test.php b/tests/Android5Java11Test.php index b22d674c30..30c0cf99dd 100644 --- a/tests/Android5Java11Test.php +++ b/tests/Android5Java11Test.php @@ -25,7 +25,7 @@ class Android5Java11Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android5Java8Test.php b/tests/Android5Java8Test.php index 46313b3334..7e20670f90 100644 --- a/tests/Android5Java8Test.php +++ b/tests/Android5Java8Test.php @@ -25,7 +25,7 @@ class Android5Java8Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Base.php b/tests/Base.php index 59dbbe9329..82cd62177d 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -66,7 +66,7 @@ abstract class Base extends TestCase 'name.search("john")', ]; - const PERMISSIONS_HELPER_RESPONSES = [ + const PERMISSION_HELPER_RESPONSES = [ 'read("any")', 'write("user:userid")', 'create("users")', diff --git a/tests/DartBetaTest.php b/tests/DartBetaTest.php index 97be44f0db..e73a09fcbc 100644 --- a/tests/DartBetaTest.php +++ b/tests/DartBetaTest.php @@ -20,7 +20,7 @@ class DartBetaTest extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/DartStableTest.php b/tests/DartStableTest.php index ece7784821..66e3e5e26e 100644 --- a/tests/DartStableTest.php +++ b/tests/DartStableTest.php @@ -20,7 +20,7 @@ class DartStableTest extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Deno1171Test.php b/tests/Deno1171Test.php index 4d7188e9e0..1a64cbdbd8 100644 --- a/tests/Deno1171Test.php +++ b/tests/Deno1171Test.php @@ -17,7 +17,7 @@ class Deno1171Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/FlutterBetaTest.php b/tests/FlutterBetaTest.php index 39717226ed..1bd91869f4 100644 --- a/tests/FlutterBetaTest.php +++ b/tests/FlutterBetaTest.php @@ -22,7 +22,7 @@ class FlutterBetaTest extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/FlutterStableTest.php b/tests/FlutterStableTest.php index 3dc03e5df8..910c26ecf4 100644 --- a/tests/FlutterStableTest.php +++ b/tests/FlutterStableTest.php @@ -22,7 +22,7 @@ class FlutterStableTest extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/KotlinJava11Test.php b/tests/KotlinJava11Test.php index 2ee223b735..f2be031ff2 100644 --- a/tests/KotlinJava11Test.php +++ b/tests/KotlinJava11Test.php @@ -23,7 +23,7 @@ class KotlinJava11Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/KotlinJava17Test.php b/tests/KotlinJava17Test.php index 19744d5aae..50438b5d87 100644 --- a/tests/KotlinJava17Test.php +++ b/tests/KotlinJava17Test.php @@ -23,7 +23,7 @@ class KotlinJava17Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/KotlinJava8Test.php b/tests/KotlinJava8Test.php index ed32159182..bc8fbb675d 100644 --- a/tests/KotlinJava8Test.php +++ b/tests/KotlinJava8Test.php @@ -23,7 +23,7 @@ class KotlinJava8Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Node12Test.php b/tests/Node12Test.php index 5d6fc280a4..8f982a433c 100644 --- a/tests/Node12Test.php +++ b/tests/Node12Test.php @@ -19,7 +19,7 @@ class Node12Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Node14Test.php b/tests/Node14Test.php index 9284f3206f..1fd1947b69 100644 --- a/tests/Node14Test.php +++ b/tests/Node14Test.php @@ -19,7 +19,7 @@ class Node14Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Node16Test.php b/tests/Node16Test.php index 9ce9d77ea7..aeaf305647 100644 --- a/tests/Node16Test.php +++ b/tests/Node16Test.php @@ -19,7 +19,7 @@ class Node16Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/PHP74Test.php b/tests/PHP74Test.php index a19ee4dd78..ce7669c0b3 100644 --- a/tests/PHP74Test.php +++ b/tests/PHP74Test.php @@ -19,7 +19,7 @@ class PHP74Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/PHP80Test.php b/tests/PHP80Test.php index 9a45c4d526..0ba9ae42d0 100644 --- a/tests/PHP80Test.php +++ b/tests/PHP80Test.php @@ -19,7 +19,7 @@ class PHP80Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Python310Test.php b/tests/Python310Test.php index 84191eb5df..402186b722 100644 --- a/tests/Python310Test.php +++ b/tests/Python310Test.php @@ -23,7 +23,7 @@ class Python310Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Python38Test.php b/tests/Python38Test.php index 1bc47b22be..e3a50c864e 100644 --- a/tests/Python38Test.php +++ b/tests/Python38Test.php @@ -23,7 +23,7 @@ class Python38Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Python39Test.php b/tests/Python39Test.php index ece79ac492..196b506fa5 100644 --- a/tests/Python39Test.php +++ b/tests/Python39Test.php @@ -23,7 +23,7 @@ class Python39Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Ruby27Test.php b/tests/Ruby27Test.php index 9b3f488756..c82458ed32 100644 --- a/tests/Ruby27Test.php +++ b/tests/Ruby27Test.php @@ -21,7 +21,7 @@ class Ruby27Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Ruby30Test.php b/tests/Ruby30Test.php index a32faf4f97..b60796875d 100644 --- a/tests/Ruby30Test.php +++ b/tests/Ruby30Test.php @@ -21,7 +21,7 @@ class Ruby30Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/Ruby31Test.php b/tests/Ruby31Test.php index 6c7b1b6d54..739b2247c6 100644 --- a/tests/Ruby31Test.php +++ b/tests/Ruby31Test.php @@ -21,7 +21,7 @@ class Ruby31Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/SwiftClient55Test.php b/tests/SwiftClient55Test.php index 16852b1873..22fba9f58a 100644 --- a/tests/SwiftClient55Test.php +++ b/tests/SwiftClient55Test.php @@ -24,7 +24,7 @@ class SwiftClient55Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/SwiftServer55Test.php b/tests/SwiftServer55Test.php index e1593dbcea..4e93d0b0b5 100644 --- a/tests/SwiftServer55Test.php +++ b/tests/SwiftServer55Test.php @@ -22,7 +22,7 @@ class SwiftServer55Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/WebChromiumTest.php b/tests/WebChromiumTest.php index c85c4879f9..91ea1ddba7 100644 --- a/tests/WebChromiumTest.php +++ b/tests/WebChromiumTest.php @@ -24,7 +24,7 @@ class WebChromiumTest extends Base ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/WebNodeTest.php b/tests/WebNodeTest.php index 659d7d4dde..904ba3f249 100644 --- a/tests/WebNodeTest.php +++ b/tests/WebNodeTest.php @@ -24,7 +24,7 @@ class WebNodeTest extends Base ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSIONS_HELPER_RESPONSES, + ...BASE::PERMISSION_HELPER_RESPONSES, ...BASE::ID_HELPER_RESPONSES ]; } diff --git a/tests/languages/android/Tests.kt b/tests/languages/android/Tests.kt index ab2c19893c..c752582329 100644 --- a/tests/languages/android/Tests.kt +++ b/tests/languages/android/Tests.kt @@ -161,11 +161,23 @@ class ServiceTest { general.empty() // Query helper tests - writeToFile(Query.equal("title", ['Spiderman', 'Dr. Strange'])); - writeToFile(Query.notEqual("title', 'Spiderman')); - writeToFile(Query.lesser("releasedYear', 1990)); - writeToFile(Query.greater("releasedYear", [1990, 1999])); + writeToFile(Query.equal("title", listOf("Spiderman", "Dr. Strange"))); + writeToFile(Query.notEqual("title", "Spiderman")); + writeToFile(Query.lesser("releasedYear", 1990)); + writeToFile(Query.greater("releasedYear", listOf(1990, 1999))); writeToFile(Query.search("name", "john")); + + // Permission & Roles helper tests + writeToFile(Permission.read(Role.any())); + writeToFile(Permission.write(Role.user(ID.custom("userid")))); + writeToFile(Permission.create(Role.users())); + writeToFile(Permission.update(Role.guests())); + writeToFile(Permission.delete(Role.team("teamId", "owner"))); + writeToFile(Permission.delete(Role.team("teamId"))); + + // ID helper tests + writeToFile(ID.unique()); + writeToFile(ID.custom("custom_id")); } } diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index b929506b6b..644193bb67 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -96,12 +96,12 @@ void main() async { print(Query.search('name', "john")); // Permission & Role helper tests - print(Permissions.read(Role.any())); - print(Permissions.write(Role.user(ID.custom('userid')))); - print(Permissions.create(Role.users())); - print(Permissions.update(Role.guests())); - print(Permissions.delete(Role.team('teamId', 'owner'))); - print(Permissions.delete(Role.team('teamId'))); + print(Permission.read(Role.any())); + print(Permission.write(Role.user(ID.custom('userid')))); + print(Permission.create(Role.users())); + print(Permission.update(Role.guests())); + print(Permission.delete(Role.team('teamId', 'owner'))); + print(Permission.delete(Role.team('teamId'))); // ID helper tests print(ID.unique()); From bc9b4e7fbea037e2a373a07401e07500624f8354 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 20:26:46 +0000 Subject: [PATCH 292/555] feat: kotlin tests --- tests/languages/kotlin/Tests.kt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt index 38e55996f2..1bdab2805a 100644 --- a/tests/languages/kotlin/Tests.kt +++ b/tests/languages/kotlin/Tests.kt @@ -1,6 +1,10 @@ package io.appwrite import com.google.gson.Gson +import io.appwrite.Permission +import io.appwrite.Role +import io.appwrite.ID +import io.appwrite.Query import io.appwrite.exceptions.AppwriteException import io.appwrite.extensions.fromJson import io.appwrite.extensions.toJson @@ -115,6 +119,25 @@ class ServiceTest { } general.empty() + + // Query helper tests + writeToFile(Query.equal("title", listOf("Spiderman", "Dr. Strange"))); + writeToFile(Query.notEqual("title", "Spiderman")); + writeToFile(Query.lesser("releasedYear", 1990)); + writeToFile(Query.greater("releasedYear", listOf(1990, 1999))); + writeToFile(Query.search("name", "john")); + + // Permission & Roles helper tests + writeToFile(Permission.read(Role.any())); + writeToFile(Permission.write(Role.user(ID.custom("userid")))); + writeToFile(Permission.create(Role.users())); + writeToFile(Permission.update(Role.guests())); + writeToFile(Permission.delete(Role.team("teamId", "owner"))); + writeToFile(Permission.delete(Role.team("teamId"))); + + // ID helper tests + writeToFile(ID.unique()); + writeToFile(ID.custom("custom_id")); } } From 26b62dfb0afa37b7cb198ffe346d3027cd3e4139 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 20:39:42 +0000 Subject: [PATCH 293/555] feat: update deno mod file --- templates/deno/mod.ts.twig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/deno/mod.ts.twig b/templates/deno/mod.ts.twig index d2e91faba1..2878b63607 100644 --- a/templates/deno/mod.ts.twig +++ b/templates/deno/mod.ts.twig @@ -1,5 +1,8 @@ import { Client } from "./src/client.ts"; import { Query } from "./src/query.ts"; +import { Permission } from "./src/permission.ts"; +import { Role } from "./src/role.ts"; +import { ID } from "./src/id.ts"; import { InputFile } from "./src/inputFile.ts"; import { {{spec.title | caseUcfirst}}Exception } from "./src/exception.ts"; {% for service in spec.services %} @@ -9,6 +12,9 @@ import { {{service.name | caseUcfirst}} } from "./src/services/{{service.name | export { Client, Query, + Permission, + Role, + ID, InputFile, {{spec.title | caseUcfirst}}Exception, {% for service in spec.services %} From d0de339c3948fdb27ca8fce46c3b71f3d11d4bc0 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 20:40:02 +0000 Subject: [PATCH 294/555] feat: deno tests --- tests/languages/deno/tests.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts index 9833e0cea3..7eec1d830f 100644 --- a/tests/languages/deno/tests.ts +++ b/tests/languages/deno/tests.ts @@ -91,6 +91,25 @@ async function start() { } await general.empty(); + + // Query helper tests + console.log(appwrite.Query.equal('title', ['Spiderman', 'Dr. Strange'])); + console.log(Query.notEqual('title', 'Spiderman')); + console.log(Query.lesser('releasedYear', 1990)); + console.log(Query.greater('releasedYear', [1990, 1999])); + console.log(Query.search('name', "john")); + + // Permission & Role helper tests + console.log(Permission.read(Role.any())); + console.log(Permission.write(Role.user(ID.custom('userid')))); + console.log(Permission.create(Role.users())); + console.log(Permission.update(Role.guests())); + console.log(Permission.delete(Role.team('teamId', 'owner'))); + console.log(Permission.delete(Role.team('teamId'))); + + // ID helper tests + console.log(ID.unique()); + console.log(ID.custom('custom_id')); } start().catch((err) => { From 2bf7f81b0d12d5a52d9bf81ea7bc19592b0be89f Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 20:50:30 +0000 Subject: [PATCH 295/555] feat: update role.ts files --- templates/deno/src/role.ts.twig | 8 ++++---- templates/web/src/role.ts.twig | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/deno/src/role.ts.twig b/templates/deno/src/role.ts.twig index 8ff82fc552..964dc3aa02 100644 --- a/templates/deno/src/role.ts.twig +++ b/templates/deno/src/role.ts.twig @@ -4,7 +4,7 @@ export class Role { } public static user(id: string): string { - return 'user:\(id)' + return `user:$id` } public static users(): string { @@ -17,12 +17,12 @@ export class Role { public static team(id: string, role: string = ''): string { if(role === '') { - return 'team:\(id)' + return `team:$id` } - return 'team:\(id)/\(role)' + return `team:$id/$role` } public static status(status: string): string { - return 'status:\(status)' + return `status:$status)` } } \ No newline at end of file diff --git a/templates/web/src/role.ts.twig b/templates/web/src/role.ts.twig index 8ff82fc552..964dc3aa02 100644 --- a/templates/web/src/role.ts.twig +++ b/templates/web/src/role.ts.twig @@ -4,7 +4,7 @@ export class Role { } public static user(id: string): string { - return 'user:\(id)' + return `user:$id` } public static users(): string { @@ -17,12 +17,12 @@ export class Role { public static team(id: string, role: string = ''): string { if(role === '') { - return 'team:\(id)' + return `team:$id` } - return 'team:\(id)/\(role)' + return `team:$id/$role` } public static status(status: string): string { - return 'status:\(status)' + return `status:$status)` } } \ No newline at end of file From 009741dfc57b5d41dc51b41cef5bb2fab159977b Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 20:50:44 +0000 Subject: [PATCH 296/555] feat: deno tests --- tests/languages/deno/tests.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts index 7eec1d830f..29a2e4151c 100644 --- a/tests/languages/deno/tests.ts +++ b/tests/languages/deno/tests.ts @@ -5,6 +5,11 @@ import * as appwrite from '../../sdks/deno/mod.ts' async function start() { var response + let Permission = appwrite.Permission + let Role = appwrite.Role + let ID = appwrite.ID + let Query = appwrite.Query + // Init SDK let client = new appwrite.Client() @@ -93,7 +98,7 @@ async function start() { await general.empty(); // Query helper tests - console.log(appwrite.Query.equal('title', ['Spiderman', 'Dr. Strange'])); + console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); console.log(Query.notEqual('title', 'Spiderman')); console.log(Query.lesser('releasedYear', 1990)); console.log(Query.greater('releasedYear', [1990, 1999])); From 347835a995cd831a48461ba09ea61c0748fcb6c6 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 20:51:56 +0000 Subject: [PATCH 297/555] feat: update role.ts files --- templates/deno/src/role.ts.twig | 8 ++++---- templates/web/src/role.ts.twig | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/deno/src/role.ts.twig b/templates/deno/src/role.ts.twig index 964dc3aa02..c0e7bd761c 100644 --- a/templates/deno/src/role.ts.twig +++ b/templates/deno/src/role.ts.twig @@ -4,7 +4,7 @@ export class Role { } public static user(id: string): string { - return `user:$id` + return `user:${id}` } public static users(): string { @@ -17,12 +17,12 @@ export class Role { public static team(id: string, role: string = ''): string { if(role === '') { - return `team:$id` + return `team:${id}` } - return `team:$id/$role` + return `team:${id}/${role}` } public static status(status: string): string { - return `status:$status)` + return `status:${status}` } } \ No newline at end of file diff --git a/templates/web/src/role.ts.twig b/templates/web/src/role.ts.twig index 964dc3aa02..c0e7bd761c 100644 --- a/templates/web/src/role.ts.twig +++ b/templates/web/src/role.ts.twig @@ -4,7 +4,7 @@ export class Role { } public static user(id: string): string { - return `user:$id` + return `user:${id}` } public static users(): string { @@ -17,12 +17,12 @@ export class Role { public static team(id: string, role: string = ''): string { if(role === '') { - return `team:$id` + return `team:${id}` } - return `team:$id/$role` + return `team:${id}/${role}` } public static status(status: string): string { - return `status:$status)` + return `status:${status}` } } \ No newline at end of file From 096efcd338214b32c806475114d7c268edf767b9 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 20:58:31 +0000 Subject: [PATCH 298/555] feat: update index.js files --- templates/node/index.js.twig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/node/index.js.twig b/templates/node/index.js.twig index e5639608b6..b82be23234 100644 --- a/templates/node/index.js.twig +++ b/templates/node/index.js.twig @@ -1,5 +1,8 @@ const Client = require('./lib/client.js'); const Query = require('./lib/query.js'); +const Permission = require('./lib/permission.js'); +const Role = require('./lib/role.js'); +const ID = require('./lib/id.js'); const InputFile = require('./lib/inputFile.js'); const {{spec.title | caseUcfirst}}Exception = require('./lib/exception.js'); {% for service in spec.services %} @@ -9,6 +12,9 @@ const {{service.name | caseUcfirst}} = require('./lib/services/{{service.name | module.exports = { Client, Query, + Permission, + Role, + ID, InputFile, {{spec.title | caseUcfirst}}Exception, {% for service in spec.services %} From ae12a1132a5cbb9c5388177655f746abee4fdea9 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 21:00:18 +0000 Subject: [PATCH 299/555] feat: node tests --- tests/languages/node/test.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index 76a31d2b18..4737733fc4 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -6,6 +6,11 @@ const fs = require('fs'); async function start() { var response; + let Permission = appwrite.Permission; + let Query = appwrite.Query; + let Role = appwrite.Role; + let ID = appwrite.ID; + // Init SDK let client = new appwrite.Client(); @@ -79,6 +84,25 @@ async function start() { } await general.empty(); + + // Query helper tests + console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); + console.log(Query.notEqual('title', 'Spiderman')); + console.log(Query.lesser('releasedYear', 1990)); + console.log(Query.greater('releasedYear', [1990, 1999])); + console.log(Query.search('name', "john")); + + // Permission & Role helper tests + console.log(Permission.read(Role.any())); + console.log(Permission.write(Role.user(ID.custom('userid')))); + console.log(Permission.create(Role.users())); + console.log(Permission.update(Role.guests())); + console.log(Permission.delete(Role.team('teamId', 'owner'))); + console.log(Permission.delete(Role.team('teamId'))); + + // ID helper tests + console.log(ID.unique()); + console.log(ID.custom('custom_id')); } start().catch((err) => { From 17a0081fa664afb035e29b400d158f520fc7dcbb Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 21:08:09 +0000 Subject: [PATCH 300/555] feat: update role.php --- templates/php/src/Role.php.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/php/src/Role.php.twig b/templates/php/src/Role.php.twig index e950712135..8225a9db94 100644 --- a/templates/php/src/Role.php.twig +++ b/templates/php/src/Role.php.twig @@ -16,7 +16,7 @@ class Role { return 'users'; } - public static function guest(): string + public static function guests(): string { return 'guests'; } From 42ab58f14a08c0f11f4835b16922f76f2483d604 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 21:09:27 +0000 Subject: [PATCH 301/555] feat: update role.php --- templates/php/src/Permission.php.twig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/php/src/Permission.php.twig b/templates/php/src/Permission.php.twig index bfdc4d50ba..d4c092a9c8 100644 --- a/templates/php/src/Permission.php.twig +++ b/templates/php/src/Permission.php.twig @@ -6,22 +6,22 @@ class Permission { public static function read(string $role): string { - return "read('$role')"; + return "read("$role")"; } public static function write(string $role): string { - return "write('$role')"; + return "write("$role")"; } public static function create(string $role): string { - return "create('$role')"; + return "create("$role")"; } public static function update(string $role): string { - return "update('$role')"; + return "update("$role")"; } public static function delete(string $role): string { - return "delete('$role')"; + return "delete("$role")"; } } From 276f6d4b1a4f527e470195e2dae12542deb922c2 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 21:11:23 +0000 Subject: [PATCH 302/555] feat: update role.php --- templates/php/src/Permission.php.twig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/php/src/Permission.php.twig b/templates/php/src/Permission.php.twig index d4c092a9c8..941565e7c4 100644 --- a/templates/php/src/Permission.php.twig +++ b/templates/php/src/Permission.php.twig @@ -6,22 +6,22 @@ class Permission { public static function read(string $role): string { - return "read("$role")"; + return "read(\"$role\")"; } public static function write(string $role): string { - return "write("$role")"; + return "write(\"$role\")"; } public static function create(string $role): string { - return "create("$role")"; + return "create(\"$role\")"; } public static function update(string $role): string { - return "update("$role")"; + return "update(\"$role\")"; } public static function delete(string $role): string { - return "delete("$role")"; + return "delete(\"$role\")"; } } From a0c533e1ec1610044f6f73bea6d505b118cafa51 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 21:21:01 +0000 Subject: [PATCH 303/555] feat: update role.py --- templates/python/package/role.py.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/python/package/role.py.twig b/templates/python/package/role.py.twig index 2d8a5d80ea..3d02b69cda 100644 --- a/templates/python/package/role.py.twig +++ b/templates/python/package/role.py.twig @@ -18,8 +18,8 @@ class Role: @staticmethod def team(id, role = ""): if role: - return f'team:{id}' - return f'team:{id}/{role}' + return f'team:{id}/{role}' + return f'team:{id}' @staticmethod def status(status): From a7229669dd9adf94ed69ff8e180b85d144a3bf36 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 21:35:58 +0000 Subject: [PATCH 304/555] feat: update Query.py --- templates/python/package/query.py.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/python/package/query.py.twig b/templates/python/package/query.py.twig index 3a6179df32..f19e2f054f 100644 --- a/templates/python/package/query.py.twig +++ b/templates/python/package/query.py.twig @@ -39,4 +39,4 @@ class Query: if type(value) == str: return '"{}"'.format(value) else: - return value \ No newline at end of file + return str(value) \ No newline at end of file From c53a8f8432f06b5010727452c59aaaeebcc49d31 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 21:37:02 +0000 Subject: [PATCH 305/555] feat: pythontests --- tests/languages/dart/tests.dart | 2 +- tests/languages/flutter/tests.dart | 2 +- tests/languages/php/test.php | 27 +++++++++++++++++++++++++++ tests/languages/python/tests.py | 26 +++++++++++++++++++++++++- 4 files changed, 54 insertions(+), 3 deletions(-) diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 644193bb67..6abbba2b62 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -93,7 +93,7 @@ void main() async { print(Query.notEqual('title', 'Spiderman')); print(Query.lesser('releasedYear', 1990)); print(Query.greater('releasedYear', [1990, 1999])); - print(Query.search('name', "john")); + print(Query.search('name', 'john')); // Permission & Role helper tests print(Permission.read(Role.any())); diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index ba1d5ec63f..912dd3d434 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -113,7 +113,7 @@ void main() async { print(Query.notEqual('title', 'Spiderman')); print(Query.lesser('releasedYear', 1990)); print(Query.greater('releasedYear', [1990, 1999])); - print(Query.search('name', "john")); + print(Query.search('name', 'john')); // Permission & Role helper tests print(Permission.read(Role.any())); diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index 5667b27a2c..2c1dbcab41 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -3,6 +3,10 @@ include __DIR__ . '/../../sdks/php/src/Appwrite/Client.php'; include __DIR__ . '/../../sdks/php/src/Appwrite/Service.php'; include __DIR__ . '/../../sdks/php/src/Appwrite/InputFile.php'; +include __DIR__ . '/../../sdks/php/src/Appwrite/Query.php'; +include __DIR__ . '/../../sdks/php/src/Appwrite/Permission.php'; +include __DIR__ . '/../../sdks/php/src/Appwrite/Role.php'; +include __DIR__ . '/../../sdks/php/src/Appwrite/ID.php'; include __DIR__ . '/../../sdks/php/src/Appwrite/AppwriteException.php'; include __DIR__ . '/../../sdks/php/src/Appwrite/Services/Foo.php'; include __DIR__ . '/../../sdks/php/src/Appwrite/Services/Bar.php'; @@ -11,6 +15,10 @@ use Appwrite\AppwriteException; use Appwrite\Client; use Appwrite\InputFile; +use Appwrite\Query; +use Appwrite\Permission; +use Appwrite\Role; +use Appwrite\ID; use Appwrite\Services\Bar; use Appwrite\Services\Foo; use Appwrite\Services\General; @@ -94,3 +102,22 @@ } $general->empty(); + +// Query helper tests +echo Query::equal('title', ['Spiderman', 'Dr. Strange']) . "\n"; +echo Query::notEqual('title', 'Spiderman') . "\n"; +echo Query::lesser('releasedYear', 1990) . "\n"; +echo Query::greater('releasedYear', [1990, 1999]) . "\n"; +echo Query::search('name', "john") . "\n"; + +// Permission & Role helper tests +echo Permission::read(Role::any()) . "\n"; +echo Permission::write(Role::user(ID::custom('userid'))) . "\n"; +echo Permission::create(Role::users()) . "\n"; +echo Permission::update(Role::guests()) . "\n"; +echo Permission::delete(Role::team('teamId', 'owner')) . "\n"; +echo Permission::delete(Role::team('teamId')) . "\n"; + +// ID helper tests +echo ID::unique() . "\n"; +echo ID::custom('custom_id') . "\n"; \ No newline at end of file diff --git a/tests/languages/python/tests.py b/tests/languages/python/tests.py index 18dcbb6337..56d11e9d09 100644 --- a/tests/languages/python/tests.py +++ b/tests/languages/python/tests.py @@ -4,6 +4,11 @@ from appwrite.services.general import General from appwrite.exception import AppwriteException from appwrite.input_file import InputFile +from appwrite.query import Query +from appwrite.permission import Permission +from appwrite.role import Role +from appwrite.id import ID + import os.path @@ -85,4 +90,23 @@ except AppwriteException as e: print(e.message) -general.empty() \ No newline at end of file +general.empty() + +# Query helper tests +print(Query.equal('title', ['Spiderman', 'Dr. Strange'])); +print(Query.notEqual('title', 'Spiderman')); +print(Query.lesser('releasedYear', 1990)); +print(Query.greater('releasedYear', [1990, 1999])); +print(Query.search('name', 'john')); + +# Permission & Role helper tests +print(Permission.read(Role.any())); +print(Permission.write(Role.user(ID.custom('userid')))); +print(Permission.create(Role.users())); +print(Permission.update(Role.guests())); +print(Permission.delete(Role.team('teamId', 'owner'))); +print(Permission.delete(Role.team('teamId'))); + +# ID helper tests +print(ID.unique()); +print(ID.custom('custom_id')); \ No newline at end of file From aa0ffa2966d282ba9a3d012f4a83657fd62b6a4c Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 21:42:03 +0000 Subject: [PATCH 306/555] feat: update container.rb --- templates/ruby/lib/container.rb.twig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/ruby/lib/container.rb.twig b/templates/ruby/lib/container.rb.twig index cbdef7b1ca..688d54357b 100644 --- a/templates/ruby/lib/container.rb.twig +++ b/templates/ruby/lib/container.rb.twig @@ -7,6 +7,10 @@ require_relative '{{ spec.title | caseSnake }}/client' require_relative '{{ spec.title | caseSnake }}/service' require_relative '{{ spec.title | caseSnake }}/exception' require_relative '{{ spec.title | caseSnake }}/input_file' +require_relative '{{ spec.title | caseSnake }}/query' +require_relative '{{ spec.title | caseSnake }}/permission' +require_relative '{{ spec.title | caseSnake }}/role' +require_relative '{{ spec.title | caseSnake }}/id' {% for defintion in spec.definitions %} require_relative '{{ spec.title | caseSnake }}/models/{{ defintion.name | caseSnake }}' From 047fcee84b29918a26987df1b8d50bd245cb173a Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 21:46:38 +0000 Subject: [PATCH 307/555] feat: update container.rb --- templates/ruby/lib/container/query.rb.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/ruby/lib/container/query.rb.twig b/templates/ruby/lib/container/query.rb.twig index 0ab49c1cb8..2395c02103 100644 --- a/templates/ruby/lib/container/query.rb.twig +++ b/templates/ruby/lib/container/query.rb.twig @@ -28,9 +28,9 @@ module {{spec.title | caseUcfirst}} def addQuery(attribute, oper, value) if value.is_a?(Array) - "#{attribute}.#{oper}.(#{value.map {|item| parseValues(item)}.join(',')})" + "#{attribute}.#{oper}(#{value.map {|item| parseValues(item)}.join(',')})" else - return "#{attribute}.#{oper}.(#{parseValues(value)})" + return "#{attribute}.#{oper}(#{parseValues(value)})" end end From 7000a20524e898e6188fea2ed6f57d82ff42b13a Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 21:50:17 +0000 Subject: [PATCH 308/555] feat: update container.rb --- templates/ruby/lib/container/query.rb.twig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/ruby/lib/container/query.rb.twig b/templates/ruby/lib/container/query.rb.twig index 2395c02103..8a3e6736c4 100644 --- a/templates/ruby/lib/container/query.rb.twig +++ b/templates/ruby/lib/container/query.rb.twig @@ -6,22 +6,22 @@ module {{spec.title | caseUcfirst}} end def notEqual(attribute, value) - return Query.addQuery(attribute, "notEqual", value) + return addQuery(attribute, "notEqual", value) end def lesser(attribute, value) - return Query.addQuery(attribute, "lesser", value) + return addQuery(attribute, "lesser", value) end def lesserEqual(attribute, value) - return Query.addQuery(attribute, "lesserEqual", value) + return addQuery(attribute, "lesserEqual", value) end def greater(attribute, value) - return Query.addQuery(attribute, "greater", value) + return addQuery(attribute, "greater", value) end def greaterEqual(attribute, value) - return Query.addQuery(attribute, "equal", value) + return addQuery(attribute, "equal", value) end def search(attribute, value) - return Query.addQuery(attribute, "search", value) + return addQuery(attribute, "search", value) end private From 722699ed16d51346f2de3747bf30145773ed94d7 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 21:51:10 +0000 Subject: [PATCH 309/555] feat: ruby tests --- tests/languages/ruby/tests.rb | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index 0a5e860d04..a1658b08af 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -1,5 +1,10 @@ require_relative '../../sdks/ruby/lib/appwrite' +query = Appwrite::Query +permission = Appwrite::Permission +role = Appwrite::Role +id = Appwrite::ID + client = Appwrite::Client.new client.add_header('Origin', 'http://localhost') @@ -97,4 +102,23 @@ puts error.message end -general.empty() \ No newline at end of file +general.empty() + +# Query helper tests +puts query.equal('title', ['Spiderman', 'Dr. Strange']) +puts query.notEqual('title', 'Spiderman') +puts query.lesser('releasedYear', 1990) +puts query.greater('releasedYear', [1990, 1999]) +puts query.search('name', 'john') + +# Permission & Role helper tests +puts permission.read(role.any()) +puts permission.write(role.user(id.custom('userid'))) +puts permission.create(role.users()) +puts permission.update(role.guests()) +puts permission.delete(role.team('teamId', 'owner')) +puts permission.delete(role.team('teamId')) + +# ID helper tests +puts id.unique() +puts id.custom('custom_id') \ No newline at end of file From e2e28bb3e35d6bc3c8b826909818f3d2f637b5a5 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 21:57:08 +0000 Subject: [PATCH 310/555] feat: update role.swift --- templates/swift/Sources/ID.swift.twig | 2 +- templates/swift/Sources/Role.swift.twig | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/swift/Sources/ID.swift.twig b/templates/swift/Sources/ID.swift.twig index 78f28ec802..4641f2b895 100644 --- a/templates/swift/Sources/ID.swift.twig +++ b/templates/swift/Sources/ID.swift.twig @@ -4,6 +4,6 @@ public class ID { } public static func unique() -> String { - return 'unique()' + return "unique()" } } \ No newline at end of file diff --git a/templates/swift/Sources/Role.swift.twig b/templates/swift/Sources/Role.swift.twig index 73ac3bf2f2..32a7a393c2 100644 --- a/templates/swift/Sources/Role.swift.twig +++ b/templates/swift/Sources/Role.swift.twig @@ -1,28 +1,28 @@ public class Role { public static func any() -> String { - return 'any' + return "any" } public static func user(_ id: String) -> String { - return 'user:\(id)' + return "user:\(id)" } public static func users() -> String { - return 'users' + return "users" } public static func guests() -> String { - return 'guests' + return "guests" } public static func team(_ id: String, _ role: String = "") -> String { if(role.isEmpty) { - return 'team:\(id)' + return "team:\(id)" } - return 'team:\(id)/\(role)' + return "team:\(id)/\(role)" } public static func status(_ status: String) -> String { - return 'status:\(status)' + return "status:\(status)" } } \ No newline at end of file From bbc4ff50a4f36d6fa2b0010bc9baa584a422734e Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 22:21:47 +0000 Subject: [PATCH 311/555] feat: update role.swift --- templates/web/src/index.ts.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/web/src/index.ts.twig b/templates/web/src/index.ts.twig index cd650c94e5..75ecd534da 100644 --- a/templates/web/src/index.ts.twig +++ b/templates/web/src/index.ts.twig @@ -3,4 +3,7 @@ export { Client, Query, {{spec.title | caseUcfirst}}Exception } from './client'; export { {{service.name | caseUcfirst}} } from './services/{{service.name | caseDash}}'; {% endfor %} export type { Models, Payload, RealtimeResponseEvent, UploadProgress } from './client'; -export type { QueryTypes, QueryTypesList } from './query'; \ No newline at end of file +export type { QueryTypes, QueryTypesList } from './query'; +export { Permission } from './permission'; +export { Role } from './role'; +export { ID } from './id'; \ No newline at end of file From ad13fdd1c814421d7800a7f516631ef72e6457a5 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 15 Aug 2022 22:24:25 +0000 Subject: [PATCH 312/555] feat: web tests --- tests/languages/swift-client/Tests.swift | 19 +++++++++++++++++++ tests/languages/swift-server/Tests.swift | 19 +++++++++++++++++++ tests/languages/web/index.html | 21 ++++++++++++++++++++- tests/languages/web/node.js | 21 ++++++++++++++++++++- 4 files changed, 78 insertions(+), 2 deletions(-) diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/swift-client/Tests.swift index cffa3f3550..928140cf10 100644 --- a/tests/languages/swift-client/Tests.swift +++ b/tests/languages/swift-client/Tests.swift @@ -142,5 +142,24 @@ class Tests: XCTestCase { print(mock.result) try! await general.empty() + + // Query helper tests + print(Query.equal("title", value: ["Spiderman", "Dr. Strange"])); + print(Query.notEqual("title", value: "Spiderman")); + print(Query.lesser("releasedYear", value: 1990)); + print(Query.greater("releasedYear", value: [1990, 1999])); + print(Query.search("name", value: "john")); + + // Permission & Role helper tests + print(Permission.read(Role.any())); + print(Permission.write(Role.user(ID.custom("userid")))); + print(Permission.create(Role.users())); + print(Permission.update(Role.guests())); + print(Permission.delete(Role.team("teamId", "owner"))); + print(Permission.delete(Role.team("teamId"))); + + // ID helper tests + print(ID.unique()); + print(ID.custom("custom_id")); } } diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index a5782e2329..afaa54a8a9 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -123,5 +123,24 @@ class Tests: XCTestCase { } try! await general.empty() + + // Query helper tests + print(Query.equal("title", value: ["Spiderman", "Dr. Strange"])); + print(Query.notEqual("title", value: "Spiderman")); + print(Query.lesser("releasedYear", value: 1990)); + print(Query.greater("releasedYear", value: [1990, 1999])); + print(Query.search("name", value: "john")); + + // Permission & Role helper tests + print(Permission.read(Role.any())); + print(Permission.write(Role.user(ID.custom("userid")))); + print(Permission.create(Role.users())); + print(Permission.update(Role.guests())); + print(Permission.delete(Role.team("teamId", "owner"))); + print(Permission.delete(Role.team("teamId"))); + + // ID helper tests + print(ID.unique()); + print(ID.custom("custom_id")); } } diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index 79abf18829..45fda0594e 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -20,7 +20,7 @@ let response; let responseRealtime = 'Realtime failed!'; // Init SDK - const { Client, Foo, Bar, General } = Appwrite; + const { Client, Foo, Bar, General, Query, Permission, Role, ID } = Appwrite; const client = new Client(); const foo = new Foo(client); const bar = new Bar(client); @@ -112,6 +112,25 @@ await Promise.resolve(resolve=>setTimeout(() => resolve, 5000)); console.log(responseRealtime) + // Query helper tests + console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); + console.log(Query.notEqual('title', 'Spiderman')); + console.log(Query.lesser('releasedYear', 1990)); + console.log(Query.greater('releasedYear', [1990, 1999])); + console.log(Query.search('name', "john")); + + // Permission & Role helper tests + console.log(Permission.read(Role.any())); + console.log(Permission.write(Role.user(ID.custom('userid')))); + console.log(Permission.create(Role.users())); + console.log(Permission.gitupdate(Role.guests())); + console.log(Permission.delete(Role.team('teamId', 'owner'))); + console.log(Permission.delete(Role.team('teamId'))); + + // ID helper tests + console.log(ID.unique()); + console.log(ID.custom('custom_id')); + }); diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js index e5fccb359f..ea0c952120 100644 --- a/tests/languages/web/node.js +++ b/tests/languages/web/node.js @@ -1,4 +1,4 @@ -const { Client, Foo, Bar, General } = require('./dist/cjs/sdk.js'); +const { Client, Foo, Bar, General, Query, Permission, Role, ID } = require('./dist/cjs/sdk.js'); async function start() { let response; @@ -69,6 +69,25 @@ async function start() { } console.log('WS:/v1/realtime:passed'); // Skip realtime test on Node.js + + // Query helper tests + console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); + console.log(Query.notEqual('title', 'Spiderman')); + console.log(Query.lesser('releasedYear', 1990)); + console.log(Query.greater('releasedYear', [1990, 1999])); + console.log(Query.search('name', "john")); + + // Permission & Role helper tests + console.log(Permission.read(Role.any())); + console.log(Permission.write(Role.user(ID.custom('userid')))); + console.log(Permission.create(Role.users())); + console.log(Permission.update(Role.guests())); + console.log(Permission.delete(Role.team('teamId', 'owner'))); + console.log(Permission.delete(Role.team('teamId'))); + + // ID helper tests + console.log(ID.unique()); + console.log(ID.custom('custom_id')); } start(); \ No newline at end of file From ebec7338a94316f3eda20649458abe6b7a7b06e0 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 05:36:22 +0000 Subject: [PATCH 313/555] feat: fix web tests --- tests/languages/web/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index 45fda0594e..80ec42b813 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -123,7 +123,7 @@ console.log(Permission.read(Role.any())); console.log(Permission.write(Role.user(ID.custom('userid')))); console.log(Permission.create(Role.users())); - console.log(Permission.gitupdate(Role.guests())); + console.log(Permission.update(Role.guests())); console.log(Permission.delete(Role.team('teamId', 'owner'))); console.log(Permission.delete(Role.team('teamId'))); From df40ea51333210c2679286f45d2aa2d2d259523d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 06:42:32 +0000 Subject: [PATCH 314/555] fix class name --- tests/Android11Java11Test.php | 4 ++-- tests/Android11Java8Test.php | 4 ++-- tests/Android12Java11Test.php | 4 ++-- tests/Android12Java8Test.php | 4 ++-- tests/Android5Java11Test.php | 4 ++-- tests/Android5Java8Test.php | 4 ++-- tests/DartBetaTest.php | 4 ++-- tests/DartStableTest.php | 4 ++-- tests/Deno1171Test.php | 4 ++-- tests/FlutterBetaTest.php | 4 ++-- tests/FlutterStableTest.php | 4 ++-- tests/KotlinJava11Test.php | 4 ++-- tests/KotlinJava17Test.php | 4 ++-- tests/KotlinJava8Test.php | 4 ++-- tests/Node12Test.php | 4 ++-- tests/Node14Test.php | 4 ++-- tests/Node16Test.php | 4 ++-- tests/PHP74Test.php | 4 ++-- tests/PHP80Test.php | 4 ++-- tests/Python310Test.php | 4 ++-- tests/Python38Test.php | 4 ++-- tests/Python39Test.php | 4 ++-- tests/Ruby27Test.php | 4 ++-- tests/Ruby30Test.php | 4 ++-- tests/Ruby31Test.php | 4 ++-- tests/SwiftClient55Test.php | 4 ++-- tests/SwiftServer55Test.php | 4 ++-- tests/WebChromiumTest.php | 4 ++-- tests/WebNodeTest.php | 4 ++-- 29 files changed, 58 insertions(+), 58 deletions(-) diff --git a/tests/Android11Java11Test.php b/tests/Android11Java11Test.php index b241d250fe..43e1518d12 100644 --- a/tests/Android11Java11Test.php +++ b/tests/Android11Java11Test.php @@ -25,7 +25,7 @@ class Android11Java11Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android11Java8Test.php b/tests/Android11Java8Test.php index 2333da7ed5..10b5ec2c4b 100644 --- a/tests/Android11Java8Test.php +++ b/tests/Android11Java8Test.php @@ -25,7 +25,7 @@ class Android11Java8Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android12Java11Test.php b/tests/Android12Java11Test.php index 3c07c0c8b3..9ec88f144a 100644 --- a/tests/Android12Java11Test.php +++ b/tests/Android12Java11Test.php @@ -25,7 +25,7 @@ class Android12Java11Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android12Java8Test.php b/tests/Android12Java8Test.php index 5e88d1283a..572c200b40 100644 --- a/tests/Android12Java8Test.php +++ b/tests/Android12Java8Test.php @@ -25,7 +25,7 @@ class Android12Java8Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android5Java11Test.php b/tests/Android5Java11Test.php index 30c0cf99dd..a2bb996299 100644 --- a/tests/Android5Java11Test.php +++ b/tests/Android5Java11Test.php @@ -25,7 +25,7 @@ class Android5Java11Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Android5Java8Test.php b/tests/Android5Java8Test.php index 7e20670f90..9a053228b5 100644 --- a/tests/Android5Java8Test.php +++ b/tests/Android5Java8Test.php @@ -25,7 +25,7 @@ class Android5Java8Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/DartBetaTest.php b/tests/DartBetaTest.php index e73a09fcbc..e50bda3c2b 100644 --- a/tests/DartBetaTest.php +++ b/tests/DartBetaTest.php @@ -20,7 +20,7 @@ class DartBetaTest extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/DartStableTest.php b/tests/DartStableTest.php index 66e3e5e26e..6e3a33db5c 100644 --- a/tests/DartStableTest.php +++ b/tests/DartStableTest.php @@ -20,7 +20,7 @@ class DartStableTest extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Deno1171Test.php b/tests/Deno1171Test.php index 1a64cbdbd8..d9e07a095c 100644 --- a/tests/Deno1171Test.php +++ b/tests/Deno1171Test.php @@ -17,7 +17,7 @@ class Deno1171Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/FlutterBetaTest.php b/tests/FlutterBetaTest.php index 1bd91869f4..086f49860a 100644 --- a/tests/FlutterBetaTest.php +++ b/tests/FlutterBetaTest.php @@ -22,7 +22,7 @@ class FlutterBetaTest extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/FlutterStableTest.php b/tests/FlutterStableTest.php index 910c26ecf4..ffd7172c16 100644 --- a/tests/FlutterStableTest.php +++ b/tests/FlutterStableTest.php @@ -22,7 +22,7 @@ class FlutterStableTest extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/KotlinJava11Test.php b/tests/KotlinJava11Test.php index f2be031ff2..88e0e7acd4 100644 --- a/tests/KotlinJava11Test.php +++ b/tests/KotlinJava11Test.php @@ -23,7 +23,7 @@ class KotlinJava11Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/KotlinJava17Test.php b/tests/KotlinJava17Test.php index 50438b5d87..db50a6e837 100644 --- a/tests/KotlinJava17Test.php +++ b/tests/KotlinJava17Test.php @@ -23,7 +23,7 @@ class KotlinJava17Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/KotlinJava8Test.php b/tests/KotlinJava8Test.php index bc8fbb675d..481753da3d 100644 --- a/tests/KotlinJava8Test.php +++ b/tests/KotlinJava8Test.php @@ -23,7 +23,7 @@ class KotlinJava8Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Node12Test.php b/tests/Node12Test.php index 8f982a433c..3352835d3a 100644 --- a/tests/Node12Test.php +++ b/tests/Node12Test.php @@ -19,7 +19,7 @@ class Node12Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Node14Test.php b/tests/Node14Test.php index 1fd1947b69..b247e8ee28 100644 --- a/tests/Node14Test.php +++ b/tests/Node14Test.php @@ -19,7 +19,7 @@ class Node14Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Node16Test.php b/tests/Node16Test.php index aeaf305647..b6dd758850 100644 --- a/tests/Node16Test.php +++ b/tests/Node16Test.php @@ -19,7 +19,7 @@ class Node16Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/PHP74Test.php b/tests/PHP74Test.php index ce7669c0b3..51c0a53265 100644 --- a/tests/PHP74Test.php +++ b/tests/PHP74Test.php @@ -19,7 +19,7 @@ class PHP74Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/PHP80Test.php b/tests/PHP80Test.php index 0ba9ae42d0..0fe2563266 100644 --- a/tests/PHP80Test.php +++ b/tests/PHP80Test.php @@ -19,7 +19,7 @@ class PHP80Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Python310Test.php b/tests/Python310Test.php index 402186b722..9f3263ce17 100644 --- a/tests/Python310Test.php +++ b/tests/Python310Test.php @@ -23,7 +23,7 @@ class Python310Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Python38Test.php b/tests/Python38Test.php index e3a50c864e..c95fa5cef3 100644 --- a/tests/Python38Test.php +++ b/tests/Python38Test.php @@ -23,7 +23,7 @@ class Python38Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Python39Test.php b/tests/Python39Test.php index 196b506fa5..ce5db2d1c3 100644 --- a/tests/Python39Test.php +++ b/tests/Python39Test.php @@ -23,7 +23,7 @@ class Python39Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Ruby27Test.php b/tests/Ruby27Test.php index c82458ed32..5b7bbc6182 100644 --- a/tests/Ruby27Test.php +++ b/tests/Ruby27Test.php @@ -21,7 +21,7 @@ class Ruby27Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Ruby30Test.php b/tests/Ruby30Test.php index b60796875d..2ec143816f 100644 --- a/tests/Ruby30Test.php +++ b/tests/Ruby30Test.php @@ -21,7 +21,7 @@ class Ruby30Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/Ruby31Test.php b/tests/Ruby31Test.php index 739b2247c6..f9020c1418 100644 --- a/tests/Ruby31Test.php +++ b/tests/Ruby31Test.php @@ -21,7 +21,7 @@ class Ruby31Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/SwiftClient55Test.php b/tests/SwiftClient55Test.php index 22fba9f58a..85e8203277 100644 --- a/tests/SwiftClient55Test.php +++ b/tests/SwiftClient55Test.php @@ -24,7 +24,7 @@ class SwiftClient55Test extends Base ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/SwiftServer55Test.php b/tests/SwiftServer55Test.php index 4e93d0b0b5..8f2a0963d4 100644 --- a/tests/SwiftServer55Test.php +++ b/tests/SwiftServer55Test.php @@ -22,7 +22,7 @@ class SwiftServer55Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/WebChromiumTest.php b/tests/WebChromiumTest.php index 91ea1ddba7..8929b6a69e 100644 --- a/tests/WebChromiumTest.php +++ b/tests/WebChromiumTest.php @@ -24,7 +24,7 @@ class WebChromiumTest extends Base ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } diff --git a/tests/WebNodeTest.php b/tests/WebNodeTest.php index 904ba3f249..b738175922 100644 --- a/tests/WebNodeTest.php +++ b/tests/WebNodeTest.php @@ -24,7 +24,7 @@ class WebNodeTest extends Base ...Base::EXCEPTION_RESPONSES, ...Base::REALTIME_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, - ...BASE::PERMISSION_HELPER_RESPONSES, - ...BASE::ID_HELPER_RESPONSES + ...Base::PERMISSION_HELPER_RESPONSES, + ...Base::ID_HELPER_RESPONSES ]; } From 53d9f8718f94323b2dceb90264afacee14a48210 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 12:18:31 +0530 Subject: [PATCH 315/555] Update templates/dart/lib/role.dart.twig Co-authored-by: Damodar Lohani --- templates/dart/lib/role.dart.twig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/dart/lib/role.dart.twig b/templates/dart/lib/role.dart.twig index 604a482c9a..65ebf83657 100644 --- a/templates/dart/lib/role.dart.twig +++ b/templates/dart/lib/role.dart.twig @@ -23,4 +23,8 @@ class Role { } return 'team:$id/$role'; } + + static String status(String status) { + return 'status:$status'; + } } \ No newline at end of file From c775ff09b1d95278955b8770b8da0321c14740f2 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 12:18:37 +0530 Subject: [PATCH 316/555] Update templates/flutter/lib/role.dart.twig Co-authored-by: Damodar Lohani --- templates/flutter/lib/role.dart.twig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/flutter/lib/role.dart.twig b/templates/flutter/lib/role.dart.twig index 604a482c9a..65ebf83657 100644 --- a/templates/flutter/lib/role.dart.twig +++ b/templates/flutter/lib/role.dart.twig @@ -23,4 +23,8 @@ class Role { } return 'team:$id/$role'; } + + static String status(String status) { + return 'status:$status'; + } } \ No newline at end of file From f6e80e51ba10cc69e266367028574e5b18dd5cd1 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 08:01:39 +0000 Subject: [PATCH 317/555] query tests resposes update --- tests/Base.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/Base.php b/tests/Base.php index 82cd62177d..5cd0c170ee 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -59,11 +59,17 @@ abstract class Base extends TestCase ]; const QUERY_HELPER_RESPONSES = [ - 'title.equal("Spiderman","Dr. Strange")', - 'title.notEqual("Spiderman")', - 'releasedYear.lesser(1990)', - 'releasedYear.greater(1990,1999)', - 'name.search("john")', + 'equal("title", ["Spiderman","Dr. Strange"])', + 'notEqual("title", ["Spiderman"])', + 'lesser("releasedYear", [1990])', + 'greater("releasedYear", [1990,1999])', + 'search("name", ["john"])', + 'orderAsc("title")', + 'orderDesc("title")', + 'cursorAfter("my_movie_id")', + 'cursorBefore("my_movie_id")', + 'limit(50)', + 'offset(20)', ]; const PERMISSION_HELPER_RESPONSES = [ From 3e1a6461ad7072a253f932c64fde82311a118609 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 08:02:49 +0000 Subject: [PATCH 318/555] swfit query helper update --- templates/swift/Sources/Query.swift.twig | 28 ++++++++++++++++++++++-- tests/languages/swift-server/Tests.swift | 6 +++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/templates/swift/Sources/Query.swift.twig b/templates/swift/Sources/Query.swift.twig index 26f733bd48..5fda6b5199 100644 --- a/templates/swift/Sources/Query.swift.twig +++ b/templates/swift/Sources/Query.swift.twig @@ -31,12 +31,36 @@ public class Query { public static func buildQueryWhere(_ attribute: String, is oper: String, to value: Any) -> String { switch value { case let value as Array: - return "\(attribute).\(oper)(\(value.map { parseValues($0) }.joined(separator: ",") ))" + return "\(oper)(\"\(attribute)\", [\(value.map { parseValues($0) }.joined(separator: ",") )])" default: - return "\(attribute).\(oper)(\(parseValues(value)))" + return "\(oper)(\"\(attribute)\", [\(parseValues(value))])" } } + public static func orderAsc(_ attribute: String) -> String { + "orderAsc(\"\(attribute)\")" + } + + public static func orderDesc(_ attribute: String) -> String { + "orderDesc(\"\(attribute)\")" + } + + public static func cursorBefore(_ id: String) -> String { + "cursorBefore(\"\(id)\")" + } + + public static func cursorAfter(_ id: String) -> String { + "cursorAfter(\"\(id)\")" + } + + public static func limit(_ limit: Int) -> String { + "limit(\(limit))" + } + + public static func offset(_ offset: Int) -> String { + "offset(\(offset))" + } + private static func parseValues(_ value: Any) -> String { switch value { case let value as String: diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index afaa54a8a9..1002fa8504 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -130,6 +130,12 @@ class Tests: XCTestCase { print(Query.lesser("releasedYear", value: 1990)); print(Query.greater("releasedYear", value: [1990, 1999])); print(Query.search("name", value: "john")); + print(Query.orderAsc("title")); + print(Query.orderDesc("title")); + print(Query.cursorAfter("my_movie_id")); + print(Query.cursorBefore("my_movie_id")); + print(Query.limit(50)); + print(Query.offset(20)); // Permission & Role helper tests print(Permission.read(Role.any())); From da1a914b96f73144ebade4ca42f3155073fd5691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 16 Aug 2022 08:05:19 +0000 Subject: [PATCH 319/555] Upgrade Deno Query class --- templates/deno/src/query.ts.twig | 79 ++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 25 deletions(-) diff --git a/templates/deno/src/query.ts.twig b/templates/deno/src/query.ts.twig index f4e81fd5ca..8efa663e0b 100644 --- a/templates/deno/src/query.ts.twig +++ b/templates/deno/src/query.ts.twig @@ -3,36 +3,65 @@ export type QueryTypesList = string[] | number[] | boolean[]; export type QueryTypes = QueryTypesSingle | QueryTypesList; export class Query { - static equal = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "equal", value); + static equal = (attribute: string, value: QueryTypes): string => + Query.addQuery("equal", attribute, value); - static notEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "notEqual", value); + static notEqual = (attribute: string, value: QueryTypes): string => + Query.addQuery("notEqual", attribute, value); - static lesser = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "lesser", value); + static lesser = (attribute: string, value: QueryTypes): string => + Query.addQuery("lesser", attribute, value); - static lesserEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "lesserEqual", value); + static lesserEqual = (attribute: string, value: QueryTypes): string => + Query.addQuery("lesserEqual", attribute, value); - static greater = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "greater", value); + static greater = (attribute: string, value: QueryTypes): string => + Query.addQuery("greater", attribute, value); - static greaterEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "greaterEqual", value); + static greaterEqual = (attribute: string, value: QueryTypes): string => + Query.addQuery("greaterEqual", attribute, value); - static search = (attribute: string, value: string): string => - Query.addQuery(attribute, "search", value); + static search = (attribute: string, value: string): string => + Query.addQuery("search", attribute, value); - private static addQuery = (attribute: string, oper: string, value: QueryTypes): string => - value instanceof Array - ? `${attribute}.${oper}(${value - .map((v: QueryTypesSingle) => Query.parseValues(v)) - .join(",")})` - : `${attribute}.${oper}(${Query.parseValues(value)})`; + static orderDesc = (attribute: string): string => + Query.addQuery("orderDesc", attribute, undefined); - private static parseValues = (value: QueryTypes): string => - typeof value === "string" || value instanceof String - ? `"${value}"` - : `${value}`; -} + static orderAsc = (attribute: string): string => + Query.addQuery("orderAsc", attribute, undefined); + + static cursorAfter = (documentId: string): string => + Query.addQuery("cursorAfter", undefined, documentId); + + static cursorBefore = (documentId: string): string => + Query.addQuery("cursorBefore", undefined, documentId); + + static limit = (value: number): string => + Query.addQuery("limit", undefined, value); + + static offset = (value: number): string => + Query.addQuery("offset", undefined, value); + + private static addQuery = (oper: string, attribute: string | undefined, value: QueryTypes | undefined): string => { + const params: string[] = []; + + if (attribute) { + params.push(`"${attribute}"`); + } + + if (value) { + params.push( + `[${(value instanceof Array ? value : [value]) + .map((v: QueryTypesSingle) => Query.parseValues(v)) + .join(", ")}]` + ); + } + + return `${oper}(${params.join(", ")})`; + } + + private static parseValues = (value: QueryTypes): string => + typeof value === "string" || value instanceof String + ? `"${value}"` + : `${value}`; +} \ No newline at end of file From d1e1aa1392806bf2c7adabcef828a217dbe50858 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 08:08:21 +0000 Subject: [PATCH 320/555] flutter and dart query helper update --- templates/dart/lib/query.dart.twig | 28 +++++++++++++++++++++++++-- templates/flutter/lib/query.dart.twig | 28 +++++++++++++++++++++++++-- tests/languages/dart/tests.dart | 6 ++++++ tests/languages/flutter/tests.dart | 6 ++++++ 4 files changed, 64 insertions(+), 4 deletions(-) diff --git a/templates/dart/lib/query.dart.twig b/templates/dart/lib/query.dart.twig index d1b95e2cdf..24e1f4fdff 100644 --- a/templates/dart/lib/query.dart.twig +++ b/templates/dart/lib/query.dart.twig @@ -24,8 +24,32 @@ class Query { static String _addQuery(String attribute, String oper, dynamic value) => (value is List) - ? '$attribute.$oper(${value.map((item) => parseValues(item)).join(",")})' - : '$attribute.$oper(${parseValues(value)})'; + ? '$oper("$attribute", [${value.map((item) => parseValues(item)).join(",")}])' + : '$oper("$attribute", [${parseValues(value)}])'; + + static String orderAsc(String attribute) { + return 'orderAsc("$attribute")'; + } + + static String orderDesc(String attribute) { + return 'orderDesc("$attribute")'; + } + + static String cursorBefore(String id) { + return 'cursorBefore("$id")'; + } + + static String cursorAfter(String id) { + return 'cursorAfter("$id")'; + } + + static String limit(int limit) { + return 'limit($limit)'; + } + + static String offset(int offset) { + return 'offset($offset)'; + } static String parseValues(dynamic value) => (value is String) ? '"$value"' : '$value'; diff --git a/templates/flutter/lib/query.dart.twig b/templates/flutter/lib/query.dart.twig index d1b95e2cdf..24e1f4fdff 100644 --- a/templates/flutter/lib/query.dart.twig +++ b/templates/flutter/lib/query.dart.twig @@ -24,8 +24,32 @@ class Query { static String _addQuery(String attribute, String oper, dynamic value) => (value is List) - ? '$attribute.$oper(${value.map((item) => parseValues(item)).join(",")})' - : '$attribute.$oper(${parseValues(value)})'; + ? '$oper("$attribute", [${value.map((item) => parseValues(item)).join(",")}])' + : '$oper("$attribute", [${parseValues(value)}])'; + + static String orderAsc(String attribute) { + return 'orderAsc("$attribute")'; + } + + static String orderDesc(String attribute) { + return 'orderDesc("$attribute")'; + } + + static String cursorBefore(String id) { + return 'cursorBefore("$id")'; + } + + static String cursorAfter(String id) { + return 'cursorAfter("$id")'; + } + + static String limit(int limit) { + return 'limit($limit)'; + } + + static String offset(int offset) { + return 'offset($offset)'; + } static String parseValues(dynamic value) => (value is String) ? '"$value"' : '$value'; diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 6abbba2b62..b0c8ec7731 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -94,6 +94,12 @@ void main() async { print(Query.lesser('releasedYear', 1990)); print(Query.greater('releasedYear', [1990, 1999])); print(Query.search('name', 'john')); + print(Query.orderAsc("title")); + print(Query.orderDesc("title")); + print(Query.cursorAfter("my_movie_id")); + print(Query.cursorBefore("my_movie_id")); + print(Query.limit(50)); + print(Query.offset(20)); // Permission & Role helper tests print(Permission.read(Role.any())); diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index 912dd3d434..0e1f2d6ead 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -114,6 +114,12 @@ void main() async { print(Query.lesser('releasedYear', 1990)); print(Query.greater('releasedYear', [1990, 1999])); print(Query.search('name', 'john')); + print(Query.orderAsc("title")); + print(Query.orderDesc("title")); + print(Query.cursorAfter("my_movie_id")); + print(Query.cursorBefore("my_movie_id")); + print(Query.limit(50)); + print(Query.offset(20)); // Permission & Role helper tests print(Permission.read(Role.any())); From 5d15769691e6867657b443043d05d1ef9635af88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 16 Aug 2022 08:09:07 +0000 Subject: [PATCH 321/555] Code cleanup --- templates/deno/src/query.ts.twig | 88 ++++++++++++++++---------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/templates/deno/src/query.ts.twig b/templates/deno/src/query.ts.twig index 8efa663e0b..ef33c3781a 100644 --- a/templates/deno/src/query.ts.twig +++ b/templates/deno/src/query.ts.twig @@ -3,65 +3,65 @@ export type QueryTypesList = string[] | number[] | boolean[]; export type QueryTypes = QueryTypesSingle | QueryTypesList; export class Query { - static equal = (attribute: string, value: QueryTypes): string => - Query.addQuery("equal", attribute, value); + static equal = (attribute: string, value: QueryTypes): string => + Query.addQuery("equal", attribute, value); - static notEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery("notEqual", attribute, value); + static notEqual = (attribute: string, value: QueryTypes): string => + Query.addQuery("notEqual", attribute, value); - static lesser = (attribute: string, value: QueryTypes): string => - Query.addQuery("lesser", attribute, value); + static lesser = (attribute: string, value: QueryTypes): string => + Query.addQuery("lesser", attribute, value); - static lesserEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery("lesserEqual", attribute, value); + static lesserEqual = (attribute: string, value: QueryTypes): string => + Query.addQuery("lesserEqual", attribute, value); - static greater = (attribute: string, value: QueryTypes): string => - Query.addQuery("greater", attribute, value); + static greater = (attribute: string, value: QueryTypes): string => + Query.addQuery("greater", attribute, value); - static greaterEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery("greaterEqual", attribute, value); + static greaterEqual = (attribute: string, value: QueryTypes): string => + Query.addQuery("greaterEqual", attribute, value); - static search = (attribute: string, value: string): string => - Query.addQuery("search", attribute, value); + static search = (attribute: string, value: string): string => + Query.addQuery("search", attribute, value); - static orderDesc = (attribute: string): string => - Query.addQuery("orderDesc", attribute, undefined); + static orderDesc = (attribute: string): string => + Query.addQuery("orderDesc", attribute, undefined); - static orderAsc = (attribute: string): string => - Query.addQuery("orderAsc", attribute, undefined); + static orderAsc = (attribute: string): string => + Query.addQuery("orderAsc", attribute, undefined); - static cursorAfter = (documentId: string): string => - Query.addQuery("cursorAfter", undefined, documentId); + static cursorAfter = (documentId: string): string => + Query.addQuery("cursorAfter", undefined, documentId); - static cursorBefore = (documentId: string): string => - Query.addQuery("cursorBefore", undefined, documentId); + static cursorBefore = (documentId: string): string => + Query.addQuery("cursorBefore", undefined, documentId); - static limit = (value: number): string => - Query.addQuery("limit", undefined, value); + static limit = (value: number): string => + Query.addQuery("limit", undefined, value); - static offset = (value: number): string => - Query.addQuery("offset", undefined, value); + static offset = (value: number): string => + Query.addQuery("offset", undefined, value); - private static addQuery = (oper: string, attribute: string | undefined, value: QueryTypes | undefined): string => { - const params: string[] = []; + private static addQuery = (oper: string, attribute: string | undefined, value: QueryTypes | undefined): string => { + const params: string[] = []; - if (attribute) { - params.push(`"${attribute}"`); - } - - if (value) { - params.push( - `[${(value instanceof Array ? value : [value]) - .map((v: QueryTypesSingle) => Query.parseValues(v)) - .join(", ")}]` - ); - } + if (attribute) { + params.push(`"${attribute}"`); + } - return `${oper}(${params.join(", ")})`; + if (value) { + params.push( + `[${(value instanceof Array ? value : [value]) + .map((v: QueryTypesSingle) => Query.parseValues(v)) + .join(", ")}]` + ); } - private static parseValues = (value: QueryTypes): string => - typeof value === "string" || value instanceof String - ? `"${value}"` - : `${value}`; + return `${oper}(${params.join(", ")})`; + } + + private static parseValues = (value: QueryTypes): string => + typeof value === "string" || value instanceof String + ? `"${value}"` + : `${value}`; } \ No newline at end of file From c3f7bba0a4f0381f360737b298fe5fe503781ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 16 Aug 2022 08:17:11 +0000 Subject: [PATCH 322/555] Simplify after PR review --- templates/deno/src/query.ts.twig | 47 ++++++++++++-------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/templates/deno/src/query.ts.twig b/templates/deno/src/query.ts.twig index ef33c3781a..bb54dcf959 100644 --- a/templates/deno/src/query.ts.twig +++ b/templates/deno/src/query.ts.twig @@ -4,61 +4,50 @@ export type QueryTypes = QueryTypesSingle | QueryTypesList; export class Query { static equal = (attribute: string, value: QueryTypes): string => - Query.addQuery("equal", attribute, value); + Query.addQuery(attribute, "equal", value); static notEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery("notEqual", attribute, value); + Query.addQuery(attribute, "notEqual", value); static lesser = (attribute: string, value: QueryTypes): string => - Query.addQuery("lesser", attribute, value); + Query.addQuery(attribute, "lesser", value); static lesserEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery("lesserEqual", attribute, value); + Query.addQuery(attribute, "lesserEqual", value); static greater = (attribute: string, value: QueryTypes): string => - Query.addQuery("greater", attribute, value); + Query.addQuery(attribute, "greater", value); static greaterEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery("greaterEqual", attribute, value); + Query.addQuery(attribute, "greaterEqual", value); static search = (attribute: string, value: string): string => - Query.addQuery("search", attribute, value); + Query.addQuery(attribute, "search", value); static orderDesc = (attribute: string): string => - Query.addQuery("orderDesc", attribute, undefined); + `orderDesc("${attribute}")`; static orderAsc = (attribute: string): string => - Query.addQuery("orderAsc", attribute, undefined); + `orderAsc("${attribute}")`; static cursorAfter = (documentId: string): string => - Query.addQuery("cursorAfter", undefined, documentId); + `cursorAfter("${documentId}")`; static cursorBefore = (documentId: string): string => - Query.addQuery("cursorBefore", undefined, documentId); + `cursorBefore("${documentId}")`; static limit = (value: number): string => - Query.addQuery("limit", undefined, value); + `limit(${value})`; static offset = (value: number): string => - Query.addQuery("offset", undefined, value); + `offset(${value})`; - private static addQuery = (oper: string, attribute: string | undefined, value: QueryTypes | undefined): string => { - const params: string[] = []; - - if (attribute) { - params.push(`"${attribute}"`); - } - - if (value) { - params.push( - `[${(value instanceof Array ? value : [value]) + private static addQuery = (attribute: string, method: string, value: QueryTypes): string => + value instanceof Array + ? `${method}("${attribute}", [${value .map((v: QueryTypesSingle) => Query.parseValues(v)) - .join(", ")}]` - ); - } - - return `${oper}(${params.join(", ")})`; - } + .join(",")}])` + : `${method}("${attribute}", [${Query.parseValues(value)}])`; private static parseValues = (value: QueryTypes): string => typeof value === "string" || value instanceof String From 241727161b1c82327308fb87ced4d070f1ef1b08 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 08:09:04 +0000 Subject: [PATCH 323/555] swift client tests update --- tests/languages/swift-client/Tests.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/swift-client/Tests.swift index 928140cf10..6a1333205f 100644 --- a/tests/languages/swift-client/Tests.swift +++ b/tests/languages/swift-client/Tests.swift @@ -149,6 +149,12 @@ class Tests: XCTestCase { print(Query.lesser("releasedYear", value: 1990)); print(Query.greater("releasedYear", value: [1990, 1999])); print(Query.search("name", value: "john")); + print(Query.orderAsc("title")); + print(Query.orderDesc("title")); + print(Query.cursorAfter("my_movie_id")); + print(Query.cursorBefore("my_movie_id")); + print(Query.limit(50)); + print(Query.offset(20)); // Permission & Role helper tests print(Permission.read(Role.any())); From 262eb3eecf115ea82ddc924d24e538e0ee3c89d3 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 08:22:59 +0000 Subject: [PATCH 324/555] kotlin and android query helper update --- .../src/main/java/io/appwrite/Query.kt.twig | 16 ++++++++++++++-- .../src/main/kotlin/io/appwrite/Query.kt.twig | 18 +++++++++++++++--- tests/languages/android/Tests.kt | 6 ++++++ tests/languages/kotlin/Tests.kt | 6 ++++++ 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Query.kt.twig b/templates/android/library/src/main/java/io/appwrite/Query.kt.twig index 7783dff78b..2342a73a98 100644 --- a/templates/android/library/src/main/java/io/appwrite/Query.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Query.kt.twig @@ -16,10 +16,22 @@ class Query { fun search(attribute: String, value: String) = Query.addQuery(attribute, "search", value) + fun orderAsc(attribute: String) = "orderAsc(\"${attribute}\")" + + fun orderDesc(attribute: String) = "orderDesc(\"${attribute}\")" + + fun cursorBefore(attribute: String) = "cursorBefore(\"${attribute}\")" + + fun cursorAfter(attribute: String) = "cursorAfter(\"${attribute}\")" + + fun limit(limit: Int) = "cursorAfter(${limit})" + + fun offset(offset: Int) = "cursorAfter(${offset})" + private fun addQuery(attribute: String, oper: String, value: Any): String { return when (value) { - is List<*> -> "${attribute}.${oper}(${value.map{it -> parseValues(it!!)}.joinToString(",")})" - else -> "${attribute}.${oper}(${Query.parseValues(value)})" + is List<*> -> "${oper}(\"${attribute}\", [${value.map{it -> parseValues(it!!)}.joinToString(",")}])" + else -> "${oper}(\"${attribute}\", [${Query.parseValues(value)}])" } } private fun parseValues(value: Any): String { diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig index 9a0c2f3bb1..2342a73a98 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig @@ -13,13 +13,25 @@ class Query { fun greater(attribute: String, value: Any) = Query.addQuery(attribute, "greater", value) fun greaterEqual(attribute: String, value: Any) = Query.addQuery(attribute, "greaterEqual", value) - + fun search(attribute: String, value: String) = Query.addQuery(attribute, "search", value) + fun orderAsc(attribute: String) = "orderAsc(\"${attribute}\")" + + fun orderDesc(attribute: String) = "orderDesc(\"${attribute}\")" + + fun cursorBefore(attribute: String) = "cursorBefore(\"${attribute}\")" + + fun cursorAfter(attribute: String) = "cursorAfter(\"${attribute}\")" + + fun limit(limit: Int) = "cursorAfter(${limit})" + + fun offset(offset: Int) = "cursorAfter(${offset})" + private fun addQuery(attribute: String, oper: String, value: Any): String { return when (value) { - is List<*> -> "${attribute}.${oper}(${value.map{it -> parseValues(it!!)}.joinToString(",")})" - else -> "${attribute}.${oper}(${Query.parseValues(value)})" + is List<*> -> "${oper}(\"${attribute}\", [${value.map{it -> parseValues(it!!)}.joinToString(",")}])" + else -> "${oper}(\"${attribute}\", [${Query.parseValues(value)}])" } } private fun parseValues(value: Any): String { diff --git a/tests/languages/android/Tests.kt b/tests/languages/android/Tests.kt index c752582329..f63551e4df 100644 --- a/tests/languages/android/Tests.kt +++ b/tests/languages/android/Tests.kt @@ -166,6 +166,12 @@ class ServiceTest { writeToFile(Query.lesser("releasedYear", 1990)); writeToFile(Query.greater("releasedYear", listOf(1990, 1999))); writeToFile(Query.search("name", "john")); + writeToFile(Query.orderAsc("title")); + writeToFile(Query.orderDesc("title")); + writeToFile(Query.cursorAfter("my_movie_id")); + writeToFile(Query.cursorBefore("my_movie_id")); + writeToFile(Query.limit(50)); + writeToFile(Query.offset(20)); // Permission & Roles helper tests writeToFile(Permission.read(Role.any())); diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt index 1bdab2805a..6eb74f5275 100644 --- a/tests/languages/kotlin/Tests.kt +++ b/tests/languages/kotlin/Tests.kt @@ -126,6 +126,12 @@ class ServiceTest { writeToFile(Query.lesser("releasedYear", 1990)); writeToFile(Query.greater("releasedYear", listOf(1990, 1999))); writeToFile(Query.search("name", "john")); + writeToFile(Query.orderAsc("title")); + writeToFile(Query.orderDesc("title")); + writeToFile(Query.cursorAfter("my_movie_id")); + writeToFile(Query.cursorBefore("my_movie_id")); + writeToFile(Query.limit(50)); + writeToFile(Query.offset(20)); // Permission & Roles helper tests writeToFile(Permission.read(Role.any())); From 8a839cee4d8c267f78657d757f09b824740074f3 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 08:23:54 +0000 Subject: [PATCH 325/555] update --- templates/ruby/lib/container/query.rb.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/ruby/lib/container/query.rb.twig b/templates/ruby/lib/container/query.rb.twig index 8a3e6736c4..dbad9ceacd 100644 --- a/templates/ruby/lib/container/query.rb.twig +++ b/templates/ruby/lib/container/query.rb.twig @@ -28,9 +28,9 @@ module {{spec.title | caseUcfirst}} def addQuery(attribute, oper, value) if value.is_a?(Array) - "#{attribute}.#{oper}(#{value.map {|item| parseValues(item)}.join(',')})" + "#{oper}(\"#{attribute}\", [#{value.map {|item| parseValues(item)}.join(',')}])" else - return "#{attribute}.#{oper}(#{parseValues(value)})" + return "#{oper}(\"#{attribute}\",[#{parseValues(value)}])" end end From 8b50e992ab21218d19573ddf36c0bb429dd5da19 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 08:30:40 +0000 Subject: [PATCH 326/555] fix kotlin --- .../src/main/java/io/appwrite/Query.kt.twig | 4 +- .../src/main/kotlin/io/appwrite/Query.kt.twig | 4 +- tests/languages/android/Tests.kt | 38 +++++++++---------- tests/languages/kotlin/Tests.kt | 38 +++++++++---------- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Query.kt.twig b/templates/android/library/src/main/java/io/appwrite/Query.kt.twig index 2342a73a98..948fb4e6eb 100644 --- a/templates/android/library/src/main/java/io/appwrite/Query.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Query.kt.twig @@ -24,9 +24,9 @@ class Query { fun cursorAfter(attribute: String) = "cursorAfter(\"${attribute}\")" - fun limit(limit: Int) = "cursorAfter(${limit})" + fun limit(limit: Int) = "limit(${limit})" - fun offset(offset: Int) = "cursorAfter(${offset})" + fun offset(offset: Int) = "offset(${offset})" private fun addQuery(attribute: String, oper: String, value: Any): String { return when (value) { diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig index 2342a73a98..948fb4e6eb 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig @@ -24,9 +24,9 @@ class Query { fun cursorAfter(attribute: String) = "cursorAfter(\"${attribute}\")" - fun limit(limit: Int) = "cursorAfter(${limit})" + fun limit(limit: Int) = "limit(${limit})" - fun offset(offset: Int) = "cursorAfter(${offset})" + fun offset(offset: Int) = "offset(${offset})" private fun addQuery(attribute: String, oper: String, value: Any): String { return when (value) { diff --git a/tests/languages/android/Tests.kt b/tests/languages/android/Tests.kt index f63551e4df..9385c21991 100644 --- a/tests/languages/android/Tests.kt +++ b/tests/languages/android/Tests.kt @@ -161,29 +161,29 @@ class ServiceTest { general.empty() // Query helper tests - writeToFile(Query.equal("title", listOf("Spiderman", "Dr. Strange"))); - writeToFile(Query.notEqual("title", "Spiderman")); - writeToFile(Query.lesser("releasedYear", 1990)); - writeToFile(Query.greater("releasedYear", listOf(1990, 1999))); - writeToFile(Query.search("name", "john")); - writeToFile(Query.orderAsc("title")); - writeToFile(Query.orderDesc("title")); - writeToFile(Query.cursorAfter("my_movie_id")); - writeToFile(Query.cursorBefore("my_movie_id")); - writeToFile(Query.limit(50)); - writeToFile(Query.offset(20)); + writeToFile(Query.equal("title", listOf("Spiderman", "Dr. Strange"))) + writeToFile(Query.notEqual("title", "Spiderman")) + writeToFile(Query.lesser("releasedYear", 1990)) + writeToFile(Query.greater("releasedYear", listOf(1990, 1999))) + writeToFile(Query.search("name", "john")) + writeToFile(Query.orderAsc("title")) + writeToFile(Query.orderDesc("title")) + writeToFile(Query.cursorAfter("my_movie_id")) + writeToFile(Query.cursorBefore("my_movie_id")) + writeToFile(Query.limit(50)) + writeToFile(Query.offset(20)) // Permission & Roles helper tests - writeToFile(Permission.read(Role.any())); - writeToFile(Permission.write(Role.user(ID.custom("userid")))); - writeToFile(Permission.create(Role.users())); - writeToFile(Permission.update(Role.guests())); - writeToFile(Permission.delete(Role.team("teamId", "owner"))); - writeToFile(Permission.delete(Role.team("teamId"))); + writeToFile(Permission.read(Role.any())) + writeToFile(Permission.write(Role.user(ID.custom("userid")))) + writeToFile(Permission.create(Role.users())) + writeToFile(Permission.update(Role.guests())) + writeToFile(Permission.delete(Role.team("teamId", "owner"))) + writeToFile(Permission.delete(Role.team("teamId"))) // ID helper tests - writeToFile(ID.unique()); - writeToFile(ID.custom("custom_id")); + writeToFile(ID.unique()) + writeToFile(ID.custom("custom_id")) } } diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt index 6eb74f5275..575ec7288a 100644 --- a/tests/languages/kotlin/Tests.kt +++ b/tests/languages/kotlin/Tests.kt @@ -121,29 +121,29 @@ class ServiceTest { general.empty() // Query helper tests - writeToFile(Query.equal("title", listOf("Spiderman", "Dr. Strange"))); - writeToFile(Query.notEqual("title", "Spiderman")); - writeToFile(Query.lesser("releasedYear", 1990)); - writeToFile(Query.greater("releasedYear", listOf(1990, 1999))); - writeToFile(Query.search("name", "john")); - writeToFile(Query.orderAsc("title")); - writeToFile(Query.orderDesc("title")); - writeToFile(Query.cursorAfter("my_movie_id")); - writeToFile(Query.cursorBefore("my_movie_id")); - writeToFile(Query.limit(50)); - writeToFile(Query.offset(20)); + writeToFile(Query.equal("title", listOf("Spiderman", "Dr. Strange"))) + writeToFile(Query.notEqual("title", "Spiderman")) + writeToFile(Query.lesser("releasedYear", 1990)) + writeToFile(Query.greater("releasedYear", listOf(1990, 1999))) + writeToFile(Query.search("name", "john")) + writeToFile(Query.orderAsc("title")) + writeToFile(Query.orderDesc("title")) + writeToFile(Query.cursorAfter("my_movie_id")) + writeToFile(Query.cursorBefore("my_movie_id")) + writeToFile(Query.limit(50)) + writeToFile(Query.offset(20)) // Permission & Roles helper tests - writeToFile(Permission.read(Role.any())); - writeToFile(Permission.write(Role.user(ID.custom("userid")))); - writeToFile(Permission.create(Role.users())); - writeToFile(Permission.update(Role.guests())); - writeToFile(Permission.delete(Role.team("teamId", "owner"))); - writeToFile(Permission.delete(Role.team("teamId"))); + writeToFile(Permission.read(Role.any())) + writeToFile(Permission.write(Role.user(ID.custom("userid")))) + writeToFile(Permission.create(Role.users())) + writeToFile(Permission.update(Role.guests())) + writeToFile(Permission.delete(Role.team("teamId", "owner"))) + writeToFile(Permission.delete(Role.team("teamId"))) // ID helper tests - writeToFile(ID.unique()); - writeToFile(ID.custom("custom_id")); + writeToFile(ID.unique()) + writeToFile(ID.custom("custom_id")) } } From 6cc2f8237de5588626e08fe193bfaed6f6aa4840 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 08:36:11 +0000 Subject: [PATCH 327/555] ruby query helper update --- templates/ruby/lib/container/query.rb.twig | 28 ++++++++++++++++++++-- tests/languages/ruby/tests.rb | 6 +++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/templates/ruby/lib/container/query.rb.twig b/templates/ruby/lib/container/query.rb.twig index dbad9ceacd..0284219986 100644 --- a/templates/ruby/lib/container/query.rb.twig +++ b/templates/ruby/lib/container/query.rb.twig @@ -24,13 +24,37 @@ module {{spec.title | caseUcfirst}} return addQuery(attribute, "search", value) end + def orderAsc(attribute) + return "orderAsc(\"#{attribute}\")" + end + + def orderDesc(attribute) + return "orderDesc(\"#{attribute}\")" + end + + def cursorBefore(id) + return "cursorBefore(\"#{id}\")" + end + + def cursorAfter(id) + return "cursorAfter(\"#{id}\")" + end + + def limit(limit) + return "limit(#{limit})" + end + + def offset(offset) + return "offset(#{offset})" + end + private def addQuery(attribute, oper, value) if value.is_a?(Array) "#{oper}(\"#{attribute}\", [#{value.map {|item| parseValues(item)}.join(',')}])" else - return "#{oper}(\"#{attribute}\",[#{parseValues(value)}])" + return "#{oper}(\"#{attribute}\", [#{parseValues(value)}])" end end @@ -39,4 +63,4 @@ module {{spec.title | caseUcfirst}} end end end -end +end \ No newline at end of file diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index a1658b08af..499ccaeddc 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -110,6 +110,12 @@ puts query.lesser('releasedYear', 1990) puts query.greater('releasedYear', [1990, 1999]) puts query.search('name', 'john') +puts query.orderAsc("title") +puts query.orderDesc("title") +puts query.cursorAfter("my_movie_id") +puts query.cursorBefore("my_movie_id") +puts query.limit(50) +puts query.offset(20) # Permission & Role helper tests puts permission.read(role.any()) From d4b84115f10e218f04a67e38f279826e31c90dbb Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 08:46:21 +0000 Subject: [PATCH 328/555] web node and deno query helper updates --- templates/node/lib/query.js.twig | 26 ++++++++++++++++--- templates/web/src/query.ts.twig | 43 ++++++++++++++++++++++---------- tests/languages/deno/tests.ts | 6 +++++ tests/languages/node/test.js | 6 +++++ tests/languages/web/index.html | 6 +++++ tests/languages/web/node.js | 6 +++++ 6 files changed, 76 insertions(+), 17 deletions(-) diff --git a/templates/node/lib/query.js.twig b/templates/node/lib/query.js.twig index 1014131774..fe157a24d5 100644 --- a/templates/node/lib/query.js.twig +++ b/templates/node/lib/query.js.twig @@ -20,12 +20,30 @@ class Query { static search = (attribute, value) => Query.addQuery(attribute, "search", value); - static addQuery = (attribute, oper, value) => + static orderDesc = (attribute) => + `orderDesc("${attribute}")`; + + static orderAsc = (attribute) => + `orderAsc("${attribute}")`; + + static cursorAfter = (documentId) => + `cursorAfter("${documentId}")`; + + static cursorBefore = (documentId) => + `cursorBefore("${documentId}")`; + + static limit = (value) => + `limit(${value})`; + + static offset = (value) => + `offset(${value})`; + + static addQuery = (attribute, method, value) => value instanceof Array - ? `${attribute}.${oper}(${value + ? `${method}("${attribute}", [${value .map((v) => Query.parseValues(v)) - .join(",")})` - : `${attribute}.${oper}(${Query.parseValues(value)})`; + .join(",")}])` + : `${method}("${attribute}", [${Query.parseValues(value)}])`; static parseValues = (value) => typeof value === "string" || value instanceof String diff --git a/templates/web/src/query.ts.twig b/templates/web/src/query.ts.twig index 03ad93ef0b..bb54dcf959 100644 --- a/templates/web/src/query.ts.twig +++ b/templates/web/src/query.ts.twig @@ -2,38 +2,55 @@ type QueryTypesSingle = string | number | boolean; export type QueryTypesList = string[] | number[] | boolean[]; export type QueryTypes = QueryTypesSingle | QueryTypesList; - export class Query { static equal = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, 'equal', value); + Query.addQuery(attribute, "equal", value); static notEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, 'notEqual', value); + Query.addQuery(attribute, "notEqual", value); static lesser = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, 'lesser', value); + Query.addQuery(attribute, "lesser", value); static lesserEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, 'lesserEqual', value); + Query.addQuery(attribute, "lesserEqual", value); static greater = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, 'greater', value); + Query.addQuery(attribute, "greater", value); static greaterEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, 'greaterEqual', value); + Query.addQuery(attribute, "greaterEqual", value); static search = (attribute: string, value: string): string => - Query.addQuery(attribute, 'search', value); + Query.addQuery(attribute, "search", value); + + static orderDesc = (attribute: string): string => + `orderDesc("${attribute}")`; + + static orderAsc = (attribute: string): string => + `orderAsc("${attribute}")`; + + static cursorAfter = (documentId: string): string => + `cursorAfter("${documentId}")`; + + static cursorBefore = (documentId: string): string => + `cursorBefore("${documentId}")`; + + static limit = (value: number): string => + `limit(${value})`; + + static offset = (value: number): string => + `offset(${value})`; - private static addQuery = (attribute: string, oper: string, value: QueryTypes): string => + private static addQuery = (attribute: string, method: string, value: QueryTypes): string => value instanceof Array - ? `${attribute}.${oper}(${value + ? `${method}("${attribute}", [${value .map((v: QueryTypesSingle) => Query.parseValues(v)) - .join(',')})` - : `${attribute}.${oper}(${Query.parseValues(value)})`; + .join(",")}])` + : `${method}("${attribute}", [${Query.parseValues(value)}])`; private static parseValues = (value: QueryTypes): string => - typeof value === 'string' || value instanceof String + typeof value === "string" || value instanceof String ? `"${value}"` : `${value}`; } \ No newline at end of file diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts index 29a2e4151c..62976f5ed5 100644 --- a/tests/languages/deno/tests.ts +++ b/tests/languages/deno/tests.ts @@ -103,6 +103,12 @@ async function start() { console.log(Query.lesser('releasedYear', 1990)); console.log(Query.greater('releasedYear', [1990, 1999])); console.log(Query.search('name', "john")); + console.log(Query.orderAsc("title")); + console.log(Query.orderDesc("title")); + console.log(Query.cursorAfter("my_movie_id")); + console.log(Query.cursorBefore("my_movie_id")); + console.log(Query.limit(50)); + console.log(Query.offset(20)); // Permission & Role helper tests console.log(Permission.read(Role.any())); diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index 4737733fc4..8304885f2b 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -91,6 +91,12 @@ async function start() { console.log(Query.lesser('releasedYear', 1990)); console.log(Query.greater('releasedYear', [1990, 1999])); console.log(Query.search('name', "john")); + console.log(Query.orderAsc("title")); + console.log(Query.orderDesc("title")); + console.log(Query.cursorAfter("my_movie_id")); + console.log(Query.cursorBefore("my_movie_id")); + console.log(Query.limit(50)); + console.log(Query.offset(20)); // Permission & Role helper tests console.log(Permission.read(Role.any())); diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index 80ec42b813..68112d1b13 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -118,6 +118,12 @@ console.log(Query.lesser('releasedYear', 1990)); console.log(Query.greater('releasedYear', [1990, 1999])); console.log(Query.search('name', "john")); + console.log(Query.orderAsc("title")); + console.log(Query.orderDesc("title")); + console.log(Query.cursorAfter("my_movie_id")); + console.log(Query.cursorBefore("my_movie_id")); + console.log(Query.limit(50)); + console.log(Query.offset(20)); // Permission & Role helper tests console.log(Permission.read(Role.any())); diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js index ea0c952120..c490bdbd18 100644 --- a/tests/languages/web/node.js +++ b/tests/languages/web/node.js @@ -76,6 +76,12 @@ async function start() { console.log(Query.lesser('releasedYear', 1990)); console.log(Query.greater('releasedYear', [1990, 1999])); console.log(Query.search('name', "john")); + console.log(Query.orderAsc("title")); + console.log(Query.orderDesc("title")); + console.log(Query.cursorAfter("my_movie_id")); + console.log(Query.cursorBefore("my_movie_id")); + console.log(Query.limit(50)); + console.log(Query.offset(20)); // Permission & Role helper tests console.log(Permission.read(Role.any())); From a48ceda472112ce4310297e43c6207c8dcb952d4 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 08:54:51 +0000 Subject: [PATCH 329/555] python query helper update --- templates/python/package/query.py.twig | 28 ++++++++++++++++++++-- tests/languages/python/tests.py | 32 +++++++++++++++----------- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/templates/python/package/query.py.twig b/templates/python/package/query.py.twig index f19e2f054f..0de1f74324 100644 --- a/templates/python/package/query.py.twig +++ b/templates/python/package/query.py.twig @@ -27,12 +27,36 @@ class Query: def search(attribute, value): return Query.addQuery(attribute, "search", value) + @staticmethod + def orderAsc(attribute): + return 'orderAsc("{}")'.format(attribute) + + @staticmethod + def orderDesc(attribute): + return 'orderDesc("{}")'.format(attribute) + + @staticmethod + def cursorBefore(id): + return 'cursorBefore("{}")'.format(id) + + @staticmethod + def cursorAfter(id): + return 'cursorAfter("{}")'.format(id) + + @staticmethod + def limit(limit): + return 'limit({})'.format(limit) + + @staticmethod + def offset(offset): + return 'offset({})'.format(offset) + @staticmethod def addQuery(attribute, oper, value): if type(value) == list: - return '{}.{}({})'.format(attribute,oper, ','.join(map(Query.parseValues, value))) + return '{}("{}", [{}])'.format(oper, attribute, ','.join(map(Query.parseValues, value))) else: - return '{}.{}({})'.format(attribute,oper, Query.parseValues(value)) + return '{}("{}", [{}])'.format(oper, attribute, Query.parseValues(value)) @staticmethod def parseValues(value): diff --git a/tests/languages/python/tests.py b/tests/languages/python/tests.py index 56d11e9d09..81deb9b55f 100644 --- a/tests/languages/python/tests.py +++ b/tests/languages/python/tests.py @@ -93,20 +93,26 @@ general.empty() # Query helper tests -print(Query.equal('title', ['Spiderman', 'Dr. Strange'])); -print(Query.notEqual('title', 'Spiderman')); -print(Query.lesser('releasedYear', 1990)); -print(Query.greater('releasedYear', [1990, 1999])); -print(Query.search('name', 'john')); +print(Query.equal('title', ['Spiderman', 'Dr. Strange'])) +print(Query.notEqual('title', 'Spiderman')) +print(Query.lesser('releasedYear', 1990)) +print(Query.greater('releasedYear', [1990, 1999])) +print(Query.search('name', 'john')) +print(Query.orderAsc("title")) +print(Query.orderDesc("title")) +print(Query.cursorAfter("my_movie_id")) +print(Query.cursorBefore("my_movie_id")) +print(Query.limit(50)) +print(Query.offset(20)) # Permission & Role helper tests -print(Permission.read(Role.any())); -print(Permission.write(Role.user(ID.custom('userid')))); -print(Permission.create(Role.users())); -print(Permission.update(Role.guests())); -print(Permission.delete(Role.team('teamId', 'owner'))); -print(Permission.delete(Role.team('teamId'))); +print(Permission.read(Role.any())) +print(Permission.write(Role.user(ID.custom('userid')))) +print(Permission.create(Role.users())) +print(Permission.update(Role.guests())) +print(Permission.delete(Role.team('teamId', 'owner'))) +print(Permission.delete(Role.team('teamId'))) # ID helper tests -print(ID.unique()); -print(ID.custom('custom_id')); \ No newline at end of file +print(ID.unique()) +print(ID.custom('custom_id')) \ No newline at end of file From bcbc2b40837731b3f21426dcf0251ddec0c77ea9 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 09:06:57 +0000 Subject: [PATCH 330/555] PHP query helper update --- templates/php/src/Query.php.twig | 62 +++++++++++++++++++++++++++++++- tests/languages/php/test.php | 6 ++++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/templates/php/src/Query.php.twig b/templates/php/src/Query.php.twig index 8825ac4eae..828a770212 100644 --- a/templates/php/src/Query.php.twig +++ b/templates/php/src/Query.php.twig @@ -88,6 +88,66 @@ class Query return self::addQuery($attribute, 'search', $value); } + /** + * Cursor After + * + * @param String $attribute + * @return string + */ + public static function cursorAfter(String $attribute): string { + return 'cursorAfter("' . $attribute . '")'; + } + + /** + * Cursor Before + * + * @param String $attribute + * @return string + */ + public static function cursorBefore(String $attribute): string { + return 'cursorBefore("' . $attribute . '")'; + } + + /** + * Order Asc + * + * @param String $id + * @return string + */ + public static function orderAsc(String $id): string { + return 'orderAsc("' . $id . '")'; + } + + /** + * Order Desc + * + * @param String $id + * @return string + */ + public static function orderDesc(String $id): string { + return 'orderDesc("' . $id . '")'; + } + + /** + * Limit + * + * @param int $limit + * @return string + */ + public static function limit(int $limit): string { + return 'limit(' . $limit . ')'; + } + + /** + * Offset + * + * @param int $offset + * @return string + */ + public static function offset(int $offset): string { + return 'offset(' . $offset . ')'; + } + /** * Add Query * @@ -98,7 +158,7 @@ class Query */ private static function addQuery(string $attribute, string $oper, $value) { - return is_array($value) ? $attribute . '.' . $oper . '(' . implode(",", array_map(function ($item) {return self::parseValues($item);}, $value)) . ')' : $attribute . '.' . $oper . '(' . self::parseValues($value) . ')'; + return is_array($value) ? $oper . '("' . $attribute . '", [' . implode(",", array_map(function ($item) {return self::parseValues($item);}, $value)) . '])' : $oper . '("' . $attribute . '", [' . self::parseValues($value) . '])'; } /** diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index 2c1dbcab41..b13b3f35e8 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -109,6 +109,12 @@ echo Query::lesser('releasedYear', 1990) . "\n"; echo Query::greater('releasedYear', [1990, 1999]) . "\n"; echo Query::search('name', "john") . "\n"; +echo Query::orderAsc("title") . "\n"; +echo Query::orderDesc("title") . "\n"; +echo Query::cursorAfter("my_movie_id") . "\n"; +echo Query::cursorBefore("my_movie_id") . "\n"; +echo Query::limit(50) . "\n"; +echo Query::offset(20) . "\n"; // Permission & Role helper tests echo Permission::read(Role::any()) . "\n"; From 7b72df6ab0a25b5bf1e13c5241ad8e66bbdae4df Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 15:13:45 +0545 Subject: [PATCH 331/555] Update templates/python/package/query.py.twig Co-authored-by: Jake Barnby --- templates/python/package/query.py.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/python/package/query.py.twig b/templates/python/package/query.py.twig index 0de1f74324..87386529f9 100644 --- a/templates/python/package/query.py.twig +++ b/templates/python/package/query.py.twig @@ -29,7 +29,7 @@ class Query: @staticmethod def orderAsc(attribute): - return 'orderAsc("{}")'.format(attribute) + return f'orderAsc("{attribute}")' @staticmethod def orderDesc(attribute): From 43513ca14b20c4bdfdfa3afd2aecccf279ebec52 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 09:08:42 +0000 Subject: [PATCH 332/555] rename operator to method to make it consistent with server implementation --- .../android/library/src/main/java/io/appwrite/Query.kt.twig | 6 +++--- templates/dart/lib/query.dart.twig | 6 +++--- templates/flutter/lib/query.dart.twig | 6 +++--- templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig | 6 +++--- templates/php/src/Query.php.twig | 6 +++--- templates/python/package/query.py.twig | 6 +++--- templates/ruby/lib/container/query.rb.twig | 6 +++--- templates/swift/Sources/Query.swift.twig | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Query.kt.twig b/templates/android/library/src/main/java/io/appwrite/Query.kt.twig index 948fb4e6eb..9f0c38594c 100644 --- a/templates/android/library/src/main/java/io/appwrite/Query.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Query.kt.twig @@ -28,10 +28,10 @@ class Query { fun offset(offset: Int) = "offset(${offset})" - private fun addQuery(attribute: String, oper: String, value: Any): String { + private fun addQuery(attribute: String, method: String, value: Any): String { return when (value) { - is List<*> -> "${oper}(\"${attribute}\", [${value.map{it -> parseValues(it!!)}.joinToString(",")}])" - else -> "${oper}(\"${attribute}\", [${Query.parseValues(value)}])" + is List<*> -> "${method}(\"${attribute}\", [${value.map{it -> parseValues(it!!)}.joinToString(",")}])" + else -> "${method}(\"${attribute}\", [${Query.parseValues(value)}])" } } private fun parseValues(value: Any): String { diff --git a/templates/dart/lib/query.dart.twig b/templates/dart/lib/query.dart.twig index 24e1f4fdff..7b8c0b1da8 100644 --- a/templates/dart/lib/query.dart.twig +++ b/templates/dart/lib/query.dart.twig @@ -22,10 +22,10 @@ class Query { static search(String attribute, String value) => _addQuery(attribute, 'search', value); - static String _addQuery(String attribute, String oper, dynamic value) => (value + static String _addQuery(String attribute, String method, dynamic value) => (value is List) - ? '$oper("$attribute", [${value.map((item) => parseValues(item)).join(",")}])' - : '$oper("$attribute", [${parseValues(value)}])'; + ? '$method("$attribute", [${value.map((item) => parseValues(item)).join(",")}])' + : '$method("$attribute", [${parseValues(value)}])'; static String orderAsc(String attribute) { return 'orderAsc("$attribute")'; diff --git a/templates/flutter/lib/query.dart.twig b/templates/flutter/lib/query.dart.twig index 24e1f4fdff..7b8c0b1da8 100644 --- a/templates/flutter/lib/query.dart.twig +++ b/templates/flutter/lib/query.dart.twig @@ -22,10 +22,10 @@ class Query { static search(String attribute, String value) => _addQuery(attribute, 'search', value); - static String _addQuery(String attribute, String oper, dynamic value) => (value + static String _addQuery(String attribute, String method, dynamic value) => (value is List) - ? '$oper("$attribute", [${value.map((item) => parseValues(item)).join(",")}])' - : '$oper("$attribute", [${parseValues(value)}])'; + ? '$method("$attribute", [${value.map((item) => parseValues(item)).join(",")}])' + : '$method("$attribute", [${parseValues(value)}])'; static String orderAsc(String attribute) { return 'orderAsc("$attribute")'; diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig index 948fb4e6eb..9f0c38594c 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig @@ -28,10 +28,10 @@ class Query { fun offset(offset: Int) = "offset(${offset})" - private fun addQuery(attribute: String, oper: String, value: Any): String { + private fun addQuery(attribute: String, method: String, value: Any): String { return when (value) { - is List<*> -> "${oper}(\"${attribute}\", [${value.map{it -> parseValues(it!!)}.joinToString(",")}])" - else -> "${oper}(\"${attribute}\", [${Query.parseValues(value)}])" + is List<*> -> "${method}(\"${attribute}\", [${value.map{it -> parseValues(it!!)}.joinToString(",")}])" + else -> "${method}(\"${attribute}\", [${Query.parseValues(value)}])" } } private fun parseValues(value: Any): String { diff --git a/templates/php/src/Query.php.twig b/templates/php/src/Query.php.twig index 828a770212..0232cb31a2 100644 --- a/templates/php/src/Query.php.twig +++ b/templates/php/src/Query.php.twig @@ -152,13 +152,13 @@ class Query * Add Query * * @param string $attribute - * @param string $operator + * @param string $method * @param mixed $value * @return string */ - private static function addQuery(string $attribute, string $oper, $value) + private static function addQuery(string $attribute, string $method, $value) { - return is_array($value) ? $oper . '("' . $attribute . '", [' . implode(",", array_map(function ($item) {return self::parseValues($item);}, $value)) . '])' : $oper . '("' . $attribute . '", [' . self::parseValues($value) . '])'; + return is_array($value) ? $method . '("' . $attribute . '", [' . implode(",", array_map(function ($item) {return self::parseValues($item);}, $value)) . '])' : $method . '("' . $attribute . '", [' . self::parseValues($value) . '])'; } /** diff --git a/templates/python/package/query.py.twig b/templates/python/package/query.py.twig index 87386529f9..87151cdfc4 100644 --- a/templates/python/package/query.py.twig +++ b/templates/python/package/query.py.twig @@ -52,11 +52,11 @@ class Query: return 'offset({})'.format(offset) @staticmethod - def addQuery(attribute, oper, value): + def addQuery(attribute, method, value): if type(value) == list: - return '{}("{}", [{}])'.format(oper, attribute, ','.join(map(Query.parseValues, value))) + return '{}("{}", [{}])'.format(method, attribute, ','.join(map(Query.parseValues, value))) else: - return '{}("{}", [{}])'.format(oper, attribute, Query.parseValues(value)) + return '{}("{}", [{}])'.format(method, attribute, Query.parseValues(value)) @staticmethod def parseValues(value): diff --git a/templates/ruby/lib/container/query.rb.twig b/templates/ruby/lib/container/query.rb.twig index 0284219986..b8c5a9a9fa 100644 --- a/templates/ruby/lib/container/query.rb.twig +++ b/templates/ruby/lib/container/query.rb.twig @@ -50,11 +50,11 @@ module {{spec.title | caseUcfirst}} private - def addQuery(attribute, oper, value) + def addQuery(attribute, method, value) if value.is_a?(Array) - "#{oper}(\"#{attribute}\", [#{value.map {|item| parseValues(item)}.join(',')}])" + "#{method}(\"#{attribute}\", [#{value.map {|item| parseValues(item)}.join(',')}])" else - return "#{oper}(\"#{attribute}\", [#{parseValues(value)}])" + return "#{method}(\"#{attribute}\", [#{parseValues(value)}])" end end diff --git a/templates/swift/Sources/Query.swift.twig b/templates/swift/Sources/Query.swift.twig index 5fda6b5199..34ab7d4376 100644 --- a/templates/swift/Sources/Query.swift.twig +++ b/templates/swift/Sources/Query.swift.twig @@ -28,12 +28,12 @@ public class Query { buildQueryWhere(attribute, is: "search", to: value) } - public static func buildQueryWhere(_ attribute: String, is oper: String, to value: Any) -> String { + public static func buildQueryWhere(_ attribute: String, is method: String, to value: Any) -> String { switch value { case let value as Array: - return "\(oper)(\"\(attribute)\", [\(value.map { parseValues($0) }.joined(separator: ",") )])" + return "\(method)(\"\(attribute)\", [\(value.map { parseValues($0) }.joined(separator: ",") )])" default: - return "\(oper)(\"\(attribute)\", [\(parseValues(value))])" + return "\(method)(\"\(attribute)\", [\(parseValues(value))])" } } From ec8b264d611a203ec8d89fc73e0708e8a4967075 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Aug 2022 09:55:15 +0000 Subject: [PATCH 333/555] using newer string interpolation --- templates/python/package/query.py.twig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/python/package/query.py.twig b/templates/python/package/query.py.twig index 87151cdfc4..7e940827b4 100644 --- a/templates/python/package/query.py.twig +++ b/templates/python/package/query.py.twig @@ -33,34 +33,34 @@ class Query: @staticmethod def orderDesc(attribute): - return 'orderDesc("{}")'.format(attribute) + return f'orderDesc("{attribute}")' @staticmethod def cursorBefore(id): - return 'cursorBefore("{}")'.format(id) + return f'cursorBefore("{id}")' @staticmethod def cursorAfter(id): - return 'cursorAfter("{}")'.format(id) + return f'cursorAfter("{id}")' @staticmethod def limit(limit): - return 'limit({})'.format(limit) + return f'limit({limit})' @staticmethod def offset(offset): - return 'offset({})'.format(offset) + return f'offset({offset})' @staticmethod def addQuery(attribute, method, value): if type(value) == list: - return '{}("{}", [{}])'.format(method, attribute, ','.join(map(Query.parseValues, value))) + return f'{method}("{attribute}", [{",".join(map(Query.parseValues, value))}])' else: - return '{}("{}", [{}])'.format(method, attribute, Query.parseValues(value)) + return f'{method}("{attribute}", [{Query.parseValues(value)}])' @staticmethod def parseValues(value): if type(value) == str: - return '"{}"'.format(value) + return f'"{value}"' else: return str(value) \ No newline at end of file From 6b7b7fcf6b4e4d042611c9fc111ef08844ccd841 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 17:51:26 +0000 Subject: [PATCH 334/555] feat: update kotlin query classes --- .../library/src/main/java/io/appwrite/Query.kt.twig | 8 ++++---- .../kotlin/src/main/kotlin/io/appwrite/Query.kt.twig | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Query.kt.twig b/templates/android/library/src/main/java/io/appwrite/Query.kt.twig index 9f0c38594c..29c532c0bb 100644 --- a/templates/android/library/src/main/java/io/appwrite/Query.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Query.kt.twig @@ -6,13 +6,13 @@ class Query { fun notEqual(attribute: String, value: Any) = Query.addQuery(attribute, "notEqual", value) - fun lesser(attribute: String, value: Any) = Query.addQuery(attribute, "lesser", value) + fun lessThan(attribute: String, value: Any) = Query.addQuery(attribute, "lessThan", value) - fun lesserEqual(attribute: String, value: Any) = Query.addQuery(attribute, "lesserEqual", value) + fun lessThanEqual(attribute: String, value: Any) = Query.addQuery(attribute, "lessThanEqual", value) - fun greater(attribute: String, value: Any) = Query.addQuery(attribute, "greater", value) + fun greaterThan(attribute: String, value: Any) = Query.addQuery(attribute, "greaterThan", value) - fun greaterEqual(attribute: String, value: Any) = Query.addQuery(attribute, "greaterEqual", value) + fun greaterThanEqual(attribute: String, value: Any) = Query.addQuery(attribute, "greaterThanEqual", value) fun search(attribute: String, value: String) = Query.addQuery(attribute, "search", value) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig index 9f0c38594c..29c532c0bb 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig @@ -6,13 +6,13 @@ class Query { fun notEqual(attribute: String, value: Any) = Query.addQuery(attribute, "notEqual", value) - fun lesser(attribute: String, value: Any) = Query.addQuery(attribute, "lesser", value) + fun lessThan(attribute: String, value: Any) = Query.addQuery(attribute, "lessThan", value) - fun lesserEqual(attribute: String, value: Any) = Query.addQuery(attribute, "lesserEqual", value) + fun lessThanEqual(attribute: String, value: Any) = Query.addQuery(attribute, "lessThanEqual", value) - fun greater(attribute: String, value: Any) = Query.addQuery(attribute, "greater", value) + fun greaterThan(attribute: String, value: Any) = Query.addQuery(attribute, "greaterThan", value) - fun greaterEqual(attribute: String, value: Any) = Query.addQuery(attribute, "greaterEqual", value) + fun greaterThanEqual(attribute: String, value: Any) = Query.addQuery(attribute, "greaterThanEqual", value) fun search(attribute: String, value: String) = Query.addQuery(attribute, "search", value) From cd83ce80676aad5c9db8e24164998e519d3b6320 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 17:54:27 +0000 Subject: [PATCH 335/555] feat: update dart query classes --- templates/dart/lib/query.dart.twig | 16 ++++++++-------- templates/flutter/lib/query.dart.twig | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/templates/dart/lib/query.dart.twig b/templates/dart/lib/query.dart.twig index 7b8c0b1da8..7e660b0172 100644 --- a/templates/dart/lib/query.dart.twig +++ b/templates/dart/lib/query.dart.twig @@ -7,17 +7,17 @@ class Query { static notEqual(String attribute, dynamic value) => _addQuery(attribute, 'notEqual', value); - static lesser(String attribute, dynamic value) => - _addQuery(attribute, 'lesser', value); + static lessThan(String attribute, dynamic value) => + _addQuery(attribute, 'lessThan', value); - static lesserEqual(String attribute, dynamic value) => - _addQuery(attribute, 'lesserEqual', value); + static lessThanEqual(String attribute, dynamic value) => + _addQuery(attribute, 'lessThanEqual', value); - static greater(String attribute, dynamic value) => - _addQuery(attribute, 'greater', value); + static greaterThan(String attribute, dynamic value) => + _addQuery(attribute, 'greaterThan', value); - static greaterEqual(String attribute, dynamic value) => - _addQuery(attribute, 'greaterEqual', value); + static greaterThanEqual(String attribute, dynamic value) => + _addQuery(attribute, 'greaterThanEqual', value); static search(String attribute, String value) => _addQuery(attribute, 'search', value); diff --git a/templates/flutter/lib/query.dart.twig b/templates/flutter/lib/query.dart.twig index 7b8c0b1da8..7e660b0172 100644 --- a/templates/flutter/lib/query.dart.twig +++ b/templates/flutter/lib/query.dart.twig @@ -7,17 +7,17 @@ class Query { static notEqual(String attribute, dynamic value) => _addQuery(attribute, 'notEqual', value); - static lesser(String attribute, dynamic value) => - _addQuery(attribute, 'lesser', value); + static lessThan(String attribute, dynamic value) => + _addQuery(attribute, 'lessThan', value); - static lesserEqual(String attribute, dynamic value) => - _addQuery(attribute, 'lesserEqual', value); + static lessThanEqual(String attribute, dynamic value) => + _addQuery(attribute, 'lessThanEqual', value); - static greater(String attribute, dynamic value) => - _addQuery(attribute, 'greater', value); + static greaterThan(String attribute, dynamic value) => + _addQuery(attribute, 'greaterThan', value); - static greaterEqual(String attribute, dynamic value) => - _addQuery(attribute, 'greaterEqual', value); + static greaterThanEqual(String attribute, dynamic value) => + _addQuery(attribute, 'greaterThanEqual', value); static search(String attribute, String value) => _addQuery(attribute, 'search', value); From efd123cd016bf7ac4098f9ea1a0dbdac38dc4de9 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 17:55:39 +0000 Subject: [PATCH 336/555] feat: update typescript query classes --- templates/deno/src/query.ts.twig | 16 ++++++++-------- templates/web/src/query.ts.twig | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/templates/deno/src/query.ts.twig b/templates/deno/src/query.ts.twig index bb54dcf959..1bd962adf9 100644 --- a/templates/deno/src/query.ts.twig +++ b/templates/deno/src/query.ts.twig @@ -9,17 +9,17 @@ export class Query { static notEqual = (attribute: string, value: QueryTypes): string => Query.addQuery(attribute, "notEqual", value); - static lesser = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "lesser", value); + static lessThan = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, "lessThan", value); - static lesserEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "lesserEqual", value); + static lessThanEqual = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, "lessThanEqual", value); - static greater = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "greater", value); + static greaterThan = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, "greaterThan", value); - static greaterEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "greaterEqual", value); + static greaterThanEqual = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, "greaterThanEqual", value); static search = (attribute: string, value: string): string => Query.addQuery(attribute, "search", value); diff --git a/templates/web/src/query.ts.twig b/templates/web/src/query.ts.twig index bb54dcf959..1bd962adf9 100644 --- a/templates/web/src/query.ts.twig +++ b/templates/web/src/query.ts.twig @@ -9,17 +9,17 @@ export class Query { static notEqual = (attribute: string, value: QueryTypes): string => Query.addQuery(attribute, "notEqual", value); - static lesser = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "lesser", value); + static lessThan = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, "lessThan", value); - static lesserEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "lesserEqual", value); + static lessThanEqual = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, "lessThanEqual", value); - static greater = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "greater", value); + static greaterThan = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, "greaterThan", value); - static greaterEqual = (attribute: string, value: QueryTypes): string => - Query.addQuery(attribute, "greaterEqual", value); + static greaterThanEqual = (attribute: string, value: QueryTypes): string => + Query.addQuery(attribute, "greaterThanEqual", value); static search = (attribute: string, value: string): string => Query.addQuery(attribute, "search", value); From 7724101f51d0387a605f1ab11d64b80c34b177f8 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 17:56:42 +0000 Subject: [PATCH 337/555] feat: update javascript query classes --- templates/node/lib/query.js.twig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/node/lib/query.js.twig b/templates/node/lib/query.js.twig index fe157a24d5..9a2ff2053f 100644 --- a/templates/node/lib/query.js.twig +++ b/templates/node/lib/query.js.twig @@ -5,17 +5,17 @@ class Query { static notEqual = (attribute, value) => Query.addQuery(attribute, "notEqual", value); - static lesser = (attribute, value) => - Query.addQuery(attribute, "lesser", value); + static lessThan = (attribute, value) => + Query.addQuery(attribute, "lessThan", value); - static lesserEqual = (attribute, value) => - Query.addQuery(attribute, "lesserEqual", value); + static lessThanEqual = (attribute, value) => + Query.addQuery(attribute, "lessThanEqual", value); - static greater = (attribute, value) => - Query.addQuery(attribute, "greater", value); + static greaterThan = (attribute, value) => + Query.addQuery(attribute, "greaterThan", value); - static greaterEqual = (attribute, value) => - Query.addQuery(attribute, "greaterEqual", value); + static greaterThanEqual = (attribute, value) => + Query.addQuery(attribute, "greaterThanEqual", value); static search = (attribute, value) => Query.addQuery(attribute, "search", value); From e4511dd3926ba6d0ee75cdc7fcde95e7d7603d9d Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 17:58:41 +0000 Subject: [PATCH 338/555] feat: update php query classes --- templates/php/src/Query.php.twig | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/templates/php/src/Query.php.twig b/templates/php/src/Query.php.twig index 0232cb31a2..9b6d61b767 100644 --- a/templates/php/src/Query.php.twig +++ b/templates/php/src/Query.php.twig @@ -29,51 +29,51 @@ class Query } /** - * Lesser + * Less Than * * @param string $attribute * @param mixed $value * @return string */ - public static function lesser(string $attribute, $value): string + public static function lessThan(string $attribute, $value): string { - return self::addQuery($attribute, 'lesser', $value); + return self::addQuery($attribute, 'lessThan', $value); } /** - * Lesser or Equal + * Lesser Than or Equal * * @param string $attribute * @param mixed $value * @return string */ - public static function lesserEqual(string $attribute, $value): string + public static function lessThanEqual(string $attribute, $value): string { - return self::addQuery($attribute, 'lesserEqual', $value); + return self::addQuery($attribute, 'lessThanEqual', $value); } /** - * Greater + * Greater Than * * @param string $attribute * @param mixed $value * @return string */ - public static function greater(string $attribute, $value): string + public static function greaterThan(string $attribute, $value): string { - return self::addQuery($attribute, 'greater', $value); + return self::addQuery($attribute, 'greaterThan', $value); } /** - * Greater or Equal + * Greater Than or Equal * * @param string $attribute * @param mixed $value * @return string */ - public static function greaterEqual(string $attribute, $value): string + public static function greaterThanEqual(string $attribute, $value): string { - return self::addQuery($attribute, 'greaterEqual', $value); + return self::addQuery($attribute, 'greaterThanEqual', $value); } /** From 71d36170717d72919fe0881c27622570ee9f7afb Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 17:59:26 +0000 Subject: [PATCH 339/555] feat: update python query classes --- templates/python/package/query.py.twig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/python/package/query.py.twig b/templates/python/package/query.py.twig index 7e940827b4..7df3c1fa60 100644 --- a/templates/python/package/query.py.twig +++ b/templates/python/package/query.py.twig @@ -8,20 +8,20 @@ class Query: return Query.addQuery(attribute, "notEqual", value) @staticmethod - def lesser(attribute, value): - return Query.addQuery(attribute, "lesser", value) + def lessThan(attribute, value): + return Query.addQuery(attribute, "lessThan", value) @staticmethod - def lesserEqual(attribute, value): - return Query.addQuery(attribute, "lesserEqual", value) + def lessThanEqual(attribute, value): + return Query.addQuery(attribute, "lessThanEqual", value) @staticmethod - def greater(attribute, value): - return Query.addQuery(attribute, "greater", value) + def greaterThan(attribute, value): + return Query.addQuery(attribute, "greaterThan", value) @staticmethod - def greaterEqual(attribute, value): - return Query.addQuery(attribute, "greaterEqual", value) + def greaterThanEqual(attribute, value): + return Query.addQuery(attribute, "greaterThanEqual", value) @staticmethod def search(attribute, value): From 519064a8d9db94b4250690dfd25597cc82d69f16 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 18:00:23 +0000 Subject: [PATCH 340/555] feat: update ruby query classes --- templates/ruby/lib/container/query.rb.twig | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/templates/ruby/lib/container/query.rb.twig b/templates/ruby/lib/container/query.rb.twig index b8c5a9a9fa..3a833b5b3f 100644 --- a/templates/ruby/lib/container/query.rb.twig +++ b/templates/ruby/lib/container/query.rb.twig @@ -8,18 +8,23 @@ module {{spec.title | caseUcfirst}} def notEqual(attribute, value) return addQuery(attribute, "notEqual", value) end - def lesser(attribute, value) - return addQuery(attribute, "lesser", value) + + def lessThan(attribute, value) + return addQuery(attribute, "lessThan", value) end - def lesserEqual(attribute, value) - return addQuery(attribute, "lesserEqual", value) + + def lessThanEqual(attribute, value) + return addQuery(attribute, "lessThanEqual", value) end - def greater(attribute, value) - return addQuery(attribute, "greater", value) + + def greaterThan(attribute, value) + return addQuery(attribute, "greaterThan", value) end - def greaterEqual(attribute, value) - return addQuery(attribute, "equal", value) + + def greaterThanEqual(attribute, value) + return addQuery(attribute, "greaterThanEqual", value) end + def search(attribute, value) return addQuery(attribute, "search", value) end From b5eb92cf0aca0a2a18a3cb58b65eefdd56fa32b3 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 18:01:04 +0000 Subject: [PATCH 341/555] feat: update swift query classes --- templates/swift/Sources/Query.swift.twig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/swift/Sources/Query.swift.twig b/templates/swift/Sources/Query.swift.twig index 34ab7d4376..bbbfdc153c 100644 --- a/templates/swift/Sources/Query.swift.twig +++ b/templates/swift/Sources/Query.swift.twig @@ -8,20 +8,20 @@ public class Query { buildQueryWhere(attribute, is: "notEqual", to: value) } - public static func lesser(_ attribute: String, value: Any) -> String { - buildQueryWhere(attribute, is: "lesser", to: value) + public static func lessThan(_ attribute: String, value: Any) -> String { + buildQueryWhere(attribute, is: "lessThan", to: value) } - public static func lesserEqual(attribute: String, value: Any) -> String { - buildQueryWhere(attribute, is: "lesserEqual", to: value) + public static func lessThanEqual(attribute: String, value: Any) -> String { + buildQueryWhere(attribute, is: "lessThanEqual", to: value) } - public static func greater(_ attribute: String, value: Any) -> String { - buildQueryWhere(attribute, is: "greater", to: value) + public static func greaterThan(_ attribute: String, value: Any) -> String { + buildQueryWhere(attribute, is: "greaterThan", to: value) } - public static func greaterEqual(_ attribute: String, value: Any) -> String { - buildQueryWhere(attribute, is: "greaterEqual", to: value) + public static func greaterThanEqual(_ attribute: String, value: Any) -> String { + buildQueryWhere(attribute, is: "greaterThanEqual", to: value) } public static func search(_ attribute: String, value: String) -> String { From 9b53f395f037ca38ff3bf23fa532fe9fc05da9ee Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 18:04:58 +0000 Subject: [PATCH 342/555] feat: update typescript ddefinitions --- templates/node/index.d.ts.twig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/node/index.d.ts.twig b/templates/node/index.d.ts.twig index 52720ff1b8..52adfb2f05 100644 --- a/templates/node/index.d.ts.twig +++ b/templates/node/index.d.ts.twig @@ -147,13 +147,13 @@ declare module "{{ language.params.npmPackage|caseDash }}" { static notEqual(attribute: string, value: QueryTypes): string; - static lesser(attribute: string, value: QueryTypes): string; + static lessThan(attribute: string, value: QueryTypes): string; - static lesserEqual(attribute: string, value: QueryTypes): string; + static lessThanEqual(attribute: string, value: QueryTypes): string; - static greater(attribute: string, value: QueryTypes): string; + static greaterThan(attribute: string, value: QueryTypes): string; - static greaterEqual(attribute: string, value: QueryTypes): string; + static greaterThanEqual(attribute: string, value: QueryTypes): string; static search(attribute: string, value: string): string; From ae72bb7fa01312d07c3e720c8a7e1b340a8893e6 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 18:08:17 +0000 Subject: [PATCH 343/555] feat: update tests --- tests/languages/android/Tests.kt | 4 ++-- tests/languages/dart/tests.dart | 4 ++-- tests/languages/deno/tests.ts | 4 ++-- tests/languages/flutter/tests.dart | 4 ++-- tests/languages/kotlin/Tests.kt | 4 ++-- tests/languages/node/test.js | 4 ++-- tests/languages/php/test.php | 4 ++-- tests/languages/python/tests.py | 4 ++-- tests/languages/ruby/tests.rb | 4 ++-- tests/languages/swift-client/Tests.swift | 4 ++-- tests/languages/swift-server/Tests.swift | 4 ++-- tests/languages/web/index.html | 4 ++-- tests/languages/web/node.js | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tests/languages/android/Tests.kt b/tests/languages/android/Tests.kt index 9385c21991..71ef3229d9 100644 --- a/tests/languages/android/Tests.kt +++ b/tests/languages/android/Tests.kt @@ -163,8 +163,8 @@ class ServiceTest { // Query helper tests writeToFile(Query.equal("title", listOf("Spiderman", "Dr. Strange"))) writeToFile(Query.notEqual("title", "Spiderman")) - writeToFile(Query.lesser("releasedYear", 1990)) - writeToFile(Query.greater("releasedYear", listOf(1990, 1999))) + writeToFile(Query.lessThan("releasedYear", 1990)) + writeToFile(Query.greaterThan("releasedYear", listOf(1990, 1999))) writeToFile(Query.search("name", "john")) writeToFile(Query.orderAsc("title")) writeToFile(Query.orderDesc("title")) diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index b0c8ec7731..acaf84bd32 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -91,8 +91,8 @@ void main() async { // Query helper tests print(Query.equal('title', ['Spiderman', 'Dr. Strange'])); print(Query.notEqual('title', 'Spiderman')); - print(Query.lesser('releasedYear', 1990)); - print(Query.greater('releasedYear', [1990, 1999])); + print(Query.lessThan('releasedYear', 1990)); + print(Query.greaterThan('releasedYear', [1990, 1999])); print(Query.search('name', 'john')); print(Query.orderAsc("title")); print(Query.orderDesc("title")); diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts index 62976f5ed5..9ff3e3003d 100644 --- a/tests/languages/deno/tests.ts +++ b/tests/languages/deno/tests.ts @@ -100,8 +100,8 @@ async function start() { // Query helper tests console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); console.log(Query.notEqual('title', 'Spiderman')); - console.log(Query.lesser('releasedYear', 1990)); - console.log(Query.greater('releasedYear', [1990, 1999])); + console.log(Query.lessThan('releasedYear', 1990)); + console.log(Query.greaterThan('releasedYear', [1990, 1999])); console.log(Query.search('name', "john")); console.log(Query.orderAsc("title")); console.log(Query.orderDesc("title")); diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index 0e1f2d6ead..121e51ede6 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -111,8 +111,8 @@ void main() async { // Query helper tests print(Query.equal('title', ['Spiderman', 'Dr. Strange'])); print(Query.notEqual('title', 'Spiderman')); - print(Query.lesser('releasedYear', 1990)); - print(Query.greater('releasedYear', [1990, 1999])); + print(Query.lessThan('releasedYear', 1990)); + print(Query.greaterThan('releasedYear', [1990, 1999])); print(Query.search('name', 'john')); print(Query.orderAsc("title")); print(Query.orderDesc("title")); diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt index 575ec7288a..c5c702fd49 100644 --- a/tests/languages/kotlin/Tests.kt +++ b/tests/languages/kotlin/Tests.kt @@ -123,8 +123,8 @@ class ServiceTest { // Query helper tests writeToFile(Query.equal("title", listOf("Spiderman", "Dr. Strange"))) writeToFile(Query.notEqual("title", "Spiderman")) - writeToFile(Query.lesser("releasedYear", 1990)) - writeToFile(Query.greater("releasedYear", listOf(1990, 1999))) + writeToFile(Query.lessThan("releasedYear", 1990)) + writeToFile(Query.greaterThan("releasedYear", listOf(1990, 1999))) writeToFile(Query.search("name", "john")) writeToFile(Query.orderAsc("title")) writeToFile(Query.orderDesc("title")) diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index 8304885f2b..e0c9fc7e65 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -88,8 +88,8 @@ async function start() { // Query helper tests console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); console.log(Query.notEqual('title', 'Spiderman')); - console.log(Query.lesser('releasedYear', 1990)); - console.log(Query.greater('releasedYear', [1990, 1999])); + console.log(Query.lessThan('releasedYear', 1990)); + console.log(Query.greaterThan('releasedYear', [1990, 1999])); console.log(Query.search('name', "john")); console.log(Query.orderAsc("title")); console.log(Query.orderDesc("title")); diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index b13b3f35e8..1accd438e4 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -106,8 +106,8 @@ // Query helper tests echo Query::equal('title', ['Spiderman', 'Dr. Strange']) . "\n"; echo Query::notEqual('title', 'Spiderman') . "\n"; -echo Query::lesser('releasedYear', 1990) . "\n"; -echo Query::greater('releasedYear', [1990, 1999]) . "\n"; +echo Query::lessThan('releasedYear', 1990) . "\n"; +echo Query::greaterThan('releasedYear', [1990, 1999]) . "\n"; echo Query::search('name', "john") . "\n"; echo Query::orderAsc("title") . "\n"; echo Query::orderDesc("title") . "\n"; diff --git a/tests/languages/python/tests.py b/tests/languages/python/tests.py index 81deb9b55f..db40b21d6d 100644 --- a/tests/languages/python/tests.py +++ b/tests/languages/python/tests.py @@ -95,8 +95,8 @@ # Query helper tests print(Query.equal('title', ['Spiderman', 'Dr. Strange'])) print(Query.notEqual('title', 'Spiderman')) -print(Query.lesser('releasedYear', 1990)) -print(Query.greater('releasedYear', [1990, 1999])) +print(Query.lessThan('releasedYear', 1990)) +print(Query.greaterThan('releasedYear', [1990, 1999])) print(Query.search('name', 'john')) print(Query.orderAsc("title")) print(Query.orderDesc("title")) diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index 499ccaeddc..49e9121bb6 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -107,8 +107,8 @@ # Query helper tests puts query.equal('title', ['Spiderman', 'Dr. Strange']) puts query.notEqual('title', 'Spiderman') -puts query.lesser('releasedYear', 1990) -puts query.greater('releasedYear', [1990, 1999]) +puts query.lessThan('releasedYear', 1990) +puts query.greaterThan('releasedYear', [1990, 1999]) puts query.search('name', 'john') puts query.orderAsc("title") puts query.orderDesc("title") diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/swift-client/Tests.swift index 6a1333205f..ffc0ca7c01 100644 --- a/tests/languages/swift-client/Tests.swift +++ b/tests/languages/swift-client/Tests.swift @@ -146,8 +146,8 @@ class Tests: XCTestCase { // Query helper tests print(Query.equal("title", value: ["Spiderman", "Dr. Strange"])); print(Query.notEqual("title", value: "Spiderman")); - print(Query.lesser("releasedYear", value: 1990)); - print(Query.greater("releasedYear", value: [1990, 1999])); + print(Query.lessThan("releasedYear", value: 1990)); + print(Query.greaterThan("releasedYear", value: [1990, 1999])); print(Query.search("name", value: "john")); print(Query.orderAsc("title")); print(Query.orderDesc("title")); diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index 1002fa8504..13bf735a89 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -127,8 +127,8 @@ class Tests: XCTestCase { // Query helper tests print(Query.equal("title", value: ["Spiderman", "Dr. Strange"])); print(Query.notEqual("title", value: "Spiderman")); - print(Query.lesser("releasedYear", value: 1990)); - print(Query.greater("releasedYear", value: [1990, 1999])); + print(Query.lessThan("releasedYear", value: 1990)); + print(Query.greaterThan("releasedYear", value: [1990, 1999])); print(Query.search("name", value: "john")); print(Query.orderAsc("title")); print(Query.orderDesc("title")); diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index 68112d1b13..ef98302b98 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -115,8 +115,8 @@ // Query helper tests console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); console.log(Query.notEqual('title', 'Spiderman')); - console.log(Query.lesser('releasedYear', 1990)); - console.log(Query.greater('releasedYear', [1990, 1999])); + console.log(Query.lessThan('releasedYear', 1990)); + console.log(Query.greaterThan('releasedYear', [1990, 1999])); console.log(Query.search('name', "john")); console.log(Query.orderAsc("title")); console.log(Query.orderDesc("title")); diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js index c490bdbd18..0f81a398bb 100644 --- a/tests/languages/web/node.js +++ b/tests/languages/web/node.js @@ -73,8 +73,8 @@ async function start() { // Query helper tests console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); console.log(Query.notEqual('title', 'Spiderman')); - console.log(Query.lesser('releasedYear', 1990)); - console.log(Query.greater('releasedYear', [1990, 1999])); + console.log(Query.lessThan('releasedYear', 1990)); + console.log(Query.greaterThan('releasedYear', [1990, 1999])); console.log(Query.search('name', "john")); console.log(Query.orderAsc("title")); console.log(Query.orderDesc("title")); From 6846d4c302dc9edf19adb7df3643d016a3a4a562 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 18:32:57 +0000 Subject: [PATCH 344/555] feat: review comments --- .../src/main/java/io/appwrite/Query.kt.twig | 4 ++-- .../src/main/kotlin/io/appwrite/Query.kt.twig | 4 ++-- templates/node/index.d.ts.twig | 14 ++++++++++- templates/php/src/Query.php.twig | 24 +++++++++---------- tests/Base.php | 4 ++-- 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Query.kt.twig b/templates/android/library/src/main/java/io/appwrite/Query.kt.twig index 29c532c0bb..7103c1bc2a 100644 --- a/templates/android/library/src/main/java/io/appwrite/Query.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Query.kt.twig @@ -20,9 +20,9 @@ class Query { fun orderDesc(attribute: String) = "orderDesc(\"${attribute}\")" - fun cursorBefore(attribute: String) = "cursorBefore(\"${attribute}\")" + fun cursorBefore(documentId: String) = "cursorBefore(\"${documentId}\")" - fun cursorAfter(attribute: String) = "cursorAfter(\"${attribute}\")" + fun cursorAfter(documentId: String) = "cursorAfter(\"${documentId}\")" fun limit(limit: Int) = "limit(${limit})" diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig index 29c532c0bb..7103c1bc2a 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig @@ -20,9 +20,9 @@ class Query { fun orderDesc(attribute: String) = "orderDesc(\"${attribute}\")" - fun cursorBefore(attribute: String) = "cursorBefore(\"${attribute}\")" + fun cursorBefore(documentId: String) = "cursorBefore(\"${documentId}\")" - fun cursorAfter(attribute: String) = "cursorAfter(\"${attribute}\")" + fun cursorAfter(documentId: String) = "cursorAfter(\"${documentId}\")" fun limit(limit: Int) = "limit(${limit})" diff --git a/templates/node/index.d.ts.twig b/templates/node/index.d.ts.twig index 52adfb2f05..39f4acda77 100644 --- a/templates/node/index.d.ts.twig +++ b/templates/node/index.d.ts.twig @@ -157,7 +157,19 @@ declare module "{{ language.params.npmPackage|caseDash }}" { static search(attribute: string, value: string): string; - private static addQuery(attribute: string, oper: string, value: QueryTypes): string; + static orderDesc(attribute: string): string; + + static orderAsc(attribute: string): string; + + static cursorAfter(documentId: string): string; + + static cursorBefore(documentId: string): string; + + static limit(value: number): string; + + static offset = (value: number): string; + + private static addQuery(attribute: string, method: string, value: QueryTypes): string; private static parseValues(value: QueryTypes): string; } diff --git a/templates/php/src/Query.php.twig b/templates/php/src/Query.php.twig index 9b6d61b767..845d8ef9f3 100644 --- a/templates/php/src/Query.php.twig +++ b/templates/php/src/Query.php.twig @@ -91,41 +91,41 @@ class Query /** * Cursor After * - * @param String $attribute + * @param String $documentId * @return string */ - public static function cursorAfter(String $attribute): string { - return 'cursorAfter("' . $attribute . '")'; + public static function cursorAfter(String $documentId): string { + return 'cursorAfter("' . $documentId . '")'; } /** * Cursor Before * - * @param String $attribute + * @param String $documentId * @return string */ - public static function cursorBefore(String $attribute): string { - return 'cursorBefore("' . $attribute . '")'; + public static function cursorBefore(String $documentId): string { + return 'cursorBefore("' . $documentId . '")'; } /** * Order Asc * - * @param String $id + * @param String $attribute * @return string */ - public static function orderAsc(String $id): string { - return 'orderAsc("' . $id . '")'; + public static function orderAsc(String $attribute): string { + return 'orderAsc("' . $attribute . '")'; } /** * Order Desc * - * @param String $id + * @param String $attribute * @return string */ - public static function orderDesc(String $id): string { - return 'orderDesc("' . $id . '")'; + public static function orderDesc(String $attribute): string { + return 'orderDesc("' . $attribute . '")'; } /** diff --git a/tests/Base.php b/tests/Base.php index 5cd0c170ee..fb27030cda 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -61,8 +61,8 @@ abstract class Base extends TestCase const QUERY_HELPER_RESPONSES = [ 'equal("title", ["Spiderman","Dr. Strange"])', 'notEqual("title", ["Spiderman"])', - 'lesser("releasedYear", [1990])', - 'greater("releasedYear", [1990,1999])', + 'lessThan("releasedYear", [1990])', + 'greaterThan("releasedYear", [1990,1999])', 'search("name", ["john"])', 'orderAsc("title")', 'orderDesc("title")', From ccec0372aa5e6f54306abcffdbcde0c1a019aa3c Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 18:35:01 +0000 Subject: [PATCH 345/555] feat: update data types --- templates/php/src/Query.php.twig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/php/src/Query.php.twig b/templates/php/src/Query.php.twig index 845d8ef9f3..751e4839c0 100644 --- a/templates/php/src/Query.php.twig +++ b/templates/php/src/Query.php.twig @@ -91,40 +91,40 @@ class Query /** * Cursor After * - * @param String $documentId + * @param string $documentId * @return string */ - public static function cursorAfter(String $documentId): string { + public static function cursorAfter(string $documentId): string { return 'cursorAfter("' . $documentId . '")'; } /** * Cursor Before * - * @param String $documentId + * @param string $documentId * @return string */ - public static function cursorBefore(String $documentId): string { + public static function cursorBefore(string $documentId): string { return 'cursorBefore("' . $documentId . '")'; } /** * Order Asc * - * @param String $attribute + * @param string $attribute * @return string */ - public static function orderAsc(String $attribute): string { + public static function orderAsc(string $attribute): string { return 'orderAsc("' . $attribute . '")'; } /** * Order Desc * - * @param String $attribute + * @param string $attribute * @return string */ - public static function orderDesc(String $attribute): string { + public static function orderDesc(string $attribute): string { return 'orderDesc("' . $attribute . '")'; } From b967465d9dea9b9bfc2c9cb1294828d11cdbcb3d Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 16 Aug 2022 18:57:53 +0000 Subject: [PATCH 346/555] feat: review comments --- tests/Base.php | 2 +- tests/languages/android/Tests.kt | 2 +- tests/languages/dart/tests.dart | 2 +- tests/languages/deno/tests.ts | 2 +- tests/languages/flutter/tests.dart | 2 +- tests/languages/kotlin/Tests.kt | 2 +- tests/languages/node/test.js | 2 +- tests/languages/php/test.php | 2 +- tests/languages/python/tests.py | 2 +- tests/languages/ruby/tests.rb | 2 +- tests/languages/swift-client/Tests.swift | 2 +- tests/languages/swift-server/Tests.swift | 2 +- tests/languages/web/index.html | 2 +- tests/languages/web/node.js | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/Base.php b/tests/Base.php index fb27030cda..18bc110594 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -62,7 +62,7 @@ abstract class Base extends TestCase 'equal("title", ["Spiderman","Dr. Strange"])', 'notEqual("title", ["Spiderman"])', 'lessThan("releasedYear", [1990])', - 'greaterThan("releasedYear", [1990,1999])', + 'greaterThan("releasedYear", [1990])', 'search("name", ["john"])', 'orderAsc("title")', 'orderDesc("title")', diff --git a/tests/languages/android/Tests.kt b/tests/languages/android/Tests.kt index 71ef3229d9..b6d6e0e1e9 100644 --- a/tests/languages/android/Tests.kt +++ b/tests/languages/android/Tests.kt @@ -164,7 +164,7 @@ class ServiceTest { writeToFile(Query.equal("title", listOf("Spiderman", "Dr. Strange"))) writeToFile(Query.notEqual("title", "Spiderman")) writeToFile(Query.lessThan("releasedYear", 1990)) - writeToFile(Query.greaterThan("releasedYear", listOf(1990, 1999))) + writeToFile(Query.greaterThan("releasedYear", 1990)) writeToFile(Query.search("name", "john")) writeToFile(Query.orderAsc("title")) writeToFile(Query.orderDesc("title")) diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index acaf84bd32..eccce3e330 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -92,7 +92,7 @@ void main() async { print(Query.equal('title', ['Spiderman', 'Dr. Strange'])); print(Query.notEqual('title', 'Spiderman')); print(Query.lessThan('releasedYear', 1990)); - print(Query.greaterThan('releasedYear', [1990, 1999])); + print(Query.greaterThan('releasedYear', 1990)); print(Query.search('name', 'john')); print(Query.orderAsc("title")); print(Query.orderDesc("title")); diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts index 9ff3e3003d..6cc3fae844 100644 --- a/tests/languages/deno/tests.ts +++ b/tests/languages/deno/tests.ts @@ -101,7 +101,7 @@ async function start() { console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); console.log(Query.notEqual('title', 'Spiderman')); console.log(Query.lessThan('releasedYear', 1990)); - console.log(Query.greaterThan('releasedYear', [1990, 1999])); + console.log(Query.greaterThan('releasedYear', 1990)); console.log(Query.search('name', "john")); console.log(Query.orderAsc("title")); console.log(Query.orderDesc("title")); diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index 121e51ede6..3d7de5991b 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -112,7 +112,7 @@ void main() async { print(Query.equal('title', ['Spiderman', 'Dr. Strange'])); print(Query.notEqual('title', 'Spiderman')); print(Query.lessThan('releasedYear', 1990)); - print(Query.greaterThan('releasedYear', [1990, 1999])); + print(Query.greaterThan('releasedYear', 1990)); print(Query.search('name', 'john')); print(Query.orderAsc("title")); print(Query.orderDesc("title")); diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt index c5c702fd49..9336793a4b 100644 --- a/tests/languages/kotlin/Tests.kt +++ b/tests/languages/kotlin/Tests.kt @@ -124,7 +124,7 @@ class ServiceTest { writeToFile(Query.equal("title", listOf("Spiderman", "Dr. Strange"))) writeToFile(Query.notEqual("title", "Spiderman")) writeToFile(Query.lessThan("releasedYear", 1990)) - writeToFile(Query.greaterThan("releasedYear", listOf(1990, 1999))) + writeToFile(Query.greaterThan("releasedYear", 1990)) writeToFile(Query.search("name", "john")) writeToFile(Query.orderAsc("title")) writeToFile(Query.orderDesc("title")) diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index e0c9fc7e65..0424e2066d 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -89,7 +89,7 @@ async function start() { console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); console.log(Query.notEqual('title', 'Spiderman')); console.log(Query.lessThan('releasedYear', 1990)); - console.log(Query.greaterThan('releasedYear', [1990, 1999])); + console.log(Query.greaterThan('releasedYear', 1990)); console.log(Query.search('name', "john")); console.log(Query.orderAsc("title")); console.log(Query.orderDesc("title")); diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index 1accd438e4..89e73c4af9 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -107,7 +107,7 @@ echo Query::equal('title', ['Spiderman', 'Dr. Strange']) . "\n"; echo Query::notEqual('title', 'Spiderman') . "\n"; echo Query::lessThan('releasedYear', 1990) . "\n"; -echo Query::greaterThan('releasedYear', [1990, 1999]) . "\n"; +echo Query::greaterThan('releasedYear', 1990) . "\n"; echo Query::search('name', "john") . "\n"; echo Query::orderAsc("title") . "\n"; echo Query::orderDesc("title") . "\n"; diff --git a/tests/languages/python/tests.py b/tests/languages/python/tests.py index db40b21d6d..4a59925422 100644 --- a/tests/languages/python/tests.py +++ b/tests/languages/python/tests.py @@ -96,7 +96,7 @@ print(Query.equal('title', ['Spiderman', 'Dr. Strange'])) print(Query.notEqual('title', 'Spiderman')) print(Query.lessThan('releasedYear', 1990)) -print(Query.greaterThan('releasedYear', [1990, 1999])) +print(Query.greaterThan('releasedYear', 1990)) print(Query.search('name', 'john')) print(Query.orderAsc("title")) print(Query.orderDesc("title")) diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index 49e9121bb6..4ccd357ee3 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -108,7 +108,7 @@ puts query.equal('title', ['Spiderman', 'Dr. Strange']) puts query.notEqual('title', 'Spiderman') puts query.lessThan('releasedYear', 1990) -puts query.greaterThan('releasedYear', [1990, 1999]) +puts query.greaterThan('releasedYear', 1990) puts query.search('name', 'john') puts query.orderAsc("title") puts query.orderDesc("title") diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/swift-client/Tests.swift index ffc0ca7c01..ec6f3c391c 100644 --- a/tests/languages/swift-client/Tests.swift +++ b/tests/languages/swift-client/Tests.swift @@ -147,7 +147,7 @@ class Tests: XCTestCase { print(Query.equal("title", value: ["Spiderman", "Dr. Strange"])); print(Query.notEqual("title", value: "Spiderman")); print(Query.lessThan("releasedYear", value: 1990)); - print(Query.greaterThan("releasedYear", value: [1990, 1999])); + print(Query.greaterThan("releasedYear", value: 1990)); print(Query.search("name", value: "john")); print(Query.orderAsc("title")); print(Query.orderDesc("title")); diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index 13bf735a89..a777135d2d 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -128,7 +128,7 @@ class Tests: XCTestCase { print(Query.equal("title", value: ["Spiderman", "Dr. Strange"])); print(Query.notEqual("title", value: "Spiderman")); print(Query.lessThan("releasedYear", value: 1990)); - print(Query.greaterThan("releasedYear", value: [1990, 1999])); + print(Query.greaterThan("releasedYear", value: 1990)); print(Query.search("name", value: "john")); print(Query.orderAsc("title")); print(Query.orderDesc("title")); diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index ef98302b98..e251507aaf 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -116,7 +116,7 @@ console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); console.log(Query.notEqual('title', 'Spiderman')); console.log(Query.lessThan('releasedYear', 1990)); - console.log(Query.greaterThan('releasedYear', [1990, 1999])); + console.log(Query.greaterThan('releasedYear', 1990)); console.log(Query.search('name', "john")); console.log(Query.orderAsc("title")); console.log(Query.orderDesc("title")); diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js index 0f81a398bb..52854e651f 100644 --- a/tests/languages/web/node.js +++ b/tests/languages/web/node.js @@ -74,7 +74,7 @@ async function start() { console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); console.log(Query.notEqual('title', 'Spiderman')); console.log(Query.lessThan('releasedYear', 1990)); - console.log(Query.greaterThan('releasedYear', [1990, 1999])); + console.log(Query.greaterThan('releasedYear', 1990)); console.log(Query.search('name', "john")); console.log(Query.orderAsc("title")); console.log(Query.orderDesc("title")); From 58b3bee9e6da1cb07bd73df67b207352251b15ca Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 17 Aug 2022 10:20:46 +0000 Subject: [PATCH 347/555] rearranging dart query methods --- templates/dart/lib/query.dart.twig | 32 +++++++++------------------ templates/flutter/lib/query.dart.twig | 32 +++++++++------------------ 2 files changed, 20 insertions(+), 44 deletions(-) diff --git a/templates/dart/lib/query.dart.twig b/templates/dart/lib/query.dart.twig index 7e660b0172..4696659bda 100644 --- a/templates/dart/lib/query.dart.twig +++ b/templates/dart/lib/query.dart.twig @@ -22,34 +22,22 @@ class Query { static search(String attribute, String value) => _addQuery(attribute, 'search', value); - static String _addQuery(String attribute, String method, dynamic value) => (value - is List) - ? '$method("$attribute", [${value.map((item) => parseValues(item)).join(",")}])' - : '$method("$attribute", [${parseValues(value)}])'; + static String orderAsc(String attribute) => 'orderAsc("$attribute")'; - static String orderAsc(String attribute) { - return 'orderAsc("$attribute")'; - } + static String orderDesc(String attribute) => 'orderDesc("$attribute")'; - static String orderDesc(String attribute) { - return 'orderDesc("$attribute")'; - } + static String cursorBefore(String id) => 'cursorBefore("$id")'; - static String cursorBefore(String id) { - return 'cursorBefore("$id")'; - } + static String cursorAfter(String id) => 'cursorAfter("$id")'; - static String cursorAfter(String id) { - return 'cursorAfter("$id")'; - } + static String limit(int limit) => 'limit($limit)'; - static String limit(int limit) { - return 'limit($limit)'; - } + static String offset(int offset) => 'offset($offset)'; - static String offset(int offset) { - return 'offset($offset)'; - } + static String _addQuery(String attribute, String method, dynamic value) => (value + is List) + ? '$method("$attribute", [${value.map((item) => parseValues(item)).join(",")}])' + : '$method("$attribute", [${parseValues(value)}])'; static String parseValues(dynamic value) => (value is String) ? '"$value"' : '$value'; diff --git a/templates/flutter/lib/query.dart.twig b/templates/flutter/lib/query.dart.twig index 7e660b0172..4696659bda 100644 --- a/templates/flutter/lib/query.dart.twig +++ b/templates/flutter/lib/query.dart.twig @@ -22,34 +22,22 @@ class Query { static search(String attribute, String value) => _addQuery(attribute, 'search', value); - static String _addQuery(String attribute, String method, dynamic value) => (value - is List) - ? '$method("$attribute", [${value.map((item) => parseValues(item)).join(",")}])' - : '$method("$attribute", [${parseValues(value)}])'; + static String orderAsc(String attribute) => 'orderAsc("$attribute")'; - static String orderAsc(String attribute) { - return 'orderAsc("$attribute")'; - } + static String orderDesc(String attribute) => 'orderDesc("$attribute")'; - static String orderDesc(String attribute) { - return 'orderDesc("$attribute")'; - } + static String cursorBefore(String id) => 'cursorBefore("$id")'; - static String cursorBefore(String id) { - return 'cursorBefore("$id")'; - } + static String cursorAfter(String id) => 'cursorAfter("$id")'; - static String cursorAfter(String id) { - return 'cursorAfter("$id")'; - } + static String limit(int limit) => 'limit($limit)'; - static String limit(int limit) { - return 'limit($limit)'; - } + static String offset(int offset) => 'offset($offset)'; - static String offset(int offset) { - return 'offset($offset)'; - } + static String _addQuery(String attribute, String method, dynamic value) => (value + is List) + ? '$method("$attribute", [${value.map((item) => parseValues(item)).join(",")}])' + : '$method("$attribute", [${parseValues(value)}])'; static String parseValues(dynamic value) => (value is String) ? '"$value"' : '$value'; From 834a114bd496a9a4d77872697b45ab99ac9be153 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 17 Aug 2022 10:23:46 +0000 Subject: [PATCH 348/555] rename param to match --- templates/deno/src/query.ts.twig | 8 ++++---- templates/node/lib/query.js.twig | 8 ++++---- templates/web/src/query.ts.twig | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/templates/deno/src/query.ts.twig b/templates/deno/src/query.ts.twig index 1bd962adf9..962a6c8f7e 100644 --- a/templates/deno/src/query.ts.twig +++ b/templates/deno/src/query.ts.twig @@ -36,11 +36,11 @@ export class Query { static cursorBefore = (documentId: string): string => `cursorBefore("${documentId}")`; - static limit = (value: number): string => - `limit(${value})`; + static limit = (limit: number): string => + `limit(${limit})`; - static offset = (value: number): string => - `offset(${value})`; + static offset = (offset: number): string => + `offset(${offset})`; private static addQuery = (attribute: string, method: string, value: QueryTypes): string => value instanceof Array diff --git a/templates/node/lib/query.js.twig b/templates/node/lib/query.js.twig index 9a2ff2053f..253468649a 100644 --- a/templates/node/lib/query.js.twig +++ b/templates/node/lib/query.js.twig @@ -32,11 +32,11 @@ class Query { static cursorBefore = (documentId) => `cursorBefore("${documentId}")`; - static limit = (value) => - `limit(${value})`; + static limit = (limit) => + `limit(${limit})`; - static offset = (value) => - `offset(${value})`; + static offset = (offset) => + `offset(${offset})`; static addQuery = (attribute, method, value) => value instanceof Array diff --git a/templates/web/src/query.ts.twig b/templates/web/src/query.ts.twig index 1bd962adf9..962a6c8f7e 100644 --- a/templates/web/src/query.ts.twig +++ b/templates/web/src/query.ts.twig @@ -36,11 +36,11 @@ export class Query { static cursorBefore = (documentId: string): string => `cursorBefore("${documentId}")`; - static limit = (value: number): string => - `limit(${value})`; + static limit = (limit: number): string => + `limit(${limit})`; - static offset = (value: number): string => - `offset(${value})`; + static offset = (offset: number): string => + `offset(${offset})`; private static addQuery = (attribute: string, method: string, value: QueryTypes): string => value instanceof Array From d13781de48c886e3005860c4e3e914d536a2a101 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 17 Aug 2022 10:24:58 +0000 Subject: [PATCH 349/555] rearrange --- templates/swift/Sources/Query.swift.twig | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/templates/swift/Sources/Query.swift.twig b/templates/swift/Sources/Query.swift.twig index bbbfdc153c..ba023a4fb9 100644 --- a/templates/swift/Sources/Query.swift.twig +++ b/templates/swift/Sources/Query.swift.twig @@ -28,15 +28,6 @@ public class Query { buildQueryWhere(attribute, is: "search", to: value) } - public static func buildQueryWhere(_ attribute: String, is method: String, to value: Any) -> String { - switch value { - case let value as Array: - return "\(method)(\"\(attribute)\", [\(value.map { parseValues($0) }.joined(separator: ",") )])" - default: - return "\(method)(\"\(attribute)\", [\(parseValues(value))])" - } - } - public static func orderAsc(_ attribute: String) -> String { "orderAsc(\"\(attribute)\")" } @@ -61,6 +52,15 @@ public class Query { "offset(\(offset))" } + public static func buildQueryWhere(_ attribute: String, is method: String, to value: Any) -> String { + switch value { + case let value as Array: + return "\(method)(\"\(attribute)\", [\(value.map { parseValues($0) }.joined(separator: ",") )])" + default: + return "\(method)(\"\(attribute)\", [\(parseValues(value))])" + } + } + private static func parseValues(_ value: Any) -> String { switch value { case let value as String: From 987a8f70ce5932c2055f7e1b8f0a59bf59f2fbec Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 17 Aug 2022 10:25:50 +0000 Subject: [PATCH 350/555] fix doc comment --- templates/php/src/Query.php.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/php/src/Query.php.twig b/templates/php/src/Query.php.twig index 751e4839c0..499158548c 100644 --- a/templates/php/src/Query.php.twig +++ b/templates/php/src/Query.php.twig @@ -41,7 +41,7 @@ class Query } /** - * Lesser Than or Equal + * Less Than or Equal * * @param string $attribute * @param mixed $value From 1ab497d6ede4ccd94988086e381a1a56e5faf76b Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 17 Aug 2022 10:27:34 +0000 Subject: [PATCH 351/555] dart formatting --- templates/dart/lib/query.dart.twig | 12 ++++++------ templates/flutter/lib/query.dart.twig | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/templates/dart/lib/query.dart.twig b/templates/dart/lib/query.dart.twig index 4696659bda..bcbf94fd1f 100644 --- a/templates/dart/lib/query.dart.twig +++ b/templates/dart/lib/query.dart.twig @@ -22,17 +22,17 @@ class Query { static search(String attribute, String value) => _addQuery(attribute, 'search', value); - static String orderAsc(String attribute) => 'orderAsc("$attribute")'; + static String orderAsc(String attribute) => 'orderAsc("$attribute")'; - static String orderDesc(String attribute) => 'orderDesc("$attribute")'; + static String orderDesc(String attribute) => 'orderDesc("$attribute")'; - static String cursorBefore(String id) => 'cursorBefore("$id")'; + static String cursorBefore(String id) => 'cursorBefore("$id")'; - static String cursorAfter(String id) => 'cursorAfter("$id")'; + static String cursorAfter(String id) => 'cursorAfter("$id")'; - static String limit(int limit) => 'limit($limit)'; + static String limit(int limit) => 'limit($limit)'; - static String offset(int offset) => 'offset($offset)'; + static String offset(int offset) => 'offset($offset)'; static String _addQuery(String attribute, String method, dynamic value) => (value is List) diff --git a/templates/flutter/lib/query.dart.twig b/templates/flutter/lib/query.dart.twig index 4696659bda..bcbf94fd1f 100644 --- a/templates/flutter/lib/query.dart.twig +++ b/templates/flutter/lib/query.dart.twig @@ -22,17 +22,17 @@ class Query { static search(String attribute, String value) => _addQuery(attribute, 'search', value); - static String orderAsc(String attribute) => 'orderAsc("$attribute")'; + static String orderAsc(String attribute) => 'orderAsc("$attribute")'; - static String orderDesc(String attribute) => 'orderDesc("$attribute")'; + static String orderDesc(String attribute) => 'orderDesc("$attribute")'; - static String cursorBefore(String id) => 'cursorBefore("$id")'; + static String cursorBefore(String id) => 'cursorBefore("$id")'; - static String cursorAfter(String id) => 'cursorAfter("$id")'; + static String cursorAfter(String id) => 'cursorAfter("$id")'; - static String limit(int limit) => 'limit($limit)'; + static String limit(int limit) => 'limit($limit)'; - static String offset(int offset) => 'offset($offset)'; + static String offset(int offset) => 'offset($offset)'; static String _addQuery(String attribute, String method, dynamic value) => (value is List) From c17fdc00ee58f552876079430770acf79e151f9a Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 19 Aug 2022 19:57:18 +1200 Subject: [PATCH 352/555] Fix Swift OAuth cookie --- .../Sources/OAuth/WebAuthComponent.swift.twig | 39 ++++++++++++--- .../Shared/ExampleViewModel.swift | 49 +++++++++---------- .../UIKitExample/ViewController.swift | 2 +- 3 files changed, 56 insertions(+), 34 deletions(-) diff --git a/templates/swift/Sources/OAuth/WebAuthComponent.swift.twig b/templates/swift/Sources/OAuth/WebAuthComponent.swift.twig index 6667557676..1e35d7acfb 100644 --- a/templates/swift/Sources/OAuth/WebAuthComponent.swift.twig +++ b/templates/swift/Sources/OAuth/WebAuthComponent.swift.twig @@ -23,7 +23,7 @@ public class WebAuthComponent { /// /// Authenticate Session with OAuth2 /// - /// Launches a chrome custom tab from the given activity and directs to the given url, + /// Launches a browser window from your app and directs to the given url, /// suspending until the user returns to the app, at which point the given [onComplete] callback /// will run, passing the callback url from the intent used to launch the [CallbackActivity], /// or an [IllegalStateException] in the case the user closed the window or returned to the @@ -62,12 +62,37 @@ public class WebAuthComponent { var domain = cookieParts["domain"]! domain.remove(at: domain.startIndex) - let cookie = HTTPClient.Cookie( - name: cookieParts["key"]!, - value: cookieParts["secret"]! - ) - let cookieJson = try! cookie.toJson() - UserDefaults.standard.set(cookieJson, forKey: "\(domain)-cookies") + let key: String = cookieParts["key"]! + let secret: String = cookieParts["secret"]! + let path: String? = cookieParts["path"] + let expires: String? = cookieParts["expires"] + let maxAge: String? = cookieParts["maxAge"] + let sameSite: String? = cookieParts["sameSite"] + let httpOnly: Bool? = cookieParts.keys.contains("httpOnly") + let secure: Bool? = cookieParts.keys.contains("secure") + + var cookie = "\(key)=\(secret)" + + if let path = path { + cookie += "; path=\(path)" + } + if let expires = expires { + cookie += "; expires=\(expires)" + } + if let maxAge = maxAge { + cookie += "; max-age=\(maxAge)" + } + if let sameSite = sameSite { + cookie += "; sameSite=\(sameSite)" + } + if let httpOnly = httpOnly, httpOnly { + cookie += "; httpOnly" + } + if let secure = secure, secure { + cookie += "; secure" + } + + UserDefaults.standard.set([cookie], forKey: "\(domain)-cookies") WebAuthComponent.onCallback( scheme: components.scheme!, diff --git a/templates/swift/example-swiftui/Shared/ExampleViewModel.swift b/templates/swift/example-swiftui/Shared/ExampleViewModel.swift index af8f495c4d..1349380544 100644 --- a/templates/swift/example-swiftui/Shared/ExampleViewModel.swift +++ b/templates/swift/example-swiftui/Shared/ExampleViewModel.swift @@ -31,79 +31,76 @@ extension ExampleView { func register() async { do { - let response = try await account.create( + let user = try await account.create( userId: userId, email: username, password: password ) - self.userId = response.id - self.response = String(describing: response.toMap()) + self.userId = user.id + self.response = String(describing: user.toMap()) } catch { - self.response = String(describing: error) + self.response = error.localizedDescription } } func login() async { do { - let response = try await account.createSession( + let session = try await account.createEmailSession( email: username, password: password ) - self.response = String(describing: response.toMap()) + self.response = String(describing: session.toMap()) } catch { - self.response = String(describing: error) + self.response = error.localizedDescription } } func loginWithFacebook() async { do { - let response = try await account.createOAuth2Session( - provider: "facebook", - success: "\(host)/auth/oauth2/success", - failure: "\(host)/auth/oauth2/failure" - ) - self.response = String(describing: response) + _ = try await account.createOAuth2Session(provider: "facebook") + + self.response = "Success!" } catch { - self.response = String(describing: error) + self.response = error.localizedDescription } } func download() async { do { - let response = try await storage.getFileDownload( + let data = try await storage.getFileDownload( bucketId: bucketId, fileId: fileId ) - self.downloadedImage = Image(data: Data(buffer: response)) + self.downloadedImage = Image(data: Data(buffer: data)) } catch { - self.response = String(describing: error) + self.response = error.localizedDescription } } func upload(image: OSImage) async { - let imageBuffer = ByteBufferAllocator() - .buffer(data: image.data) - #if os(macOS) let fileName = "file.tiff" + let mime = "image/tiff" #else let fileName = "file.png" + let mime = "image/png" #endif - let file = File( - name: fileName, - buffer: imageBuffer + let file = InputFile.fromData( + image.data, + filename: fileName, + mimeType: mime ) do { - let response = try await storage.createFile( + let file = try await storage.createFile( bucketId: bucketId, fileId: fileId, file: file ) - self.response = String(describing: response.toMap()) + self.response = String(describing: file.toMap()) } catch { - self.response = String(describing: error) + self.response = error.localizedDescription } } diff --git a/templates/swift/example-uikit/UIKitExample/ViewController.swift b/templates/swift/example-uikit/UIKitExample/ViewController.swift index 4126cbbd85..b1d2f14974 100644 --- a/templates/swift/example-uikit/UIKitExample/ViewController.swift +++ b/templates/swift/example-uikit/UIKitExample/ViewController.swift @@ -58,7 +58,7 @@ class ViewController: UIViewController { @IBAction func loginClick(_ sender: Any) async { do { - let response = try await account.createSession( + let response = try await account.createEmailSession( email: "jake@appwrite.io", password: "password" ) From fb6ef0dee22bd59ec1ac26dc4251bf8e4ab72da0 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 19 Aug 2022 20:00:46 +1200 Subject: [PATCH 353/555] Fix swift chunked upload when using non-unique ID --- templates/swift/Sources/Client.swift.twig | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index 745aec5511..19228b50a9 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -367,15 +367,19 @@ open class Client { if idParamName != nil && params[idParamName!] as! String != "unique()" { // Make a request to check if a file already exists - let map = try! await call( - method: "GET", - path: path + "/" + (params[idParamName!] as! String), - headers: headers, - params: [:], - converter: { return $0 } - ) - let chunksUploaded = map["chunksUploaded"] as! Int - offset = min(size, (chunksUploaded * Client.chunkSize)) + do { + let map = try await call( + method: "GET", + path: path + "/" + (params[idParamName!] as! String), + headers: headers, + params: [:], + converter: { return $0 } + ) + let chunksUploaded = map["chunksUploaded"] as! Int + offset = min(size, (chunksUploaded * Client.chunkSize)) + } catch { + // File does not exist yet, swallow exception + } } while offset < size { From a438bac8786c02d4e6c1909cba5c041d39c99f63 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 19 Aug 2022 20:24:57 +1200 Subject: [PATCH 354/555] Lint --- src/SDK/Language/Flutter.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/SDK/Language/Flutter.php b/src/SDK/Language/Flutter.php index a42be1b646..6187766b44 100644 --- a/src/SDK/Language/Flutter.php +++ b/src/SDK/Language/Flutter.php @@ -206,10 +206,10 @@ public function getFiles(): array 'template' => 'flutter/lib/models.dart.twig', ], [ - 'scope' => 'default', - 'destination' => '/lib/models.dart', - 'template' => 'flutter/lib/models.dart.twig', - ], + 'scope' => 'default', + 'destination' => '/lib/models.dart', + 'template' => 'flutter/lib/models.dart.twig', + ], [ 'scope' => 'default', 'destination' => '/lib/permission.dart', @@ -226,10 +226,10 @@ public function getFiles(): array 'template' => 'flutter/lib/id.dart.twig', ], [ - 'scope' => 'default', - 'destination' => '/lib/query.dart', - 'template' => 'flutter/lib/query.dart.twig', - ], + 'scope' => 'default', + 'destination' => '/lib/query.dart', + 'template' => 'flutter/lib/query.dart.twig', + ], [ 'scope' => 'service', 'destination' => '/lib/services/{{service.name | caseDash}}.dart', From 82086d138aff7435e5a4bc79146ba727f71191c2 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 19 Aug 2022 21:12:14 +1200 Subject: [PATCH 355/555] Fix lint errors --- tests/Base.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Base.php b/tests/Base.php index e5538d1231..23769c0344 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -60,7 +60,7 @@ abstract class Base extends TestCase 'WS:/v1/realtime:passed', ]; - const QUERY_HELPER_RESPONSES = [ + protected const QUERY_HELPER_RESPONSES = [ 'equal("title", ["Spiderman","Dr. Strange"])', 'notEqual("title", ["Spiderman"])', 'lessThan("releasedYear", [1990])', @@ -74,7 +74,7 @@ abstract class Base extends TestCase 'offset(20)', ]; - const PERMISSION_HELPER_RESPONSES = [ + protected const PERMISSION_HELPER_RESPONSES = [ 'read("any")', 'write("user:userid")', 'create("users")', @@ -83,7 +83,7 @@ abstract class Base extends TestCase 'delete("team:teamId")' ]; - const ID_HELPER_RESPONSES = [ + protected const ID_HELPER_RESPONSES = [ 'unique()', 'custom_id' ]; From 532d4d15ec8f11539972f2848c2e230c49b24f65 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 20 Aug 2022 07:42:55 +0000 Subject: [PATCH 356/555] feat: update endpoint --- tests/languages/cli/test.js | 2 +- tests/resources/spec.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/languages/cli/test.js b/tests/languages/cli/test.js index e0cb725ecf..4b14a1ac43 100644 --- a/tests/languages/cli/test.js +++ b/tests/languages/cli/test.js @@ -1,6 +1,6 @@ const { exec, execSync } = require('child_process'); -execSync("node index client --endpoint 'https://8080-appwrite-appwrite-wp0ocjvurgi.ws-us62.gitpod.io' --projectId console --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); +execSync("node index client --endpoint 'https://8080-appwrite-appwrite-38xdl9d8529.ws-us62.gitpod.io/v1' --projectId console --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); var output; console.log('\nTest Started'); diff --git a/tests/resources/spec.json b/tests/resources/spec.json index a0a5090d0a..46d9d36cc3 100644 --- a/tests/resources/spec.json +++ b/tests/resources/spec.json @@ -15,7 +15,7 @@ "url": "https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE" } }, - "host": "8080-appwrite-appwrite-wp0ocjvurgi.ws-us62.gitpod.io", + "host": "8080-appwrite-appwrite-38xdl9d8529.ws-us62.gitpod.io", "basePath": "/v1", "schemes": ["https"], "consumes": ["application/json", "multipart/form-data"], From 3cc05e8746abe0a36e31d31df6169cb4a32d86af Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Tue, 23 Aug 2022 15:04:51 +0000 Subject: [PATCH 357/555] Change default to unique() for functionId --- templates/cli/lib/questions.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cli/lib/questions.js.twig b/templates/cli/lib/questions.js.twig index 2c85a639dc..c04e2915ac 100644 --- a/templates/cli/lib/questions.js.twig +++ b/templates/cli/lib/questions.js.twig @@ -160,7 +160,7 @@ const questionsInitFunction = [ type: "input", name: "id", message: "What ID would you like to have for your function?", - default: "myAwesomeFunction" + default: "unique()" }, { type: "list", From 5e491e38190ce2096e4d8aed0c1c262249ab9b25 Mon Sep 17 00:00:00 2001 From: Dom Date: Mon, 29 Aug 2022 15:51:40 +0800 Subject: [PATCH 358/555] Update to use flutter_web_auth_2 dependency --- templates/flutter/lib/src/client_browser.dart.twig | 4 ++-- templates/flutter/lib/src/client_io.dart.twig | 4 ++-- templates/flutter/pubspec.yaml.twig | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/flutter/lib/src/client_browser.dart.twig b/templates/flutter/lib/src/client_browser.dart.twig index 2d7cedba0d..9137c60f45 100644 --- a/templates/flutter/lib/src/client_browser.dart.twig +++ b/templates/flutter/lib/src/client_browser.dart.twig @@ -1,7 +1,7 @@ import 'dart:html' as html; import 'dart:math'; import 'package:flutter/foundation.dart'; -import 'package:flutter_web_auth/flutter_web_auth.dart'; +import 'package:flutter_web_auth_2/flutter_web_auth_2.dart'; import 'package:http/http.dart' as http; import 'package:http/browser_client.dart'; import 'client_mixin.dart'; @@ -209,7 +209,7 @@ class ClientBrowser extends ClientBase with ClientMixin { @override Future webAuth(Uri url) { - return FlutterWebAuth.authenticate( + return FlutterWebAuth2.authenticate( url: url.toString(), callbackUrlScheme: "appwrite-callback-" + config['project']!, ); diff --git a/templates/flutter/lib/src/client_io.dart.twig b/templates/flutter/lib/src/client_io.dart.twig index 7293b52b6d..0113c4ea8d 100644 --- a/templates/flutter/lib/src/client_io.dart.twig +++ b/templates/flutter/lib/src/client_io.dart.twig @@ -6,7 +6,7 @@ import 'package:http/http.dart' as http; import 'package:http/io_client.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:path_provider/path_provider.dart'; -import 'package:flutter_web_auth/flutter_web_auth.dart'; +import 'package:flutter_web_auth_2/flutter_web_auth_2.dart'; import 'client_mixin.dart'; import 'client_base.dart'; import 'cookie_manager.dart'; @@ -302,7 +302,7 @@ class ClientIO extends ClientBase with ClientMixin { @override Future webAuth(Uri url) { - return FlutterWebAuth.authenticate( + return FlutterWebAuth2.authenticate( url: url.toString(), callbackUrlScheme: "appwrite-callback-" + config['project']!, ).then((value) async { diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 1d1a02b424..8135834c97 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -13,7 +13,7 @@ dependencies: sdk: flutter cookie_jar: ^3.0.1 device_info_plus: ^4.1.2 - flutter_web_auth: ^0.4.1 + flutter_web_auth_2: ^1.0.1 http: ^0.13.5 package_info_plus: ^1.4.3+1 path_provider: ^2.0.11 From 0fca8e14dfd813b493b5213d93c7c975812867b5 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 30 Aug 2022 03:54:02 +0000 Subject: [PATCH 359/555] render license content raw --- templates/android/LICENSE.md.twig | 2 +- templates/cli/LICENSE.md.twig | 2 +- templates/dart/LICENSE.twig | 2 +- templates/deno/LICENSE.twig | 2 +- templates/dotnet/LICENSE.twig | 2 +- templates/flutter/LICENSE.twig | 2 +- templates/go/LICENSE.twig | 2 +- templates/kotlin/LICENSE.md.twig | 2 +- templates/node/LICENSE.twig | 2 +- templates/php/LICENSE.twig | 2 +- templates/python/LICENSE.twig | 2 +- templates/ruby/LICENSE.twig | 2 +- templates/swift/LICENSE.twig | 2 +- templates/web/LICENSE.twig | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/templates/android/LICENSE.md.twig b/templates/android/LICENSE.md.twig index 0e8c361b49..854eb19494 100644 --- a/templates/android/LICENSE.md.twig +++ b/templates/android/LICENSE.md.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file diff --git a/templates/cli/LICENSE.md.twig b/templates/cli/LICENSE.md.twig index 0e8c361b49..854eb19494 100644 --- a/templates/cli/LICENSE.md.twig +++ b/templates/cli/LICENSE.md.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file diff --git a/templates/dart/LICENSE.twig b/templates/dart/LICENSE.twig index 0e8c361b49..854eb19494 100644 --- a/templates/dart/LICENSE.twig +++ b/templates/dart/LICENSE.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file diff --git a/templates/deno/LICENSE.twig b/templates/deno/LICENSE.twig index 0e8c361b49..854eb19494 100644 --- a/templates/deno/LICENSE.twig +++ b/templates/deno/LICENSE.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file diff --git a/templates/dotnet/LICENSE.twig b/templates/dotnet/LICENSE.twig index 0e8c361b49..854eb19494 100644 --- a/templates/dotnet/LICENSE.twig +++ b/templates/dotnet/LICENSE.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file diff --git a/templates/flutter/LICENSE.twig b/templates/flutter/LICENSE.twig index 0e8c361b49..854eb19494 100644 --- a/templates/flutter/LICENSE.twig +++ b/templates/flutter/LICENSE.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file diff --git a/templates/go/LICENSE.twig b/templates/go/LICENSE.twig index 0e8c361b49..854eb19494 100644 --- a/templates/go/LICENSE.twig +++ b/templates/go/LICENSE.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file diff --git a/templates/kotlin/LICENSE.md.twig b/templates/kotlin/LICENSE.md.twig index 0e8c361b49..854eb19494 100644 --- a/templates/kotlin/LICENSE.md.twig +++ b/templates/kotlin/LICENSE.md.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file diff --git a/templates/node/LICENSE.twig b/templates/node/LICENSE.twig index 0e8c361b49..854eb19494 100644 --- a/templates/node/LICENSE.twig +++ b/templates/node/LICENSE.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file diff --git a/templates/php/LICENSE.twig b/templates/php/LICENSE.twig index 0e8c361b49..854eb19494 100644 --- a/templates/php/LICENSE.twig +++ b/templates/php/LICENSE.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file diff --git a/templates/python/LICENSE.twig b/templates/python/LICENSE.twig index 0e8c361b49..854eb19494 100644 --- a/templates/python/LICENSE.twig +++ b/templates/python/LICENSE.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file diff --git a/templates/ruby/LICENSE.twig b/templates/ruby/LICENSE.twig index 0e8c361b49..854eb19494 100644 --- a/templates/ruby/LICENSE.twig +++ b/templates/ruby/LICENSE.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file diff --git a/templates/swift/LICENSE.twig b/templates/swift/LICENSE.twig index 0e8c361b49..854eb19494 100644 --- a/templates/swift/LICENSE.twig +++ b/templates/swift/LICENSE.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file diff --git a/templates/web/LICENSE.twig b/templates/web/LICENSE.twig index 0e8c361b49..854eb19494 100644 --- a/templates/web/LICENSE.twig +++ b/templates/web/LICENSE.twig @@ -1 +1 @@ -{{sdk.licenseContent}} \ No newline at end of file +{{sdk.licenseContent | raw}} \ No newline at end of file From 90fc7374ebb19048ca53b2352b662fc8db91a39a Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 30 Aug 2022 04:02:34 +0000 Subject: [PATCH 360/555] fix spacing --- templates/dart/lib/services/service.dart.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index 0eb82f6471..5c39c41ea9 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -8,19 +8,19 @@ part of {{ language.params.packageName }}; {% endmacro %} {%if service.description %} -{{ service.description|dartComment}} +{{- service.description|dartComment}} {% endif %} class {{ service.name | caseUcfirst }} extends Service { {{ service.name | caseUcfirst }}(super.client); {% for method in service.methods %} /// {{ method.title }} -{% if method.description %} +{%~ if method.description %} /// {{ method.description | dartComment }} /// {% endif %} - {% if method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all, method.consumes) }}) async { + {% if method.type == 'location' %}Future{% else %}{% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all, method.consumes) }}) async { final String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | overrideIdentifier }}){% endfor %}; {% if 'multipart/form-data' in method.consumes %} From f35cb58eb873282c1c4ab0e6ed72f9e4f9202752 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 30 Aug 2022 04:06:04 +0000 Subject: [PATCH 361/555] comment spacing --- templates/dart/lib/services/service.dart.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index 5c39c41ea9..7853a059e9 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -14,11 +14,11 @@ class {{ service.name | caseUcfirst }} extends Service { {{ service.name | caseUcfirst }}(super.client); {% for method in service.methods %} - /// {{ method.title }} + /// {{ method.title }} {%~ if method.description %} - /// + /// {{ method.description | dartComment }} - /// + /// {% endif %} {% if method.type == 'location' %}Future{% else %}{% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all, method.consumes) }}) async { final String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | overrideIdentifier }}){% endfor %}; From 7aedc5269e333842e17bf9633e455f2c34ca749e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 1 Sep 2022 01:34:44 +1200 Subject: [PATCH 362/555] Manipulate array examples for Kotlin --- src/SDK/Language/Kotlin.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index 9aa02dc7e7..b8035c2f7b 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -228,9 +228,17 @@ public function getParamExample(array $param) case self::TYPE_FILE: case self::TYPE_NUMBER: case self::TYPE_INTEGER: - case self::TYPE_ARRAY: $output .= $example; break; + case self::TYPE_ARRAY: + if (\str_starts_with($example, '[')) { + $example = \substr($example, 1); + } + if (\str_ends_with($example, ']')) { + $example = \substr($example, 0, -1); + } + $output .= 'listOf(' . $example . ')'; + break; case self::TYPE_BOOLEAN: $output .= ($example) ? 'true' : 'false'; break; From 05e6ee7fc1e5f3e3ffb3a1bac18dea01afceb07e Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 1 Sep 2022 08:54:08 +0000 Subject: [PATCH 363/555] feat: update tests --- composer.lock | 469 ++++++++++-------------------------- tests/languages/cli/test.js | 2 +- tests/resources/spec.json | 2 +- 3 files changed, 134 insertions(+), 339 deletions(-) diff --git a/composer.lock b/composer.lock index 4c12e880b5..d2dcc22cd4 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "matthiasmullie/minify", - "version": "1.3.68", + "version": "1.3.69", "source": { "type": "git", "url": "https://github.com/matthiasmullie/minify.git", - "reference": "c00fb02f71b2ef0a5f53fe18c5a8b9aa30f48297" + "reference": "a61c949cccd086808063611ef9698eabe42ef22f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/c00fb02f71b2ef0a5f53fe18c5a8b9aa30f48297", - "reference": "c00fb02f71b2ef0a5f53fe18c5a8b9aa30f48297", + "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/a61c949cccd086808063611ef9698eabe42ef22f", + "reference": "a61c949cccd086808063611ef9698eabe42ef22f", "shasum": "" }, "require": { @@ -66,7 +66,7 @@ ], "support": { "issues": "https://github.com/matthiasmullie/minify/issues", - "source": "https://github.com/matthiasmullie/minify/tree/1.3.68" + "source": "https://github.com/matthiasmullie/minify/tree/1.3.69" }, "funding": [ { @@ -74,7 +74,7 @@ "type": "github" } ], - "time": "2022-04-19T08:28:56+00:00" + "time": "2022-08-01T09:00:18+00:00" }, { "name": "matthiasmullie/path-converter", @@ -374,16 +374,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v6.6.1", + "version": "v6.6.3", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "ae5803ce4558f855c7d955baa2d90b93ec40c4b7" + "reference": "f2d781bb9136cda2f5e73ee778049e80ba681cf6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/ae5803ce4558f855c7d955baa2d90b93ec40c4b7", - "reference": "ae5803ce4558f855c7d955baa2d90b93ec40c4b7", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/f2d781bb9136cda2f5e73ee778049e80ba681cf6", + "reference": "f2d781bb9136cda2f5e73ee778049e80ba681cf6", "shasum": "" }, "require": { @@ -393,12 +393,13 @@ "ext-simplexml": "*", "jean85/pretty-package-versions": "^2.0.5", "php": "^7.3 || ^8.0", - "phpunit/php-code-coverage": "^9.2.15", + "phpunit/php-code-coverage": "^9.2.16", "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-timer": "^5.0.3", - "phpunit/phpunit": "^9.5.21", + "phpunit/phpunit": "^9.5.23", "sebastian/environment": "^5.1.4", "symfony/console": "^5.4.9 || ^6.1.2", + "symfony/polyfill-php80": "^v1.26.0", "symfony/process": "^5.4.8 || ^6.1.0" }, "require-dev": { @@ -409,7 +410,7 @@ "malukenho/mcbumpface": "^1.1.5", "squizlabs/php_codesniffer": "^3.7.1", "symfony/filesystem": "^5.4.9 || ^6.1.0", - "vimeo/psalm": "^4.24.0" + "vimeo/psalm": "^4.26.0" }, "bin": [ "bin/paratest", @@ -450,7 +451,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v6.6.1" + "source": "https://github.com/paratestphp/paratest/tree/v6.6.3" }, "funding": [ { @@ -462,7 +463,7 @@ "type": "paypal" } ], - "time": "2022-07-22T14:07:17+00:00" + "time": "2022-08-25T05:44:14+00:00" }, { "name": "doctrine/instantiator", @@ -819,252 +820,25 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" - }, - "time": "2022-03-15T21:29:03+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, { "name": "phpunit/php-code-coverage", - "version": "9.2.15", + "version": "9.2.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", + "nikic/php-parser": "^4.14", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1113,7 +887,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" }, "funding": [ { @@ -1121,7 +895,7 @@ "type": "github" } ], - "time": "2022-03-07T09:28:20+00:00" + "time": "2022-08-30T12:24:04+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1366,16 +1140,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.21", + "version": "9.5.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1" + "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", + "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", "shasum": "" }, "require": { @@ -1390,7 +1164,6 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", "phpunit/php-code-coverage": "^9.2.13", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", @@ -1405,12 +1178,9 @@ "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.0", + "sebastian/type": "^3.1", "sebastian/version": "^3.0.2" }, - "require-dev": { - "phpspec/prophecy-phpunit": "^2.0.1" - }, "suggest": { "ext-soap": "*", "ext-xdebug": "*" @@ -1452,7 +1222,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.24" }, "funding": [ { @@ -1464,7 +1234,7 @@ "type": "github" } ], - "time": "2022-06-19T12:14:25+00:00" + "time": "2022-08-30T07:42:16+00:00" }, { "name": "psr/container", @@ -2376,16 +2146,16 @@ }, { "name": "sebastian/type", - "version": "3.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" + "reference": "fb44e1cc6e557418387ad815780360057e40753e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb44e1cc6e557418387ad815780360057e40753e", + "reference": "fb44e1cc6e557418387ad815780360057e40753e", "shasum": "" }, "require": { @@ -2397,7 +2167,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -2420,7 +2190,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.1.0" }, "funding": [ { @@ -2428,7 +2198,7 @@ "type": "github" } ], - "time": "2022-03-15T09:54:48+00:00" + "time": "2022-08-29T06:55:37+00:00" }, { "name": "sebastian/version", @@ -2485,16 +2255,16 @@ }, { "name": "symfony/console", - "version": "v6.1.3", + "version": "v6.1.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "43fcb5c5966b43c56bcfa481368d90d748936ab8" + "reference": "7fccea8728aa2d431a6725b02b3ce759049fc84d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/43fcb5c5966b43c56bcfa481368d90d748936ab8", - "reference": "43fcb5c5966b43c56bcfa481368d90d748936ab8", + "url": "https://api.github.com/repos/symfony/console/zipball/7fccea8728aa2d431a6725b02b3ce759049fc84d", + "reference": "7fccea8728aa2d431a6725b02b3ce759049fc84d", "shasum": "" }, "require": { @@ -2561,7 +2331,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.3" + "source": "https://github.com/symfony/console/tree/v6.1.4" }, "funding": [ { @@ -2577,7 +2347,7 @@ "type": "tidelift" } ], - "time": "2022-07-22T14:17:57+00:00" + "time": "2022-08-26T10:32:31+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2811,6 +2581,89 @@ ], "time": "2022-05-24T11:49:31+00:00" }, + { + "name": "symfony/polyfill-php80", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-05-10T07:21:04+00:00" + }, { "name": "symfony/process", "version": "v6.1.3", @@ -2959,16 +2812,16 @@ }, { "name": "symfony/string", - "version": "v6.1.3", + "version": "v6.1.4", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f35241f45c30bcd9046af2bb200a7086f70e1d6b" + "reference": "290972cad7b364e3befaa74ba0ec729800fb161c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f35241f45c30bcd9046af2bb200a7086f70e1d6b", - "reference": "f35241f45c30bcd9046af2bb200a7086f70e1d6b", + "url": "https://api.github.com/repos/symfony/string/zipball/290972cad7b364e3befaa74ba0ec729800fb161c", + "reference": "290972cad7b364e3befaa74ba0ec729800fb161c", "shasum": "" }, "require": { @@ -3024,7 +2877,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.3" + "source": "https://github.com/symfony/string/tree/v6.1.4" }, "funding": [ { @@ -3040,7 +2893,7 @@ "type": "tidelift" } ], - "time": "2022-07-27T15:50:51+00:00" + "time": "2022-08-12T18:05:43+00:00" }, { "name": "theseer/tokenizer", @@ -3091,64 +2944,6 @@ } ], "time": "2021-07-28T10:34:58+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" - }, - "time": "2022-06-03T18:03:27+00:00" } ], "aliases": [], diff --git a/tests/languages/cli/test.js b/tests/languages/cli/test.js index 4b14a1ac43..0c0f1116a3 100644 --- a/tests/languages/cli/test.js +++ b/tests/languages/cli/test.js @@ -1,6 +1,6 @@ const { exec, execSync } = require('child_process'); -execSync("node index client --endpoint 'https://8080-appwrite-appwrite-38xdl9d8529.ws-us62.gitpod.io/v1' --projectId console --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); +execSync("node index client --endpoint 'https://8080-appwrite-appwrite-7nqnl9rodfw.ws-eu63.gitpod.io/v1' --projectId console --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); var output; console.log('\nTest Started'); diff --git a/tests/resources/spec.json b/tests/resources/spec.json index 46d9d36cc3..cb62698e9a 100644 --- a/tests/resources/spec.json +++ b/tests/resources/spec.json @@ -15,7 +15,7 @@ "url": "https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE" } }, - "host": "8080-appwrite-appwrite-38xdl9d8529.ws-us62.gitpod.io", + "host": "8080-appwrite-appwrite-7nqnl9rodfw.ws-eu63.gitpod.io", "basePath": "/v1", "schemes": ["https"], "consumes": ["application/json", "multipart/form-data"], From c262abee2001149911665adc7de20c5acc97ba28 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 1 Sep 2022 09:57:24 +0000 Subject: [PATCH 364/555] feat: web chromium tests --- tests/WebChromiumTest.php | 6 ------ tests/languages/web/index.html | 9 +++++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/WebChromiumTest.php b/tests/WebChromiumTest.php index 018f4262be..b1d463e230 100644 --- a/tests/WebChromiumTest.php +++ b/tests/WebChromiumTest.php @@ -32,10 +32,4 @@ class WebChromiumTest extends Base ...Base::PERMISSION_HELPER_RESPONSES, ...Base::ID_HELPER_RESPONSES ]; - - public function setUp(): void - { - $headers = "x-sdk-name: {$this->sdkName}; x-sdk-platform: {$this->sdkPlatform}; x-sdk-language: {$this->sdkLanguage}; x-sdk-version: {$this->version}"; - array_push($this->expectedOutput, $headers, ...Base::REALTIME_RESPONSES); - } } diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index fab4ecbb9b..9d7056aa30 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -109,10 +109,8 @@ console.log(error.message); } - response = await general.headers(); - console.log(response.result); - - await Promise.resolve(resolve=>setTimeout(() => resolve, 5000)); + const delay = ms => new Promise(res => setTimeout(res, ms)); + await delay(5000); console.log(responseRealtime) // Query helper tests @@ -140,6 +138,9 @@ console.log(ID.unique()); console.log(ID.custom('custom_id')); + response = await general.headers(); + console.log(response.result); + }); From c1ff0348f51897be9af7f8a62fed49949bee69b0 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 1 Sep 2022 10:44:58 +0000 Subject: [PATCH 365/555] feat: update endpoint --- tests/languages/cli/test.js | 2 +- tests/resources/spec.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/languages/cli/test.js b/tests/languages/cli/test.js index 0c0f1116a3..c45f0ae7d3 100644 --- a/tests/languages/cli/test.js +++ b/tests/languages/cli/test.js @@ -1,6 +1,6 @@ const { exec, execSync } = require('child_process'); -execSync("node index client --endpoint 'https://8080-appwrite-appwrite-7nqnl9rodfw.ws-eu63.gitpod.io/v1' --projectId console --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); +execSync("node index client --endpoint 'https://appwrite.io/v1' --projectId console --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); var output; console.log('\nTest Started'); diff --git a/tests/resources/spec.json b/tests/resources/spec.json index cb62698e9a..784a037d6e 100644 --- a/tests/resources/spec.json +++ b/tests/resources/spec.json @@ -15,7 +15,7 @@ "url": "https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE" } }, - "host": "8080-appwrite-appwrite-7nqnl9rodfw.ws-eu63.gitpod.io", + "host": "appwrite.io", "basePath": "/v1", "schemes": ["https"], "consumes": ["application/json", "multipart/form-data"], From 9247a6d24a88d616faaa77d7499ee5ffb47bbf96 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 2 Sep 2022 09:08:21 +0000 Subject: [PATCH 366/555] fix model --- templates/dart/lib/src/models/model.dart.twig | 6 +++--- templates/dart/lib/src/models/model_base.dart.twig | 5 +++++ templates/flutter/lib/src/models/model.dart.twig | 14 +++++++------- 3 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 templates/dart/lib/src/models/model_base.dart.twig diff --git a/templates/dart/lib/src/models/model.dart.twig b/templates/dart/lib/src/models/model.dart.twig index 3338d97308..ffb66f293a 100644 --- a/templates/dart/lib/src/models/model.dart.twig +++ b/templates/dart/lib/src/models/model.dart.twig @@ -2,7 +2,7 @@ part of {{ language.params.packageName }}.models; /// {{ definition.description }} -class {{ definition.name | caseUcfirst | overrideIdentifier }} { +class {{ definition.name | caseUcfirst | overrideIdentifier }} implements Model { {% for property in definition.properties %} /// {{ property.description }} final {% if not property.required %}{{_self.sub_schema(property)}}? {{ property.name | escapeKeyword }}{% else %}{{_self.sub_schema(property)}} {{ property.name | escapeKeyword }}{% endif %}; @@ -11,14 +11,14 @@ class {{ definition.name | caseUcfirst | overrideIdentifier }} { final Map data; {% endif %} - {{ definition.name | caseUcfirst | overrideIdentifier}}({ + {{ definition.name | caseUcfirst | overrideIdentifier}}({% definition.properties | length %}{{% endif %} {% for property in definition.properties %}{% if property.required %} required {% endif %}this.{{ property.name | escapeKeyword }}, {% endfor %} {% if definition.additionalProperties %} required this.data, {% endif %} - }); + {% definition.properties | length %}}{% endif %}); factory {{ definition.name | caseUcfirst | overrideIdentifier}}.fromMap(Map map) { return {{ definition.name | caseUcfirst | overrideIdentifier }}( diff --git a/templates/dart/lib/src/models/model_base.dart.twig b/templates/dart/lib/src/models/model_base.dart.twig new file mode 100644 index 0000000000..eedb851c94 --- /dev/null +++ b/templates/dart/lib/src/models/model_base.dart.twig @@ -0,0 +1,5 @@ +part of {{ language.params.packageName }}.models; + +abstract class Model { + Map toMap(); +} \ No newline at end of file diff --git a/templates/flutter/lib/src/models/model.dart.twig b/templates/flutter/lib/src/models/model.dart.twig index 4c755857bc..02e83e8007 100644 --- a/templates/flutter/lib/src/models/model.dart.twig +++ b/templates/flutter/lib/src/models/model.dart.twig @@ -1,8 +1,8 @@ -{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst}}>{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}Map{% else %}{{property | typeName}}{% endif %}{% endif %}{% endmacro %} +{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst | overrideIdentifier}}>{% else %}{{property.sub_schema | caseUcfirst | overrideIdentifier }}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}Map{% else %}{{property | typeName}}{% endif %}{% endif %}{% endmacro %} part of {{ language.params.packageName }}.models; /// {{ definition.description }} -class {{ definition.name | caseUcfirst }} implements Model { +class {{ definition.name | caseUcfirst | overrideIdentifier }} implements Model { {% for property in definition.properties %} /// {{ property.description }} final {% if not property.required %}{{_self.sub_schema(property)}}? {{ property.name | escapeKeyword }}{% else %}{{_self.sub_schema(property)}} {{ property.name | escapeKeyword }}{% endif %}; @@ -11,19 +11,19 @@ class {{ definition.name | caseUcfirst }} implements Model { final Map data; {% endif %} - {{ definition.name | caseUcfirst}}({ + {{ definition.name | caseUcfirst | overrideIdentifier}}({% definition.properties | length %}{{% endif %} {% for property in definition.properties %}{% if property.required %} required {% endif %}this.{{ property.name | escapeKeyword }}, {% endfor %} {% if definition.additionalProperties %} required this.data, {% endif %} - }); + {% definition.properties | length %}}{% endif %}); - factory {{ definition.name | caseUcfirst}}.fromMap(Map map) { - return {{ definition.name | caseUcfirst }}( + factory {{ definition.name | caseUcfirst | overrideIdentifier}}.fromMap(Map map) { + return {{ definition.name | caseUcfirst | overrideIdentifier }}( {% for property in definition.properties %} - {{ property.name | escapeKeyword }}: {% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst}}>.from(map['{{property.name | escapeDollarSign }}'].map((p) => {{property.sub_schema | caseUcfirst}}.fromMap(p))){% else %}{{property.sub_schema | caseUcfirst}}.fromMap(map['{{property.name | escapeDollarSign }}']){% endif %}{% else %}map['{{property.name | escapeDollarSign }}']{% if property.type == "number" %}{% if not property.required %}?{% endif %}.toDouble(){% endif %}{% if property.type == "string" %}{% if not property.required %}?{% endif %}.toString(){% endif %}{% endif %}, + {{ property.name | escapeKeyword }}: {% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst | overrideIdentifier}}>.from(map['{{property.name | escapeDollarSign }}'].map((p) => {{property.sub_schema | caseUcfirst | overrideIdentifier}}.fromMap(p))){% else %}{{property.sub_schema | caseUcfirst | overrideIdentifier}}.fromMap(map['{{property.name | escapeDollarSign }}']){% endif %}{% else %}map['{{property.name | escapeDollarSign }}']{% if property.type == "number" %}{% if not property.required %}?{% endif %}.toDouble(){% endif %}{% if property.type == "string" %}{% if not property.required %}?{% endif %}.toString(){% endif %}{% endif %}, {% endfor %} {% if definition.additionalProperties %} data: map, From 5864931156d8ff92d5ac5a735959a74a31575932 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 2 Sep 2022 09:35:34 +0000 Subject: [PATCH 367/555] use common files from dart remove duplicate --- src/SDK/Language/Flutter.php | 156 +++++++++--------- templates/flutter/lib/id.dart.twig | 11 -- templates/flutter/lib/models.dart.twig | 6 - templates/flutter/lib/permission.dart.twig | 19 --- templates/flutter/lib/query.dart.twig | 44 ----- templates/flutter/lib/role.dart.twig | 30 ---- templates/flutter/lib/src/enums.dart.twig | 19 --- templates/flutter/lib/src/exception.dart.twig | 14 -- .../flutter/lib/src/input_file.dart.twig | 19 --- .../flutter/lib/src/models/model.dart.twig | 60 ------- .../lib/src/models/model_base.dart.twig | 5 - templates/flutter/lib/src/response.dart.twig | 15 -- templates/flutter/lib/src/service.dart.twig | 7 - .../flutter/lib/src/upload_progress.dart.twig | 67 -------- 14 files changed, 78 insertions(+), 394 deletions(-) delete mode 100644 templates/flutter/lib/id.dart.twig delete mode 100644 templates/flutter/lib/models.dart.twig delete mode 100644 templates/flutter/lib/permission.dart.twig delete mode 100644 templates/flutter/lib/query.dart.twig delete mode 100644 templates/flutter/lib/role.dart.twig delete mode 100644 templates/flutter/lib/src/enums.dart.twig delete mode 100644 templates/flutter/lib/src/exception.dart.twig delete mode 100644 templates/flutter/lib/src/input_file.dart.twig delete mode 100644 templates/flutter/lib/src/models/model.dart.twig delete mode 100644 templates/flutter/lib/src/models/model_base.dart.twig delete mode 100644 templates/flutter/lib/src/response.dart.twig delete mode 100644 templates/flutter/lib/src/service.dart.twig delete mode 100644 templates/flutter/lib/src/upload_progress.dart.twig diff --git a/src/SDK/Language/Flutter.php b/src/SDK/Language/Flutter.php index 3a3261defb..651224290b 100644 --- a/src/SDK/Language/Flutter.php +++ b/src/SDK/Language/Flutter.php @@ -25,6 +25,84 @@ public function getName() public function getFiles() { return [ + [ + 'scope' => 'default', + 'destination' => '/lib/src/response.dart', + 'template' => 'dart/lib/src/response.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/lib/src/service.dart', + 'template' => 'dart/lib/src/service.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/lib/src/models/model.dart', + 'template' => 'dart/lib/src/models/model_base.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/lib/src/enums.dart', + 'template' => 'dart/lib/src/enums.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/lib/src/exception.dart', + 'template' => 'dart/lib/src/exception.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/lib/src/upload_progress.dart', + 'template' => 'dart/lib/src/upload_progress.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/lib/models.dart', + 'template' => 'dart/lib/models.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/lib/permission.dart', + 'template' => 'dart/lib/permission.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/lib/role.dart', + 'template' => 'dart/lib/role.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/lib/id.dart', + 'template' => 'dart/lib/id.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => '/lib/query.dart', + 'template' => 'dart/lib/query.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'definition', + 'destination' => '/lib/src/models/{{definition.name | caseSnake }}.dart', + 'template' => 'dart/lib/src/models/model.dart.twig', + 'minify' => false, + ], + [ + 'scope' => 'default', + 'destination' => 'lib/src/input_file.dart', + 'template' => 'dart/lib/src/input_file.dart.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => 'README.md', @@ -163,12 +241,6 @@ public function getFiles() 'template' => 'flutter/lib/src/interceptor.dart.twig', 'minify' => false, ], - [ - 'scope' => 'default', - 'destination' => '/lib/src/response.dart', - 'template' => 'flutter/lib/src/response.dart.twig', - 'minify' => false, - ], [ 'scope' => 'default', 'destination' => '/lib/{{ language.params.packageName }}.dart', @@ -205,78 +277,12 @@ public function getFiles() 'template' => 'flutter/pubspec.yaml.twig', 'minify' => false, ], - [ - 'scope' => 'default', - 'destination' => '/lib/src/service.dart', - 'template' => 'flutter/lib/src/service.dart.twig', - 'minify' => false, - ], - [ - 'scope' => 'default', - 'destination' => '/lib/src/models/model.dart', - 'template' => 'flutter/lib/src/models/model_base.dart.twig', - 'minify' => false, - ], - [ - 'scope' => 'default', - 'destination' => '/lib/src/enums.dart', - 'template' => 'flutter/lib/src/enums.dart.twig', - 'minify' => false, - ], - [ - 'scope' => 'default', - 'destination' => '/lib/src/exception.dart', - 'template' => 'flutter/lib/src/exception.dart.twig', - 'minify' => false, - ], - [ - 'scope' => 'default', - 'destination' => '/lib/src/upload_progress.dart', - 'template' => 'dart/lib/src/upload_progress.dart.twig', - 'minify' => false, - ], - [ - 'scope' => 'default', - 'destination' => '/lib/models.dart', - 'template' => 'flutter/lib/models.dart.twig', - 'minify' => false, - ], - [ - 'scope' => 'default', - 'destination' => '/lib/permission.dart', - 'template' => 'flutter/lib/permission.dart.twig', - 'minify' => false, - ], - [ - 'scope' => 'default', - 'destination' => '/lib/role.dart', - 'template' => 'flutter/lib/role.dart.twig', - 'minify' => false, - ], - [ - 'scope' => 'default', - 'destination' => '/lib/id.dart', - 'template' => 'flutter/lib/id.dart.twig', - 'minify' => false, - ], - [ - 'scope' => 'default', - 'destination' => '/lib/query.dart', - 'template' => 'flutter/lib/query.dart.twig', - 'minify' => false, - ], [ 'scope' => 'service', 'destination' => '/lib/services/{{service.name | caseDash}}.dart', 'template' => 'flutter/lib/services/service.dart.twig', 'minify' => false, ], - [ - 'scope' => 'definition', - 'destination' => '/lib/src/models/{{definition.name | caseSnake }}.dart', - 'template' => '/flutter/lib/src/models/model.dart.twig', - 'minify' => false, - ], [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', @@ -289,12 +295,6 @@ public function getFiles() 'template' => 'flutter/.travis.yml.twig', 'minify' => false, ], - [ - 'scope' => 'default', - 'destination' => 'lib/src/input_file.dart', - 'template' => 'flutter/lib/src/input_file.dart.twig', - 'minify' => false, - ], ]; } } diff --git a/templates/flutter/lib/id.dart.twig b/templates/flutter/lib/id.dart.twig deleted file mode 100644 index 12a034738d..0000000000 --- a/templates/flutter/lib/id.dart.twig +++ /dev/null @@ -1,11 +0,0 @@ -part of {{ language.params.packageName }}; - -class ID { - static String unique() { - return 'unique()'; - } - - static String custom(String id) { - return id; - } -} \ No newline at end of file diff --git a/templates/flutter/lib/models.dart.twig b/templates/flutter/lib/models.dart.twig deleted file mode 100644 index da68b7f326..0000000000 --- a/templates/flutter/lib/models.dart.twig +++ /dev/null @@ -1,6 +0,0 @@ -library {{ language.params.packageName }}.models; - -part 'src/models/model.dart'; -{% for definition in spec.definitions %} -part 'src/models/{{definition.name | caseSnake}}.dart'; -{% endfor %} \ No newline at end of file diff --git a/templates/flutter/lib/permission.dart.twig b/templates/flutter/lib/permission.dart.twig deleted file mode 100644 index 675d8184b3..0000000000 --- a/templates/flutter/lib/permission.dart.twig +++ /dev/null @@ -1,19 +0,0 @@ -part of {{ language.params.packageName }}; - -class Permission { - static String read(String role) { - return 'read("$role")'; - } - static String write(String role) { - return 'write("$role")'; - } - static String create(String role) { - return 'create("$role")'; - } - static String update(String role) { - return 'update("$role")'; - } - static String delete(String role) { - return 'delete("$role")'; - } -} diff --git a/templates/flutter/lib/query.dart.twig b/templates/flutter/lib/query.dart.twig deleted file mode 100644 index bcbf94fd1f..0000000000 --- a/templates/flutter/lib/query.dart.twig +++ /dev/null @@ -1,44 +0,0 @@ -part of {{ language.params.packageName }}; - -class Query { - static equal(String attribute, dynamic value) => - _addQuery(attribute, 'equal', value); - - static notEqual(String attribute, dynamic value) => - _addQuery(attribute, 'notEqual', value); - - static lessThan(String attribute, dynamic value) => - _addQuery(attribute, 'lessThan', value); - - static lessThanEqual(String attribute, dynamic value) => - _addQuery(attribute, 'lessThanEqual', value); - - static greaterThan(String attribute, dynamic value) => - _addQuery(attribute, 'greaterThan', value); - - static greaterThanEqual(String attribute, dynamic value) => - _addQuery(attribute, 'greaterThanEqual', value); - - static search(String attribute, String value) => - _addQuery(attribute, 'search', value); - - static String orderAsc(String attribute) => 'orderAsc("$attribute")'; - - static String orderDesc(String attribute) => 'orderDesc("$attribute")'; - - static String cursorBefore(String id) => 'cursorBefore("$id")'; - - static String cursorAfter(String id) => 'cursorAfter("$id")'; - - static String limit(int limit) => 'limit($limit)'; - - static String offset(int offset) => 'offset($offset)'; - - static String _addQuery(String attribute, String method, dynamic value) => (value - is List) - ? '$method("$attribute", [${value.map((item) => parseValues(item)).join(",")}])' - : '$method("$attribute", [${parseValues(value)}])'; - - static String parseValues(dynamic value) => - (value is String) ? '"$value"' : '$value'; -} diff --git a/templates/flutter/lib/role.dart.twig b/templates/flutter/lib/role.dart.twig deleted file mode 100644 index 65ebf83657..0000000000 --- a/templates/flutter/lib/role.dart.twig +++ /dev/null @@ -1,30 +0,0 @@ -part of {{ language.params.packageName }}; - -class Role { - static String any() { - return 'any'; - } - - static String user(String id) { - return 'user:$id'; - } - - static String users() { - return 'users'; - } - - static String guests() { - return 'guests'; - } - - static String team(String id, [String role = '']) { - if(role.isEmpty) { - return 'team:$id'; - } - return 'team:$id/$role'; - } - - static String status(String status) { - return 'status:$status'; - } -} \ No newline at end of file diff --git a/templates/flutter/lib/src/enums.dart.twig b/templates/flutter/lib/src/enums.dart.twig deleted file mode 100644 index 9f84bd9392..0000000000 --- a/templates/flutter/lib/src/enums.dart.twig +++ /dev/null @@ -1,19 +0,0 @@ -enum HttpMethod { get, post, put, delete, patch } - -extension HttpMethodString on HttpMethod { - String name() { - return toString().split('.').last.toUpperCase(); - } -} - -enum ResponseType { - /// Transform the response data to JSON object only when the - /// content-type of response is "application/json" . - json, - - /// Transform the response data to a String encoded with UTF8. - plain, - - /// Get original bytes, the type of response will be List - bytes -} diff --git a/templates/flutter/lib/src/exception.dart.twig b/templates/flutter/lib/src/exception.dart.twig deleted file mode 100644 index 2ff0c07b85..0000000000 --- a/templates/flutter/lib/src/exception.dart.twig +++ /dev/null @@ -1,14 +0,0 @@ -class {{spec.title | caseUcfirst}}Exception implements Exception { - final String? message; - final int? code; - final String? type; - final dynamic response; - - {{spec.title | caseUcfirst}}Exception([this.message = "", this.code, this.type, this.response]); - - @override - String toString() { - if (message == null) return "{{spec.title | caseUcfirst}}Exception"; - return "{{spec.title | caseUcfirst}}Exception: $type, $message (${code ?? 0})"; - } -} diff --git a/templates/flutter/lib/src/input_file.dart.twig b/templates/flutter/lib/src/input_file.dart.twig deleted file mode 100644 index ef5e7be144..0000000000 --- a/templates/flutter/lib/src/input_file.dart.twig +++ /dev/null @@ -1,19 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'exception.dart'; - -class InputFile { - late final String? path; - late final List? bytes; - final String? filename; - final String? contentType; - - /// Provide a file, use `path` for IO platforms - /// and provide `bytes` for web platform - InputFile({this.path, this.filename, this.contentType, this.bytes}) { - if (kIsWeb && bytes == null) { - throw {{ spec.title | caseUcfirst }}Exception('On web `bytes` is required'); - } else if(!kIsWeb && path == null && bytes == null) { - throw {{ spec.title | caseUcfirst }}Exception('On IO platforms one of `path` or `bytes` is required'); - } - } -} diff --git a/templates/flutter/lib/src/models/model.dart.twig b/templates/flutter/lib/src/models/model.dart.twig deleted file mode 100644 index 02e83e8007..0000000000 --- a/templates/flutter/lib/src/models/model.dart.twig +++ /dev/null @@ -1,60 +0,0 @@ -{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst | overrideIdentifier}}>{% else %}{{property.sub_schema | caseUcfirst | overrideIdentifier }}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}Map{% else %}{{property | typeName}}{% endif %}{% endif %}{% endmacro %} -part of {{ language.params.packageName }}.models; - -/// {{ definition.description }} -class {{ definition.name | caseUcfirst | overrideIdentifier }} implements Model { -{% for property in definition.properties %} - /// {{ property.description }} - final {% if not property.required %}{{_self.sub_schema(property)}}? {{ property.name | escapeKeyword }}{% else %}{{_self.sub_schema(property)}} {{ property.name | escapeKeyword }}{% endif %}; -{% endfor %} -{% if definition.additionalProperties %} - final Map data; -{% endif %} - - {{ definition.name | caseUcfirst | overrideIdentifier}}({% definition.properties | length %}{{% endif %} -{% for property in definition.properties %}{% if property.required %} - required {% endif %}this.{{ property.name | escapeKeyword }}, -{% endfor %} -{% if definition.additionalProperties %} - required this.data, -{% endif %} - {% definition.properties | length %}}{% endif %}); - - factory {{ definition.name | caseUcfirst | overrideIdentifier}}.fromMap(Map map) { - return {{ definition.name | caseUcfirst | overrideIdentifier }}( -{% for property in definition.properties %} - {{ property.name | escapeKeyword }}: {% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst | overrideIdentifier}}>.from(map['{{property.name | escapeDollarSign }}'].map((p) => {{property.sub_schema | caseUcfirst | overrideIdentifier}}.fromMap(p))){% else %}{{property.sub_schema | caseUcfirst | overrideIdentifier}}.fromMap(map['{{property.name | escapeDollarSign }}']){% endif %}{% else %}map['{{property.name | escapeDollarSign }}']{% if property.type == "number" %}{% if not property.required %}?{% endif %}.toDouble(){% endif %}{% if property.type == "string" %}{% if not property.required %}?{% endif %}.toString(){% endif %}{% endif %}, -{% endfor %} -{% if definition.additionalProperties %} - data: map, -{% endif %} - ); - } - - @override - Map toMap() { - return { -{% for property in definition.properties %} - "{{ property.name | escapeDollarSign }}": {% if property.sub_schema %}{% if property.type == 'array' %}{{property.name | escapeKeyword}}.map((p) => p.toMap()){% else %}{{property.name | escapeKeyword}}.toMap(){% endif %}{% else %}{{property.name | escapeKeyword }}{% endif %}, -{% endfor %} -{% if definition.additionalProperties %} - "data": data, -{% endif %} - }; - } -{% if definition.additionalProperties %} - - T convertTo(T Function(Map) fromJson) => fromJson(data); -{% endif %} -{% for property in definition.properties %} -{% if property.sub_schema %} -{% for def in spec.definitions %} -{% if def.name == property.sub_schema and def.additionalProperties and property.type == 'array' %} - - List convertTo(T Function(Map) fromJson) => - {{property.name}}.map((d) => d.convertTo(fromJson)).toList(); -{% endif %} -{% endfor %} -{% endif %} -{% endfor %} -} diff --git a/templates/flutter/lib/src/models/model_base.dart.twig b/templates/flutter/lib/src/models/model_base.dart.twig deleted file mode 100644 index eedb851c94..0000000000 --- a/templates/flutter/lib/src/models/model_base.dart.twig +++ /dev/null @@ -1,5 +0,0 @@ -part of {{ language.params.packageName }}.models; - -abstract class Model { - Map toMap(); -} \ No newline at end of file diff --git a/templates/flutter/lib/src/response.dart.twig b/templates/flutter/lib/src/response.dart.twig deleted file mode 100644 index bf4eea3f1b..0000000000 --- a/templates/flutter/lib/src/response.dart.twig +++ /dev/null @@ -1,15 +0,0 @@ -import 'dart:convert'; - -class Response { - Response({this.data}); - - T? data; - - @override - String toString() { - if (data is Map) { - return json.encode(data); - } - return data.toString(); - } -} diff --git a/templates/flutter/lib/src/service.dart.twig b/templates/flutter/lib/src/service.dart.twig deleted file mode 100644 index 1ae319b705..0000000000 --- a/templates/flutter/lib/src/service.dart.twig +++ /dev/null @@ -1,7 +0,0 @@ -import 'client.dart'; - -class Service { - final Client client; - - const Service(this.client); -} diff --git a/templates/flutter/lib/src/upload_progress.dart.twig b/templates/flutter/lib/src/upload_progress.dart.twig deleted file mode 100644 index 4ed965d2dc..0000000000 --- a/templates/flutter/lib/src/upload_progress.dart.twig +++ /dev/null @@ -1,67 +0,0 @@ -import 'dart:convert'; - -class UploadProgress { - final String $id; - final double progress; - final int sizeUploaded; - final int chunksTotal; - final int chunksUploaded; - UploadProgress({ - required this.$id, - required this.progress, - required this.sizeUploaded, - required this.chunksTotal, - required this.chunksUploaded, - }); - - factory UploadProgress.fromMap(Map map) { - return UploadProgress( - $id: map['\$id'] ?? '', - progress: map['progress']?.toDouble() ?? 0.0, - sizeUploaded: map['sizeUploaded']?.toInt() ?? 0, - chunksTotal: map['chunksTotal']?.toInt() ?? 0, - chunksUploaded: map['chunksUploaded']?.toInt() ?? 0, - ); - } - - Map toMap() { - return { - "\$id": $id, - "progress": progress, - "sizeUploaded": sizeUploaded, - "chunksTotal": chunksTotal, - "chunksUploaded": chunksUploaded - }; - } - - String toJson() => json.encode(toMap()); - - factory UploadProgress.fromJson(String source) => - UploadProgress.fromMap(json.decode(source)); - - @override - String toString() { - return 'UploadProgress(\$id: ${$id}, progress: $progress, sizeUploaded: $sizeUploaded, chunksTotal: $chunksTotal, chunksUploaded: $chunksUploaded)'; - } - - @override - bool operator ==(Object other) { - if (identical(this, other)) return true; - - return other is UploadProgress && - other.$id == $id && - other.progress == progress && - other.sizeUploaded == sizeUploaded && - other.chunksTotal == chunksTotal && - other.chunksUploaded == chunksUploaded; - } - - @override - int get hashCode { - return $id.hashCode ^ - progress.hashCode ^ - sizeUploaded.hashCode ^ - chunksTotal.hashCode ^ - chunksUploaded.hashCode; - } -} From 2d3bb0c178e274843d2b20d12c50ca44371d8fd1 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 2 Sep 2022 09:44:08 +0000 Subject: [PATCH 368/555] fix path error --- src/SDK/Language/Dart.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index 9040855fe7..f36a084cdb 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -350,13 +350,13 @@ public function getFiles() [ 'scope' => 'default', 'destination' => '/lib/role.dart', - 'template' => 'flutter/lib/role.dart.twig', + 'template' => 'dart/lib/role.dart.twig', 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/id.dart', - 'template' => 'flutter/lib/id.dart.twig', + 'template' => 'dart/lib/id.dart.twig', 'minify' => false, ], [ From 4077396293bd65f7e8b052e00fe4aff07906eaec Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 2 Sep 2022 09:47:59 +0000 Subject: [PATCH 369/555] fix dart template issue --- templates/dart/lib/src/models/model.dart.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/dart/lib/src/models/model.dart.twig b/templates/dart/lib/src/models/model.dart.twig index ffb66f293a..e1eb84fcf9 100644 --- a/templates/dart/lib/src/models/model.dart.twig +++ b/templates/dart/lib/src/models/model.dart.twig @@ -11,14 +11,14 @@ class {{ definition.name | caseUcfirst | overrideIdentifier }} implements Model final Map data; {% endif %} - {{ definition.name | caseUcfirst | overrideIdentifier}}({% definition.properties | length %}{{% endif %} + {{ definition.name | caseUcfirst | overrideIdentifier}}({% if definition.properties | length %}{{ '{' }}{% endif %} {% for property in definition.properties %}{% if property.required %} required {% endif %}this.{{ property.name | escapeKeyword }}, {% endfor %} {% if definition.additionalProperties %} required this.data, {% endif %} - {% definition.properties | length %}}{% endif %}); + {% if definition.properties | length %}{{ '}' }}{% endif %}); factory {{ definition.name | caseUcfirst | overrideIdentifier}}.fromMap(Map map) { return {{ definition.name | caseUcfirst | overrideIdentifier }}( From 64caf1d27540aba4b3fceedf4f54975058c7f3d4 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 2 Sep 2022 10:23:51 +0000 Subject: [PATCH 370/555] fix additional property models --- templates/dart/lib/src/models/model.dart.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/dart/lib/src/models/model.dart.twig b/templates/dart/lib/src/models/model.dart.twig index e1eb84fcf9..74677d687e 100644 --- a/templates/dart/lib/src/models/model.dart.twig +++ b/templates/dart/lib/src/models/model.dart.twig @@ -11,7 +11,7 @@ class {{ definition.name | caseUcfirst | overrideIdentifier }} implements Model final Map data; {% endif %} - {{ definition.name | caseUcfirst | overrideIdentifier}}({% if definition.properties | length %}{{ '{' }}{% endif %} + {{ definition.name | caseUcfirst | overrideIdentifier}}({% if definition.properties | length or definition.additionalProperties %}{{ '{' }}{% endif %} {% for property in definition.properties %}{% if property.required %} required {% endif %}this.{{ property.name | escapeKeyword }}, {% endfor %} From 14e486f55bff98d33e4486cefbc6a9fd919ef55a Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 2 Sep 2022 10:27:28 +0000 Subject: [PATCH 371/555] fix model --- templates/dart/lib/models.dart.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/dart/lib/models.dart.twig b/templates/dart/lib/models.dart.twig index b617be3e0f..900e368eaa 100644 --- a/templates/dart/lib/models.dart.twig +++ b/templates/dart/lib/models.dart.twig @@ -1,5 +1,6 @@ library {{ language.params.packageName }}.models; +part src/models/model.dart; {% for definition in spec.definitions %} part 'src/models/{{definition.name | caseSnake}}.dart'; {% endfor %} \ No newline at end of file From 78bf4c322cddb6145c7e90b4987ea8a2449e87be Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 2 Sep 2022 10:28:45 +0000 Subject: [PATCH 372/555] add missing quote --- templates/dart/lib/models.dart.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/dart/lib/models.dart.twig b/templates/dart/lib/models.dart.twig index 900e368eaa..da68b7f326 100644 --- a/templates/dart/lib/models.dart.twig +++ b/templates/dart/lib/models.dart.twig @@ -1,6 +1,6 @@ library {{ language.params.packageName }}.models; -part src/models/model.dart; +part 'src/models/model.dart'; {% for definition in spec.definitions %} part 'src/models/{{definition.name | caseSnake}}.dart'; {% endfor %} \ No newline at end of file From cf787db37a62ece2fa13c93969ee0ad308fb1bf3 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 2 Sep 2022 10:31:48 +0000 Subject: [PATCH 373/555] fix end bracket --- templates/dart/lib/src/models/model.dart.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/dart/lib/src/models/model.dart.twig b/templates/dart/lib/src/models/model.dart.twig index 74677d687e..ece1f9cff0 100644 --- a/templates/dart/lib/src/models/model.dart.twig +++ b/templates/dart/lib/src/models/model.dart.twig @@ -18,7 +18,7 @@ class {{ definition.name | caseUcfirst | overrideIdentifier }} implements Model {% if definition.additionalProperties %} required this.data, {% endif %} - {% if definition.properties | length %}{{ '}' }}{% endif %}); + {% if definition.properties | length or definition.additionalProperties %}{{ '}' }}{% endif %}); factory {{ definition.name | caseUcfirst | overrideIdentifier}}.fromMap(Map map) { return {{ definition.name | caseUcfirst | overrideIdentifier }}( From bd70e81017e56daa4eab47092ca0883795c8a4c6 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 2 Sep 2022 10:38:32 +0000 Subject: [PATCH 374/555] fix base model --- src/SDK/Language/Dart.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index f36a084cdb..17d0d817e0 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -401,6 +401,12 @@ public function getFiles() 'template' => 'dart/lib/src/enums.dart.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '/lib/src/models/model.dart', + 'template' => 'dart/lib/src/models/model_base.dart.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/lib/models.dart', From 566eb027e77a8aebc408c7cb45df78fbbe8815a9 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 2 Sep 2022 10:48:07 +0000 Subject: [PATCH 375/555] fix white spacing --- templates/flutter/lib/services/service.dart.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/lib/services/service.dart.twig b/templates/flutter/lib/services/service.dart.twig index 99c14c0657..7c649609c5 100644 --- a/templates/flutter/lib/services/service.dart.twig +++ b/templates/flutter/lib/services/service.dart.twig @@ -20,7 +20,7 @@ class {{ service.name | caseUcfirst }} extends Service { {{ method.description|dartComment }} /// {% endif %} - {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %} Future {% else %} {% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all, method.consumes) }}) async { + {% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %}Future{% else %}{% if method.responseModel and method.responseModel != 'any' %}Future{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel }}({{ _self.method_parameters(method.parameters.all, method.consumes) }}) async { {% if method.parameters.path | length > 0 %}final{% else %}const{% endif %} String path = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | overrideIdentifier }}){% endfor %}; {% if 'multipart/form-data' in method.consumes %} From 5949f8b9338d1ebb17d3bf7bb990d9fe27efd892 Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi Date: Fri, 2 Sep 2022 18:43:51 +0530 Subject: [PATCH 376/555] bump flutter_web_auth_2 dependencies --- templates/flutter/pubspec.yaml.twig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 8135834c97..3c05e712ad 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -13,12 +13,17 @@ dependencies: sdk: flutter cookie_jar: ^3.0.1 device_info_plus: ^4.1.2 - flutter_web_auth_2: ^1.0.1 + flutter_web_auth_2: ^1.1.1 http: ^0.13.5 package_info_plus: ^1.4.3+1 path_provider: ^2.0.11 web_socket_channel: ^2.2.0 +# cause device_info_plus depends on 2.7.0 and flutter_web_auth_2 depends on 3.0.0, +# you may get version conflict error. And flutter_web_auth_2 latest version supports windows implementation +dependency_overrides: + win32: '2.7.0' + dev_dependencies: flutter_lints: ^2.0.1 flutter_test: From 388b30cd4b011b84be04e56fb47df5ec40b3f6f8 Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi Date: Fri, 2 Sep 2022 18:45:18 +0530 Subject: [PATCH 377/555] update comments --- templates/flutter/pubspec.yaml.twig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 3c05e712ad..e6ae079a81 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -19,8 +19,7 @@ dependencies: path_provider: ^2.0.11 web_socket_channel: ^2.2.0 -# cause device_info_plus depends on 2.7.0 and flutter_web_auth_2 depends on 3.0.0, -# you may get version conflict error. And flutter_web_auth_2 latest version supports windows implementation +# TODO: Remove this when device_info_plus bumps their dependency of win32 to 3.0.0 dependency_overrides: win32: '2.7.0' From a56a1fd168dec7637dcc046aa22c6e4453e14e4f Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi Date: Sat, 3 Sep 2022 21:42:47 +0530 Subject: [PATCH 378/555] doesn't need override anymore --- templates/flutter/pubspec.yaml.twig | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index e6ae079a81..8715b932bd 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -13,15 +13,12 @@ dependencies: sdk: flutter cookie_jar: ^3.0.1 device_info_plus: ^4.1.2 - flutter_web_auth_2: ^1.1.1 + flutter_web_auth_2: ^1.1.2 http: ^0.13.5 package_info_plus: ^1.4.3+1 path_provider: ^2.0.11 web_socket_channel: ^2.2.0 -# TODO: Remove this when device_info_plus bumps their dependency of win32 to 3.0.0 -dependency_overrides: - win32: '2.7.0' dev_dependencies: flutter_lints: ^2.0.1 From bb1b46ed644dced72c072ee59271203250f4c3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sat, 3 Sep 2022 16:28:28 +0000 Subject: [PATCH 379/555] Fix PHP param syntax --- src/SDK/Language/PHP.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index fed234bc37..28a2ed7568 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -238,7 +238,8 @@ public function getTypeName(array $parameter): string { switch ($parameter['type']) { case self::TYPE_STRING: - return 'string'; + $type = 'string'; + break; case self::TYPE_BOOLEAN: $type = 'bool'; break; From 74506d41d8ad2dacc183f2ca3977bb0fb42538ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sat, 3 Sep 2022 17:16:25 +0000 Subject: [PATCH 380/555] Proper CI/CD test --- tests/resources/spec.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/resources/spec.json b/tests/resources/spec.json index 784a037d6e..d43cd3e06b 100644 --- a/tests/resources/spec.json +++ b/tests/resources/spec.json @@ -15,7 +15,7 @@ "url": "https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE" } }, - "host": "appwrite.io", + "host": "8080-appwrite-appwrite-9sq3uhpjmvx.ws-eu63.gitpod.io", "basePath": "/v1", "schemes": ["https"], "consumes": ["application/json", "multipart/form-data"], From 0094270632c789d76648759203593808f34c2118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sat, 3 Sep 2022 17:53:21 +0000 Subject: [PATCH 381/555] Revert testing value --- tests/resources/spec.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/resources/spec.json b/tests/resources/spec.json index d43cd3e06b..784a037d6e 100644 --- a/tests/resources/spec.json +++ b/tests/resources/spec.json @@ -15,7 +15,7 @@ "url": "https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE" } }, - "host": "8080-appwrite-appwrite-9sq3uhpjmvx.ws-eu63.gitpod.io", + "host": "appwrite.io", "basePath": "/v1", "schemes": ["https"], "consumes": ["application/json", "multipart/form-data"], From 89a67171ffa2068136027b07e59dab9a9f4b46ba Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sun, 4 Sep 2022 16:19:25 +0000 Subject: [PATCH 382/555] chore: change branch for tests --- tests/languages/cli/test.js | 2 +- tests/resources/spec.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/languages/cli/test.js b/tests/languages/cli/test.js index c45f0ae7d3..6c814738e8 100644 --- a/tests/languages/cli/test.js +++ b/tests/languages/cli/test.js @@ -1,6 +1,6 @@ const { exec, execSync } = require('child_process'); -execSync("node index client --endpoint 'https://appwrite.io/v1' --projectId console --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); +execSync("node index client --endpoint 'https://stage.appwrite.io/v1' --projectId console --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); var output; console.log('\nTest Started'); diff --git a/tests/resources/spec.json b/tests/resources/spec.json index 784a037d6e..fae575b37a 100644 --- a/tests/resources/spec.json +++ b/tests/resources/spec.json @@ -15,7 +15,7 @@ "url": "https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE" } }, - "host": "appwrite.io", + "host": "stage.appwrite.io", "basePath": "/v1", "schemes": ["https"], "consumes": ["application/json", "multipart/form-data"], From ee638890a92f9003c500cd11f6f571f5a59f51fa Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sun, 4 Sep 2022 17:10:51 +0000 Subject: [PATCH 383/555] update test assertion message --- composer.lock | 12 ++++++------ tests/Base.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.lock b/composer.lock index d2dcc22cd4..0381552995 100644 --- a/composer.lock +++ b/composer.lock @@ -655,16 +655,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.14.0", + "version": "v4.15.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", "shasum": "" }, "require": { @@ -705,9 +705,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" }, - "time": "2022-05-31T20:59:12+00:00" + "time": "2022-09-04T07:30:47+00:00" }, { "name": "phar-io/manifest", diff --git a/tests/Base.php b/tests/Base.php index 8033b09ca6..f3e3bc07b5 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -50,7 +50,7 @@ abstract class Base extends TestCase const EXCEPTION_RESPONSES = [ 'Mock 400 error', - 'Server Error', + 'Mock 500 error', 'This is a text error', ]; From 40d9b2df581f2262ec9999aa6ed5801bb95f479b Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 5 Sep 2022 00:20:55 +0000 Subject: [PATCH 384/555] fix models spacing --- templates/dart/lib/src/models/model.dart.twig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/dart/lib/src/models/model.dart.twig b/templates/dart/lib/src/models/model.dart.twig index ece1f9cff0..325cba6335 100644 --- a/templates/dart/lib/src/models/model.dart.twig +++ b/templates/dart/lib/src/models/model.dart.twig @@ -12,8 +12,9 @@ class {{ definition.name | caseUcfirst | overrideIdentifier }} implements Model {% endif %} {{ definition.name | caseUcfirst | overrideIdentifier}}({% if definition.properties | length or definition.additionalProperties %}{{ '{' }}{% endif %} -{% for property in definition.properties %}{% if property.required %} - required {% endif %}this.{{ property.name | escapeKeyword }}, + +{% for property in definition.properties %} + {% if property.required %}required {% endif %}this.{{ property.name | escapeKeyword }}, {% endfor %} {% if definition.additionalProperties %} required this.data, From 29ba5bc69d03200baa3e03f687f0e631a77cc7c8 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 6 Sep 2022 05:10:31 +0000 Subject: [PATCH 385/555] fix realtime timestamp data type --- templates/flutter/lib/src/realtime_message.dart.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/flutter/lib/src/realtime_message.dart.twig b/templates/flutter/lib/src/realtime_message.dart.twig index 1460fe461d..9e7b8793c9 100644 --- a/templates/flutter/lib/src/realtime_message.dart.twig +++ b/templates/flutter/lib/src/realtime_message.dart.twig @@ -5,7 +5,7 @@ class RealtimeMessage { final List events; final Map payload; final List channels; - final int timestamp; + final String timestamp; RealtimeMessage({ required this.events, required this.payload, @@ -17,7 +17,7 @@ class RealtimeMessage { List? events, Map? payload, List? channels, - int? timestamp, + String? timestamp, }) { return RealtimeMessage( events: events ?? this.events, From d679b50b09bd93ea750179ad17c401b294a929f0 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 6 Sep 2022 05:30:01 +0000 Subject: [PATCH 386/555] fix array of submodels --- templates/dart/lib/src/models/model.dart.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/dart/lib/src/models/model.dart.twig b/templates/dart/lib/src/models/model.dart.twig index 325cba6335..dfe1991187 100644 --- a/templates/dart/lib/src/models/model.dart.twig +++ b/templates/dart/lib/src/models/model.dart.twig @@ -35,7 +35,7 @@ class {{ definition.name | caseUcfirst | overrideIdentifier }} implements Model Map toMap() { return { {% for property in definition.properties %} - "{{ property.name | escapeDollarSign }}": {% if property.sub_schema %}{% if property.type == 'array' %}{{property.name | escapeKeyword}}.map((p) => p.toMap()){% else %}{{property.name | escapeKeyword}}.toMap(){% endif %}{% else %}{{property.name | escapeKeyword }}{% endif %}, + "{{ property.name | escapeDollarSign }}": {% if property.sub_schema %}{% if property.type == 'array' %}{{property.name | escapeKeyword}}.map((p) => p.toMap()).toList(){% else %}{{property.name | escapeKeyword}}.toMap(){% endif %}{% else %}{{property.name | escapeKeyword }}{% endif %}, {% endfor %} {% if definition.additionalProperties %} "data": data, From 3c1bbfd29bfc21c6bc6639299298d5f14a2df30d Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 6 Sep 2022 17:53:34 +1200 Subject: [PATCH 387/555] Allow NPM RC deployments --- templates/cli/.github/workflows/npm-publish.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/templates/cli/.github/workflows/npm-publish.yml b/templates/cli/.github/workflows/npm-publish.yml index d74ebb51cb..d4184aadcf 100644 --- a/templates/cli/.github/workflows/npm-publish.yml +++ b/templates/cli/.github/workflows/npm-publish.yml @@ -31,7 +31,14 @@ jobs: npm run mac-x64 npm run mac-arm64 - name: Publish NPM library - run: npm publish + run: | + if ${{ contains(github.event.release.tag_name, '-RC') }}; then + echo "Publishing Release Candidate ${{ github.event.release.tag_name}} to NPM" + npm publish --tag next + else + echo "Publishing ${{ github.event.release.tag_name}} to NPM" + npm publish + fi env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - uses: fnkr/github-action-ghr@v1 From 260e1a6141e8a45397679c4a03be95aa5d897110 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 6 Sep 2022 18:41:44 +1200 Subject: [PATCH 388/555] Fix Kotlin models with no properties --- .../kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig index e7803dbfba..24d0a342cf 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig @@ -6,6 +6,9 @@ import com.google.gson.annotations.SerializedName /** * {{ definition.description }} */ +{% if definition.properties | length == 0 %} +class {{ definition.name | caseUcfirst }} {} +{% else %} data class {{ definition.name | caseUcfirst }}( {% for property in definition.properties %} /** @@ -59,4 +62,5 @@ data class {{ definition.name | caseUcfirst }}( {% endfor %} {% endif %} {% endfor %} -} \ No newline at end of file +} +{% endif %} \ No newline at end of file From e6b8fcce87420cb52236bf859b5774c37b93e127 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 6 Sep 2022 07:56:38 +0000 Subject: [PATCH 389/555] using 1.0 RC spec --- specs/swagger2-latest-console.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/swagger2-latest-console.json b/specs/swagger2-latest-console.json index a3c749bc4d..21cf7d1930 100644 --- a/specs/swagger2-latest-console.json +++ b/specs/swagger2-latest-console.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"version":"0.15.2","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@appwrite.io"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"HOSTNAME","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":52,"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":40,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":59,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":51,"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":100,"rate-time":3600,"rate-key":"url:{url},userId:{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":55,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":57,"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, Team Invites and Magic URL, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":58,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/phone":{"patch":{"summary":"Update Account Phone","operationId":"accountUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](\/docs\/client\/account#accountCreatePhoneVerification) endpoint to send a confirmation SMS.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":60,"cookies":false,"type":"","demo":"account\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["number","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":53,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":61,"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":{},"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":66,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":67,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":54,"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":[]}]},"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":65,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":50,"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\/email":{"post":{"summary":"Create Account Session with Email","operationId":"accountCreateEmailSession","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":"createEmailSession","weight":41,"cookies":false,"type":"","demo":"account\/create-email-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email.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 at least 8 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/sessions\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":46,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":47,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":42,"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, auth0, autodesk, bitbucket, bitly, box, dailymotion, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, notion, okta, paypal, paypalSandbox, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoom.","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":"","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":"","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/phone":{"post":{"summary":"Create Phone session","operationId":"accountCreatePhoneSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [PUT \/account\/sessions\/phone](\/docs\/client\/account#accountUpdatePhoneSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneSession","weight":48,"cookies":false,"type":"","demo":"account\/create-phone-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"number":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null}},"required":["userId","number"]}}]},"put":{"summary":"Create Phone session (confirmation)","operationId":"accountUpdatePhoneSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating a session with SMS. Use the **userId** from the [createPhoneSession](\/docs\/client\/account#accountCreatePhoneSession) endpoint and the **secret** received via SMS to successfully update and confirm the phone session.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updatePhoneSession","weight":49,"cookies":false,"type":"","demo":"account\/update-phone-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/sessions\/{sessionId}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":56,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to \"refresh\" the access token.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":64,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":63,"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 ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/status":{"patch":{"summary":"Update Account Status","operationId":"accountUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":62,"cookies":false,"type":"","demo":"account\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/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#accountUpdateEmailVerification). 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":68,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":69,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/verification\/phone":{"post":{"summary":"Create Phone Verification","operationId":"accountCreatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](\/docs\/client\/account#accountUpdatePhone) endpoint. Learn more about how to [complete the verification process](\/docs\/client\/account#accountUpdatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneVerification","weight":70,"cookies":false,"type":"","demo":"account\/create-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]},"put":{"summary":"Create Phone Verification (confirmation)","operationId":"accountUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":71,"cookies":false,"type":"","demo":"account\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"avatarsGetBrowser","consumes":["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 [GET \/account\/sessions](\/docs\/client\/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":73,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":72,"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":76,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":74,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":75,"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. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":78,"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.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":77,"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 1 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":1,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/databases":{"get":{"summary":"List Databases","operationId":"databasesList","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.","responses":{"200":{"description":"Databases List","schema":{"$ref":"#\/definitions\/databaseList"}}},"x-appwrite":{"method":"list","weight":80,"cookies":false,"type":"","demo":"databases\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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 Database","operationId":"databasesCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a new Database.\n","responses":{"201":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"create","weight":79,"cookies":false,"type":"","demo":"databases\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"databaseId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DATABASE_ID]","x-global":true},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["databaseId","name"]}}]}},"\/databases\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databasesGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageDatabases","schema":{"$ref":"#\/definitions\/usageDatabases"}}},"x-appwrite":{"method":"getUsage","weight":112,"cookies":false,"type":"","demo":"databases\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"`Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/databases\/{databaseId}":{"get":{"summary":"Get Database","operationId":"databasesGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.","responses":{"200":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"get","weight":81,"cookies":false,"type":"","demo":"databases\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]},"put":{"summary":"Update Database","operationId":"databasesUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Update a database by its unique ID.","responses":{"200":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"update","weight":83,"cookies":false,"type":"","demo":"databases\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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]"}},"required":["name"]}}]},"delete":{"summary":"Delete Database","operationId":"databasesDelete","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":84,"cookies":false,"type":"","demo":"databases\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections":{"get":{"summary":"List Collections","operationId":"databasesListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":86,"cookies":false,"type":"","demo":"databases\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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":"databasesCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](\/docs\/server\/database#databaseCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":85,"cookies":false,"type":"","demo":"databases\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[COLLECTION_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Specifies the permissions model used in this collection, which accepts either 'collection' or 'document'. For 'collection' level permission, the permissions specified in read and write params are applied to all documents in the collection. For 'document' level permissions, read and write permissions are specified in each document. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databasesGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"getCollection","weight":87,"cookies":false,"type":"","demo":"databases\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databasesUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Update a collection by its unique ID.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":89,"cookies":false,"type":"","demo":"databases\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Collection","operationId":"databasesDeleteCollection","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteCollection","weight":90,"cookies":false,"type":"","demo":"databases\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databasesListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":99,"cookies":false,"type":"","demo":"databases\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databasesCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a boolean attribute.\n","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":98,"cookies":false,"type":"","demo":"databases\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databasesCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create an email attribute.\n","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":92,"cookies":false,"type":"","demo":"databases\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databasesCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":93,"cookies":false,"type":"","demo":"databases\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 4096 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databasesCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":97,"cookies":false,"type":"","demo":"databases\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"number","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"number","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databasesCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":96,"cookies":false,"type":"","demo":"databases\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databasesCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create IP address attribute.\n","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":94,"cookies":false,"type":"","demo":"databases\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databasesCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a string attribute.\n","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":91,"cookies":false,"type":"","demo":"databases\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databasesCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a URL attribute.\n","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":95,"cookies":false,"type":"","demo":"databases\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databasesGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":100,"cookies":false,"type":"","demo":"databases\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databasesDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":101,"cookies":false,"type":"","demo":"databases\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databasesListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a list of all the user's documents in a given collection. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of documents belonging to the provided collectionId. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":107,"cookies":false,"type":"","demo":"databases\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/database#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results. Maximum of 100 order attributes are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order. Maximum of 100 order types are allowed.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]},"post":{"summary":"Create Document","operationId":"databasesCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database#databaseCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":106,"cookies":false,"type":"","demo":"databases\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","data"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databasesGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a document by its unique ID. This endpoint response returns a JSON object with the document data.","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"getDocument","weight":108,"cookies":false,"type":"","demo":"databases\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databasesUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"updateDocument","weight":110,"cookies":false,"type":"","demo":"databases\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object. Include only attribute and value pairs to be updated.","default":[],"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete Document","operationId":"databasesDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"Delete a document by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":111,"cookies":false,"type":"","demo":"databases\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/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":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databasesListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get the document activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":109,"cookies":false,"type":"","demo":"databases\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databasesListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":103,"cookies":false,"type":"","demo":"databases\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databasesCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":102,"cookies":false,"type":"","demo":"databases\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders. Maximum of 100 orders are allowed.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databasesGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":104,"cookies":false,"type":"","demo":"databases\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databasesDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":105,"cookies":false,"type":"","demo":"databases\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databasesListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":88,"cookies":false,"type":"","demo":"databases\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databasesGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":114,"cookies":false,"type":"","demo":"databases\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databasesListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":82,"cookies":false,"type":"","demo":"databases\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/databases\/{databaseId}\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databasesGetDatabaseUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getDatabaseUsage","weight":113,"cookies":false,"type":"","demo":"databases\/get-database-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"range","description":"`Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/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":212,"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":"Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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":211,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[FUNCTION_ID]"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Function maximum execution time in seconds.","default":15,"x-example":1}},"required":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List runtimes","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active on your instance.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":213,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":214,"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 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":216,"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 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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","default":[],"x-example":"{}"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Maximum execution time in seconds.","default":15,"x-example":1}},"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":218,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments":{"get":{"summary":"List Deployments","operationId":"functionsListDeployments","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code deployments. You can use the query params to filter your results.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"listDeployments","weight":220,"cookies":false,"type":"","demo":"functions\/list-deployments.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-deployments.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 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":"Maximum number of deployments to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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 Deployment","operationId":"functionsCreateDeployment","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"createDeployment","weight":219,"cookies":false,"type":"","demo":"functions\/create-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"entrypoint","description":"Entrypoint File.","required":true,"type":"string","x-example":"[ENTRYPOINT]","in":"formData"},{"name":"code","description":"Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.","required":true,"type":"file","in":"formData"},{"name":"activate","description":"Automatically activate the deployment when it is finished building.","required":true,"type":"boolean","x-example":false,"in":"formData"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}":{"get":{"summary":"Get Deployment","operationId":"functionsGetDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code deployment by its unique ID.","responses":{"200":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"getDeployment","weight":221,"cookies":false,"type":"","demo":"functions\/get-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"patch":{"summary":"Update Function Deployment","operationId":"functionsUpdateDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateDeployment","weight":217,"cookies":false,"type":"","demo":"functions\/update-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"delete":{"summary":"Delete Deployment","operationId":"functionsDeleteDeployment","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code deployment by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDeployment","weight":222,"cookies":false,"type":"","demo":"functions\/delete-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":226,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":224,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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":223,"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 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]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":225,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":215,"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 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":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":122,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":132,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":125,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":124,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":129,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":130,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":128,"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\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":127,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":131,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":126,"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":115,"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":119,"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":116,"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":117,"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":118,"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":120,"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":121,"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":135,"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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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":134,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[PROJECT_ID]"},"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":["projectId","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":136,"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":138,"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":143,"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 at least 8 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":141,"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":"integer","description":"Set the max number of users allowed in this project. Use 0 for unlimited.","default":null,"x-example":0}},"required":["limit"]}}]}},"\/projects\/{projectId}\/auth\/{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":142,"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,magic-url,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":161,"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":160,"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":162,"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":164,"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":163,"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":151,"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":150,"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. Maximum of 100 scopes are allowed.","default":null,"x-example":null,"items":{"type":"string"}},"expire":{"type":"integer","description":"Key expiration time in Unix timestamp. Use 0 for unlimited expiration.","default":0,"x-example":null}},"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":152,"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":153,"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. Maximum of 100 events are allowed.","default":null,"x-example":null,"items":{"type":"string"}},"expire":{"type":"integer","description":"Key expiration time in Unix timestamp. Use 0 for unlimited expiration.","default":0,"x-example":null}},"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":154,"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":140,"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":156,"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":155,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":null}},"required":["type","name"]}}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"projectsGetPlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"getPlatform","weight":157,"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":158,"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":null}},"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":159,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":139,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":137,"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":145,"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":144,"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. Maximum of 100 events are allowed.","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":146,"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":147,"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. Maximum of 100 events are allowed.","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":149,"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"}]}},"\/projects\/{projectId}\/webhooks\/{webhookId}\/signature":{"patch":{"summary":"Update Webhook Signature Key","operationId":"projectsUpdateWebhookSignature","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"updateWebhookSignature","weight":148,"cookies":false,"type":"","demo":"projects\/update-webhook-signature.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\/buckets":{"get":{"summary":"List buckets","operationId":"storageListBuckets","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the storage buckets. You can use the query params to filter your results.","responses":{"200":{"description":"Buckets List","schema":{"$ref":"#\/definitions\/bucketList"}}},"x-appwrite":{"method":"listBuckets","weight":166,"cookies":false,"type":"","demo":"storage\/list-buckets.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"cursor","description":"ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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 bucket","operationId":"storageCreateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new storage bucket.","responses":{"201":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"createBucket","weight":165,"cookies":false,"type":"","demo":"storage\/create-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"bucketId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[BUCKET_ID]"},"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":30000000,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["bucketId","name","permission"]}}]}},"\/storage\/buckets\/{bucketId}":{"get":{"summary":"Get Bucket","operationId":"storageGetBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"getBucket","weight":167,"cookies":false,"type":"","demo":"storage\/get-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]},"put":{"summary":"Update Bucket","operationId":"storageUpdateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a storage bucket by its unique ID.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"updateBucket","weight":168,"cookies":false,"type":"","demo":"storage\/update-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":null,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Bucket","operationId":"storageDeleteBucket","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a storage bucket by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteBucket","weight":169,"cookies":false,"type":"","demo":"storage\/delete-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["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":171,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":170,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/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":172,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":176,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":177,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":174,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":173,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":175,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":178,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":179,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":181,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":180,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":182,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":183,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":184,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/logs":{"get":{"summary":"List Team Logs","operationId":"teamsListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get the team activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":191,"cookies":false,"type":"","demo":"teams\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":186,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":185,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"URL to redirect the user back to your app from the invitation email. 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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":187,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":188,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["roles"]}}]},"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteMembership","weight":190,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":189,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":193,"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":"Maximum number of users to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor, can be either 'before' or 'after'.","required":false,"type":"string","x-example":"after","default":"after","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":192,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":210,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":194,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"usersDelete","consumes":["application\/json"],"produces":[],"tags":["users"],"description":"Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](\/docs\/server\/users#usersUpdateStatus) endpoint instead.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":209,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":204,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":198,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/users\/{userId}\/memberships":{"get":{"summary":"Get User Memberships","operationId":"usersGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user membership list by its unique ID.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":197,"cookies":false,"type":"","demo":"users\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-memberships.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":202,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":203,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/users\/{userId}\/phone":{"patch":{"summary":"Update Phone","operationId":"usersUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":205,"cookies":false,"type":"","demo":"users\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"User phone number.","default":null,"x-example":null}},"required":["number"]}}]}},"\/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":195,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"usersUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":206,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":196,"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 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":208,"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 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":207,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":199,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateEmailVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmailVerification","weight":200,"cookies":false,"type":"","demo":"users\/update-email-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}},"\/users\/{userId}\/verification\/phone":{"patch":{"summary":"Update Phone Verification","operationId":"usersUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":201,"cookies":false,"type":"","demo":"users\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"phoneVerification":{"type":"boolean","description":"User phone verification status.","default":null,"x-example":false}},"required":["phoneVerification"]}}]}}},"tags":[{"name":"account","description":"The Account service allows you to authenticate and manage a user account.","x-globalAttributes":[]},{"name":"avatars","description":"The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.","x-globalAttributes":[]},{"name":"databases","description":"The Databases service allows you to create structured collections of documents, query and filter lists of documents","x-globalAttributes":["databaseId"]},{"name":"locale","description":"The Locale service allows you to customize your app based on your users' location.","x-globalAttributes":[]},{"name":"health","description":"The Health service allows you to both validate and monitor your Appwrite server's health.","x-globalAttributes":[]},{"name":"projects","description":"The Project service allows you to manage all the projects in your Appwrite server.","x-globalAttributes":[]},{"name":"storage","description":"The Storage service allows you to manage your project files.","x-globalAttributes":[]},{"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","x-globalAttributes":[]},{"name":"users","description":"The Users service allows you to manage your project users.","x-globalAttributes":[]},{"name":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions.","x-globalAttributes":[]}],"definitions":{"documentList":{"description":"Documents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of documents documents that matched your query.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["total","documents"]},"collectionList":{"description":"Collections List","type":"object","properties":{"total":{"type":"integer","description":"Total number of collections documents that matched your query.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["total","collections"]},"databaseList":{"description":"Databases List","type":"object","properties":{"total":{"type":"integer","description":"Total number of databases documents that matched your query.","x-example":5,"format":"int32"},"databases":{"type":"array","description":"List of databases.","items":{"type":"object","$ref":"#\/definitions\/database"},"x-example":""}},"required":["total","databases"]},"indexList":{"description":"Indexes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of indexes documents that matched your query.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["total","indexes"]},"userList":{"description":"Users List","type":"object","properties":{"total":{"type":"integer","description":"Total number of users documents that matched your query.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["total","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of sessions documents that matched your query.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["total","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"total":{"type":"integer","description":"Total number of logs documents that matched your query.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["total","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"total":{"type":"integer","description":"Total number of files documents that matched your query.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["total","files"]},"bucketList":{"description":"Buckets List","type":"object","properties":{"total":{"type":"integer","description":"Total number of buckets documents that matched your query.","x-example":5,"format":"int32"},"buckets":{"type":"array","description":"List of buckets.","items":{"type":"object","$ref":"#\/definitions\/bucket"},"x-example":""}},"required":["total","buckets"]},"teamList":{"description":"Teams List","type":"object","properties":{"total":{"type":"integer","description":"Total number of teams documents that matched your query.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["total","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"total":{"type":"integer","description":"Total number of memberships documents that matched your query.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["total","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of functions documents that matched your query.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["total","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of runtimes documents that matched your query.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["total","runtimes"]},"deploymentList":{"description":"Deployments List","type":"object","properties":{"total":{"type":"integer","description":"Total number of deployments documents that matched your query.","x-example":5,"format":"int32"},"deployments":{"type":"array","description":"List of deployments.","items":{"type":"object","$ref":"#\/definitions\/deployment"},"x-example":""}},"required":["total","deployments"]},"executionList":{"description":"Executions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of executions documents that matched your query.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["total","executions"]},"projectList":{"description":"Projects List","type":"object","properties":{"total":{"type":"integer","description":"Total number of projects documents that matched your query.","x-example":5,"format":"int32"},"projects":{"type":"array","description":"List of projects.","items":{"type":"object","$ref":"#\/definitions\/project"},"x-example":""}},"required":["total","projects"]},"webhookList":{"description":"Webhooks List","type":"object","properties":{"total":{"type":"integer","description":"Total number of webhooks documents that matched your query.","x-example":5,"format":"int32"},"webhooks":{"type":"array","description":"List of webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"},"x-example":""}},"required":["total","webhooks"]},"keyList":{"description":"API Keys List","type":"object","properties":{"total":{"type":"integer","description":"Total number of keys documents that matched your query.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["total","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"total":{"type":"integer","description":"Total number of platforms documents that matched your query.","x-example":5,"format":"int32"},"platforms":{"type":"array","description":"List of platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"},"x-example":""}},"required":["total","platforms"]},"domainList":{"description":"Domains List","type":"object","properties":{"total":{"type":"integer","description":"Total number of domains documents that matched your query.","x-example":5,"format":"int32"},"domains":{"type":"array","description":"List of domains.","items":{"type":"object","$ref":"#\/definitions\/domain"},"x-example":""}},"required":["total","domains"]},"countryList":{"description":"Countries List","type":"object","properties":{"total":{"type":"integer","description":"Total number of countries documents that matched your query.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["total","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of continents documents that matched your query.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["total","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"total":{"type":"integer","description":"Total number of languages documents that matched your query.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["total","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"total":{"type":"integer","description":"Total number of currencies documents that matched your query.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["total","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"total":{"type":"integer","description":"Total number of phones documents that matched your query.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["total","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"total":{"type":"integer","description":"Total number of metrics documents that matched your query.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["total","metrics"]},"database":{"description":"Database","type":"object","properties":{"$id":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Database name.","x-example":"My Database"},"$createdAt":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Collection update date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","name","$createdAt","$updatedAt"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Collection update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"databaseId":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$createdAt","$updatedAt","$read","$write","databaseId","name","enabled","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of attributes in the given collection.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["total","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"integer","description":"Attribute size.","x-example":128,"format":"int32"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"count"},"type":{"type":"string","description":"Attribute type.","x-example":"integer"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"percentageCompleted"},"type":{"type":"string","description":"Attribute type.","x-example":"double"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"isEnabled"},"type":{"type":"string","description":"Attribute type.","x-example":"boolean"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"userEmail"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"status"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"ipAddress"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"githubUrl"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":"primary"},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$createdAt":{"type":"integer","description":"Document creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Document update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$createdAt","$updatedAt","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"User creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"User update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"phone":{"type":"string","description":"User phone number in E.164 format.","x-example":"+4930901820"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"phoneVerification":{"type":"boolean","description":"Phone verification status.","x-example":true},"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","$createdAt","$updatedAt","name","registration","status","passwordUpdate","email","phone","emailVerification","phoneVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Session creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"integer","description":"Date, the Unix timestamp of when the access token expires.","x-example":1592981250,"format":"int32"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","$createdAt","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"$createdAt":{"type":"integer","description":"Token creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"File update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"signature":{"type":"string","description":"File MD5 signature.","x-example":"5d529fd02b544198ae075bd57c1762bb"},"mimeType":{"type":"string","description":"File mime type.","x-example":"image\/png"},"sizeOriginal":{"type":"integer","description":"File original size in bytes.","x-example":17890,"format":"int32"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$createdAt","$updatedAt","$read","$write","name","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"bucket":{"description":"Bucket","type":"object","properties":{"$id":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Bucket creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Bucket update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":["role:all"]},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":["user:608f9da25e7e1"]},"permission":{"type":"string","description":"Bucket permission model. Possible values: `bucket` or `file`","x-example":"file"},"name":{"type":"string","description":"Bucket name.","x-example":"Documents"},"enabled":{"type":"boolean","description":"Bucket enabled.","x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size supported.","x-example":100,"format":"int32"},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions.","items":{"type":"string"},"x-example":["jpg","png"]},"encryption":{"type":"boolean","description":"Bucket is encrypted.","x-example":false},"antivirus":{"type":"boolean","description":"Virus scanning is enabled.","x-example":false}},"required":["$id","$createdAt","$updatedAt","$read","$write","permission","name","enabled","maximumFileSize","allowedFileExtensions","encryption","antivirus"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Team update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"total":{"type":"integer","description":"Total number of team members.","x-example":7,"format":"int32"}},"required":["$id","$createdAt","$updatedAt","name","total"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Membership creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Membership update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"userName":{"type":"string","description":"User name.","x-example":"John Doe"},"userEmail":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"teamName":{"type":"string","description":"Team name.","x-example":"VIP"},"invited":{"type":"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","$createdAt","$updatedAt","userId","userName","userEmail","teamId","teamName","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"execute":{"type":"array","description":"Execution permissions.","items":{"type":"string"},"x-example":"role:member"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"status":{"type":"string","description":"Function status. Possible values: `disabled`, `enabled`","x-example":"enabled"},"runtime":{"type":"string","description":"Function execution runtime.","x-example":"python-3.8"},"deployment":{"type":"string","description":"Function's active deployment ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"object","additionalProperties":true,"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","$createdAt","$updatedAt","execute","name","status","runtime","deployment","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"deployment":{"description":"Deployment","type":"object","properties":{"$id":{"type":"string","description":"Deployment ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Deployment creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Deployment update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"resourceId":{"type":"string","description":"Resource ID.","x-example":"5e5ea6g16897e"},"resourceType":{"type":"string","description":"Resource type.","x-example":"functions"},"entrypoint":{"type":"string","description":"The entrypoint file to use to execute the deployment code.","x-example":"enabled"},"size":{"type":"integer","description":"The code size in bytes.","x-example":128,"format":"int32"},"buildId":{"type":"string","description":"The current build ID.","x-example":"5e5ea5c16897e"},"activate":{"type":"boolean","description":"Whether the deployment should be automatically activated.","x-example":true},"status":{"type":"string","description":"The deployment status.","x-example":"enabled"},"buildStdout":{"type":"string","description":"The build stdout.","x-example":"enabled"},"buildStderr":{"type":"string","description":"The build stderr.","x-example":"enabled"}},"required":["$id","$createdAt","$updatedAt","resourceId","resourceType","entrypoint","size","buildId","activate","status","buildStdout","buildStderr"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Execution update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"response":{"type":"string","description":"The script response output string. Logs the last 4,000 characters of the execution response output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$createdAt","$updatedAt","$read","functionId","trigger","status","statusCode","response","stderr","time"]},"project":{"description":"Project","type":"object","properties":{"$id":{"type":"string","description":"Project ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Project creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Project update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAuth0Appid":{"type":"string","description":"Auth0 OAuth app ID.","x-example":"123247283472834787438"},"providerAuth0Secret":{"type":"string","description":"Auth0 OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAutodeskAppid":{"type":"string","description":"Autodesk OAuth app ID.","x-example":"123247283472834787438"},"providerAutodeskSecret":{"type":"string","description":"Autodesk OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDailymotionAppid":{"type":"string","description":"Dailymotion OAuth app ID.","x-example":"123247283472834787438"},"providerDailymotionSecret":{"type":"string","description":"Dailymotion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerNotionAppid":{"type":"string","description":"Notion OAuth app ID.","x-example":"123247283472834787438"},"providerNotionSecret":{"type":"string","description":"Notion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerOktaAppid":{"type":"string","description":"Okta OAuth app ID.","x-example":"123247283472834787438"},"providerOktaSecret":{"type":"string","description":"Okta OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerStripeAppid":{"type":"string","description":"Stripe OAuth app ID.","x-example":"123247283472834787438"},"providerStripeSecret":{"type":"string","description":"Stripe OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYammerAppid":{"type":"string","description":"Yammer OAuth app ID.","x-example":"123247283472834787438"},"providerYammerSecret":{"type":"string","description":"Yammer OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerZoomAppid":{"type":"string","description":"Zoom OAuth app ID.","x-example":"123247283472834787438"},"providerZoomSecret":{"type":"string","description":"Zoom OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabases":{"type":"boolean","description":"Databases service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","$createdAt","$updatedAt","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerAuth0Appid","providerAuth0Secret","providerAutodeskAppid","providerAutodeskSecret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDailymotionAppid","providerDailymotionSecret","providerDiscordAppid","providerDiscordSecret","providerDropboxAppid","providerDropboxSecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerNotionAppid","providerNotionSecret","providerOktaAppid","providerOktaSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerStripeAppid","providerStripeSecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerWordpressAppid","providerWordpressSecret","providerYahooAppid","providerYahooSecret","providerYammerAppid","providerYammerSecret","providerYandexAppid","providerYandexSecret","providerZoomAppid","providerZoomSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabases","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"webhook":{"description":"Webhook","type":"object","properties":{"$id":{"type":"string","description":"Webhook ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Webhook creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Webhook update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Webhook name.","x-example":"My Webhook"},"url":{"type":"string","description":"Webhook URL endpoint.","x-example":"https:\/\/example.com\/webhook"},"events":{"type":"array","description":"Webhook trigger events.","items":{"type":"string"},"x-example":"database.collections.update"},"security":{"type":"boolean","description":"Indicated if SSL \/ TLS Certificate verification is enabled.","x-example":true},"httpUser":{"type":"string","description":"HTTP basic authentication username.","x-example":"username"},"httpPass":{"type":"string","description":"HTTP basic authentication password.","x-example":"password"},"signatureKey":{"type":"string","description":"Signature key which can be used to validated incoming","x-example":"ad3d581ca230e2b7059c545e5a"}},"required":["$id","$createdAt","$updatedAt","name","url","events","security","httpUser","httpPass","signatureKey"]},"key":{"description":"Key","type":"object","properties":{"$id":{"type":"string","description":"Key ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Key creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Key update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Key name.","x-example":"My API Key"},"expire":{"type":"integer","description":"Key expiration in Unix timestamp.","x-example":"1653990687","format":"int32"},"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","$createdAt","$updatedAt","name","expire","scopes","secret"]},"domain":{"description":"Domain","type":"object","properties":{"$id":{"type":"string","description":"Domain ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Domain creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Domain update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","$updatedAt","domain","registerable","tld","verification","certificateId"]},"platform":{"description":"Platform","type":"object","properties":{"$id":{"type":"string","description":"Platform ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"integer","description":"Project creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"$updatedAt":{"type":"integer","description":"Project update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","$createdAt","$updatedAt","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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]},"metric":{"description":"Metric","type":"object","properties":{"value":{"type":"integer","description":"The value of this metric at the timestamp.","x-example":1,"format":"int32"},"timestamp":{"type":"integer","description":"The UNIX timestamp at which this metric was aggregated.","x-example":1592981250,"format":"int32"}},"required":["value","timestamp"]},"usageDatabases":{"description":"UsageDatabases","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"databasesCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesDelete":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","databasesCount","documentsCount","collectionsCount","databasesCreate","databasesRead","databasesUpdate","databasesDelete","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by files (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"tagsStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by tags (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCount":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCount":{"type":"array","description":"Aggregated stats for total number of buckets.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCreate":{"type":"array","description":"Aggregated stats for buckets created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsRead":{"type":"array","description":"Aggregated stats for buckets read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsUpdate":{"type":"array","description":"Aggregated stats for buckets updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsDelete":{"type":"array","description":"Aggregated stats for buckets deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesStorage","tagsStorage","filesCount","bucketsCount","bucketsCreate","bucketsRead","bucketsUpdate","bucketsDelete","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesStorage":{"type":"array","description":"Aggregated stats for total storage of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesStorage","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"functionsExecutions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsFailures":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsCompute":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","functionsExecutions","functionsFailures","functionsCompute"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","functions","documents","collections","users","storage"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file +{"swagger":"2.0","info":{"version":"1.0.0-RC1","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":"HOSTNAME","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":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"get","weight":52,"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":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"create","weight":40,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"updateEmail","weight":59,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":51,"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":100,"rate-time":3600,"rate-key":"url:{url},userId:{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":55,"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":[]}],"parameters":[{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Only supported methods are limit and offset","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/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":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"updateName","weight":57,"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, Team Invites and Magic URL, oldPassword is optional.","responses":{"200":{"description":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"updatePassword","weight":58,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/phone":{"patch":{"summary":"Update Account Phone","operationId":"accountUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](\/docs\/client\/account#accountCreatePhoneVerification) endpoint to send a confirmation SMS.","responses":{"200":{"description":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"updatePhone","weight":60,"cookies":false,"type":"","demo":"account\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"phone":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["phone","password"]}}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"accountGetPrefs","consumes":["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":53,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"updatePrefs","weight":61,"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":{},"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":66,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":67,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":54,"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":[]}]},"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":65,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":50,"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\/email":{"post":{"summary":"Create Account Session with Email","operationId":"accountCreateEmailSession","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":"createEmailSession","weight":41,"cookies":false,"type":"","demo":"account\/create-email-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email.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 at least 8 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/sessions\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":46,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":47,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":42,"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, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoom.","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":"","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":"","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/phone":{"post":{"summary":"Create Phone session","operationId":"accountCreatePhoneSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [PUT \/account\/sessions\/phone](\/docs\/client\/account#accountUpdatePhoneSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneSession","weight":48,"cookies":false,"type":"","demo":"account\/create-phone-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"phone":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null}},"required":["userId","phone"]}}]},"put":{"summary":"Create Phone Session (confirmation)","operationId":"accountUpdatePhoneSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating a session with SMS. Use the **userId** from the [createPhoneSession](\/docs\/client\/account#accountCreatePhoneSession) endpoint and the **secret** received via SMS to successfully update and confirm the phone session.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updatePhoneSession","weight":49,"cookies":false,"type":"","demo":"account\/update-phone-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/sessions\/{sessionId}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":56,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to \"refresh\" the access token.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":64,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":63,"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 ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/status":{"patch":{"summary":"Update Account Status","operationId":"accountUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.","responses":{"200":{"description":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"updateStatus","weight":62,"cookies":false,"type":"","demo":"account\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/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#accountUpdateEmailVerification). 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":68,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":69,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/verification\/phone":{"post":{"summary":"Create Phone Verification","operationId":"accountCreatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](\/docs\/client\/account#accountUpdatePhone) endpoint. Learn more about how to [complete the verification process](\/docs\/client\/account#accountUpdatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneVerification","weight":70,"cookies":false,"type":"","demo":"account\/create-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]},"put":{"summary":"Create Phone Verification (confirmation)","operationId":"accountUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":71,"cookies":false,"type":"","demo":"account\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"avatarsGetBrowser","consumes":["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 [GET \/account\/sessions](\/docs\/client\/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":73,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":72,"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":76,"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. Country codes follow the [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":74,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":75,"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. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":78,"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":"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.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":77,"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 1 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":1,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/databases":{"get":{"summary":"List Databases","operationId":"databasesList","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.","responses":{"200":{"description":"Databases List","schema":{"$ref":"#\/definitions\/databaseList"}}},"x-appwrite":{"method":"list","weight":80,"cookies":false,"type":"","demo":"databases\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Database","operationId":"databasesCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a new Database.\n","responses":{"201":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"create","weight":79,"cookies":false,"type":"","demo":"databases\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"databaseId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DATABASE_ID]","x-global":true},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["databaseId","name"]}}]}},"\/databases\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databasesGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageDatabases","schema":{"$ref":"#\/definitions\/usageDatabases"}}},"x-appwrite":{"method":"getUsage","weight":113,"cookies":false,"type":"","demo":"databases\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"`Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/databases\/{databaseId}":{"get":{"summary":"Get Database","operationId":"databasesGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.","responses":{"200":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"get","weight":81,"cookies":false,"type":"","demo":"databases\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]},"put":{"summary":"Update Database","operationId":"databasesUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Update a database by its unique ID.","responses":{"200":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"update","weight":83,"cookies":false,"type":"","demo":"databases\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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]"}},"required":["name"]}}]},"delete":{"summary":"Delete Database","operationId":"databasesDelete","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":84,"cookies":false,"type":"","demo":"databases\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections":{"get":{"summary":"List Collections","operationId":"databasesListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":86,"cookies":false,"type":"","demo":"databases\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Collection","operationId":"databasesCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":85,"cookies":false,"type":"","demo":"databases\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[COLLECTION_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permissions":{"type":"array","description":"An array of permissions strings. By default no user is granted with any permissions. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}},"documentSecurity":{"type":"boolean","description":"Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](\/docs\/permissions).","default":false,"x-example":false}},"required":["collectionId","name"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databasesGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"getCollection","weight":87,"cookies":false,"type":"","demo":"databases\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databasesUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Update a collection by its unique ID.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":89,"cookies":false,"type":"","demo":"databases\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permissions":{"type":"array","description":"An array of permission strings. By default the current permission are inherited. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}},"documentSecurity":{"type":"boolean","description":"Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](\/docs\/permissions).","default":false,"x-example":false},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name"]}}]},"delete":{"summary":"Delete Collection","operationId":"databasesDeleteCollection","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteCollection","weight":90,"cookies":false,"type":"","demo":"databases\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databasesListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":100,"cookies":false,"type":"","demo":"databases\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databasesCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a boolean attribute.\n","responses":{"202":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":98,"cookies":false,"type":"","demo":"databases\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime":{"post":{"summary":"Create DateTime Attribute","operationId":"databasesCreateDatetimeAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"202":{"description":"AttributeDatetime","schema":{"$ref":"#\/definitions\/attributeDatetime"}}},"x-appwrite":{"method":"createDatetimeAttribute","weight":99,"cookies":false,"type":"","demo":"databases\/create-datetime-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for the attribute in ISO 8601 format. Cannot be set when attribute is required.","default":null,"x-example":"2020-10-15T06:38:00.000+00:00"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databasesCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create an email attribute.\n","responses":{"202":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":92,"cookies":false,"type":"","demo":"databases\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databasesCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"202":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":93,"cookies":false,"type":"","demo":"databases\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 4096 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databasesCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"202":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":97,"cookies":false,"type":"","demo":"databases\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"number","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"number","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databasesCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"202":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":96,"cookies":false,"type":"","demo":"databases\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databasesCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create IP address attribute.\n","responses":{"202":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":94,"cookies":false,"type":"","demo":"databases\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databasesCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a string attribute.\n","responses":{"202":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":91,"cookies":false,"type":"","demo":"databases\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databasesCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a URL attribute.\n","responses":{"202":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":95,"cookies":false,"type":"","demo":"databases\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databasesGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"AttributeDatetime, or AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeDatetime, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeDatetime"},{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeDatetime"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":101,"cookies":false,"type":"","demo":"databases\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databasesDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":102,"cookies":false,"type":"","demo":"databases\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databasesListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a list of all the user's documents in a given collection. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of documents belonging to the provided collectionId. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":108,"cookies":false,"type":"","demo":"databases\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]},"post":{"summary":"Create Document","operationId":"databasesCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":107,"cookies":false,"type":"","demo":"databases\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md","rate-limit":120,"rate-time":60,"rate-key":"ip:{ip},method:{method},url:{url},userId:{userId}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"x-example":"{}"},"permissions":{"type":"array","description":"An array of permissions strings. By default the current user is granted with all permissions. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}}},"required":["documentId","data"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databasesGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a document by its unique ID. This endpoint response returns a JSON object with the document data.","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"getDocument","weight":109,"cookies":false,"type":"","demo":"databases\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databasesUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"updateDocument","weight":111,"cookies":false,"type":"","demo":"databases\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md","rate-limit":120,"rate-time":60,"rate-key":"ip:{ip},method:{method},url:{url},userId:{userId}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object. Include only attribute and value pairs to be updated.","default":[],"x-example":"{}"},"permissions":{"type":"array","description":"An array of permissions strings. By default the current permissions are inherited. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete Document","operationId":"databasesDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"Delete a document by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":112,"cookies":false,"type":"","demo":"databases\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md","rate-limit":60,"rate-time":60,"rate-key":"ip:{ip},method:{method},url:{url},userId:{userId}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databasesListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get the document activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":110,"cookies":false,"type":"","demo":"databases\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Only supported methods are limit and offset","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databasesListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":104,"cookies":false,"type":"","demo":"databases\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databasesCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"202":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":103,"cookies":false,"type":"","demo":"databases\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders. Maximum of 100 orders are allowed.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databasesGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":105,"cookies":false,"type":"","demo":"databases\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databasesDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":106,"cookies":false,"type":"","demo":"databases\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databasesListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":88,"cookies":false,"type":"","demo":"databases\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Only supported methods are limit and offset","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databasesGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":115,"cookies":false,"type":"","demo":"databases\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/logs":{"get":{"summary":"List Database Logs","operationId":"databasesListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get the database activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":82,"cookies":false,"type":"","demo":"databases\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Only supported methods are limit and offset","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/databases\/{databaseId}\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databasesGetDatabaseUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getDatabaseUsage","weight":114,"cookies":false,"type":"","demo":"databases\/get-database-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"range","description":"`Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/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":221,"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":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, status, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Function","operationId":"functionsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function. You can pass a list of [permissions](\/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":220,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[FUNCTION_ID]"},"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 roles. By default no user is granted with any execute permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 64 characters long.","default":null,"x-example":"[\"any\"]","items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Function maximum execution time in seconds.","default":15,"x-example":1}},"required":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List runtimes","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active on your instance.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":222,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/functions\/usage":{"get":{"summary":"Get Functions Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":225,"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":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/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":223,"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 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":226,"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 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 roles. By default no user is granted with any execute permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 64 characters long.","default":null,"x-example":"[\"any\"]","items":{"type":"string"}},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Maximum execution time in seconds.","default":15,"x-example":1}},"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":228,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments":{"get":{"summary":"List Deployments","operationId":"functionsListDeployments","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code deployments. You can use the query params to filter your results.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"listDeployments","weight":230,"cookies":false,"type":"","demo":"functions\/list-deployments.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-deployments.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: entrypoint, size, buildId, activate","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Deployment","operationId":"functionsCreateDeployment","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"202":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"createDeployment","weight":229,"cookies":false,"type":"","demo":"functions\/create-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"entrypoint","description":"Entrypoint File.","required":true,"type":"string","x-example":"[ENTRYPOINT]","in":"formData"},{"name":"code","description":"Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.","required":true,"type":"file","in":"formData"},{"name":"activate","description":"Automatically activate the deployment when it is finished building.","required":true,"type":"boolean","x-example":false,"in":"formData"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}":{"get":{"summary":"Get Deployment","operationId":"functionsGetDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code deployment by its unique ID.","responses":{"200":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"getDeployment","weight":231,"cookies":false,"type":"","demo":"functions\/get-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"patch":{"summary":"Update Function Deployment","operationId":"functionsUpdateDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateDeployment","weight":227,"cookies":false,"type":"","demo":"functions\/update-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"delete":{"summary":"Delete Deployment","operationId":"functionsDeleteDeployment","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code deployment by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDeployment","weight":232,"cookies":false,"type":"","demo":"functions\/delete-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":236,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":234,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, statusCode, time","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create 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":233,"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":"ip:{ip},userId:{userId}","scope":"execution.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"string","description":"String of custom data to send to function.","default":"","x-example":"[DATA]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":235,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetFunctionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getFunctionUsage","weight":224,"cookies":false,"type":"","demo":"functions\/get-function-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 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"}]}},"\/functions\/{functionId}\/variables":{"get":{"summary":"List Variables","operationId":"functionsListVariables","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all variables of a specific function.","responses":{"200":{"description":"Variables List","schema":{"$ref":"#\/definitions\/variableList"}}},"x-appwrite":{"method":"listVariables","weight":238,"cookies":false,"type":"","demo":"functions\/list-variables.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-variables.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":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Variable","operationId":"functionsCreateVariable","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function variable. These variables can be accessed within function in the `env` object under the request variable.","responses":{"201":{"description":"Variable","schema":{"$ref":"#\/definitions\/variable"}}},"x-appwrite":{"method":"createVariable","weight":237,"cookies":false,"type":"","demo":"functions\/create-variable.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-variable.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":{"key":{"type":"string","description":"Variable key. Max length: 255 chars.","default":null,"x-example":"[KEY]"},"value":{"type":"string","description":"Variable value. Max length: 8192 chars.","default":null,"x-example":"[VALUE]"}},"required":["key","value"]}}]}},"\/functions\/{functionId}\/variables\/{variableId}":{"get":{"summary":"Get Variable","operationId":"functionsGetVariable","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a variable by its unique ID.","responses":{"200":{"description":"Variable","schema":{"$ref":"#\/definitions\/variable"}}},"x-appwrite":{"method":"getVariable","weight":239,"cookies":false,"type":"","demo":"functions\/get-variable.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-variable.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":"variableId","description":"Variable unique ID.","required":true,"type":"string","x-example":"[VARIABLE_ID]","in":"path"}]},"put":{"summary":"Update Variable","operationId":"functionsUpdateVariable","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update variable by its unique ID.","responses":{"200":{"description":"Variable","schema":{"$ref":"#\/definitions\/variable"}}},"x-appwrite":{"method":"updateVariable","weight":240,"cookies":false,"type":"","demo":"functions\/update-variable.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-variable.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":"variableId","description":"Variable unique ID.","required":true,"type":"string","x-example":"[VARIABLE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Variable key. Max length: 255 chars.","default":null,"x-example":"[KEY]"},"value":{"type":"string","description":"Variable value. Max length: 8192 chars.","default":null,"x-example":"[VALUE]"}},"required":["key"]}}]},"delete":{"summary":"Delete Variable","operationId":"functionsDeleteVariable","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a variable by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteVariable","weight":241,"cookies":false,"type":"","demo":"functions\/delete-variable.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-variable.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":"variableId","description":"Variable unique ID.","required":true,"type":"string","x-example":"[VARIABLE_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"healthGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":123,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":133,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":126,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":125,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":130,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":131,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":129,"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\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":128,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":132,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":127,"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":116,"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":120,"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":117,"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":118,"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":119,"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":121,"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":122,"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":136,"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":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create 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":135,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[PROJECT_ID]"},"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":["projectId","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":137,"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":139,"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":144,"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 at least 8 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":142,"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":"integer","description":"Set the max number of users allowed in this project. Use 0 for unlimited.","default":null,"x-example":0}},"required":["limit"]}}]}},"\/projects\/{projectId}\/auth\/{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":143,"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,magic-url,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":162,"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":161,"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":163,"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":165,"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":164,"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":152,"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":151,"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. Maximum of 100 scopes are allowed.","default":null,"x-example":null,"items":{"type":"string"}},"expire":{"type":"string","description":"Expiration time in ISO 8601 format. Use null for unlimited expiration.","default":null,"x-example":"2020-10-15T06:38:00.000+00:00"}},"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":153,"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":154,"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. Maximum of 100 events are allowed.","default":null,"x-example":null,"items":{"type":"string"}},"expire":{"type":"string","description":"Expiration time in ISO 8601 format. Use null for unlimited expiration.","default":null,"x-example":"2020-10-15T06:38:00.000+00:00"}},"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":155,"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":141,"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":157,"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":156,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":null}},"required":["type","name"]}}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"projectsGetPlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"getPlatform","weight":158,"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":159,"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":null}},"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":160,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":140,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":138,"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":146,"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":145,"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. Maximum of 100 events are allowed.","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":147,"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":148,"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. Maximum of 100 events are allowed.","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":150,"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"}]}},"\/projects\/{projectId}\/webhooks\/{webhookId}\/signature":{"patch":{"summary":"Update Webhook Signature Key","operationId":"projectsUpdateWebhookSignature","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"updateWebhookSignature","weight":149,"cookies":false,"type":"","demo":"projects\/update-webhook-signature.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\/buckets":{"get":{"summary":"List buckets","operationId":"storageListBuckets","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the storage buckets. You can use the query params to filter your results.","responses":{"200":{"description":"Buckets List","schema":{"$ref":"#\/definitions\/bucketList"}}},"x-appwrite":{"method":"listBuckets","weight":167,"cookies":false,"type":"","demo":"storage\/list-buckets.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create bucket","operationId":"storageCreateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new storage bucket.","responses":{"201":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"createBucket","weight":166,"cookies":false,"type":"","demo":"storage\/create-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"bucketId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[BUCKET_ID]"},"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permissions":{"type":"array","description":"An array of permission strings. By default no user is granted with any permissions. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}},"fileSecurity":{"type":"boolean","description":"Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](\/docs\/permissions).","default":false,"x-example":false},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":30000000,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"compression":{"type":"string","description":"Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled","default":"none","x-example":"none"},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["bucketId","name"]}}]}},"\/storage\/buckets\/{bucketId}":{"get":{"summary":"Get Bucket","operationId":"storageGetBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"getBucket","weight":168,"cookies":false,"type":"","demo":"storage\/get-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]},"put":{"summary":"Update Bucket","operationId":"storageUpdateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a storage bucket by its unique ID.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"updateBucket","weight":169,"cookies":false,"type":"","demo":"storage\/update-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permissions":{"type":"array","description":"An array of permission strings. By default the current permissions are inherited. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}},"fileSecurity":{"type":"boolean","description":"Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](\/docs\/permissions).","default":false,"x-example":false},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":null,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"compression":{"type":"string","description":"Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled","default":"none","x-example":"none"},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["name"]}}]},"delete":{"summary":"Delete Bucket","operationId":"storageDeleteBucket","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a storage bucket by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteBucket","weight":170,"cookies":false,"type":"","demo":"storage\/delete-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["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":172,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":171,"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":60,"rate-time":60,"rate-key":"ip:{ip},method:{method},url:{url},userId:{userId}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"permissions","description":"An array of permission strings. By default the current user is granted with all permissions. [Learn more about permissions](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"read(\"any\")\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["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":173,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":177,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":60,"rate-time":60,"rate-key":"ip:{ip},method:{method},url:{url},userId:{userId}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"permissions":{"type":"array","description":"An array of permission string. By default the current permissions are inherited. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":178,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":60,"rate-time":60,"rate-key":"ip:{ip},method:{method},url:{url},userId:{userId}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":175,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":174,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":176,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":179,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":180,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":182,"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":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Team","operationId":"teamsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":181,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":183,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":184,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":185,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/logs":{"get":{"summary":"List Team Logs","operationId":"teamsListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get the team activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":192,"cookies":false,"type":"","demo":"teams\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Only supported methods are limit and offset","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":187,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":186,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"URL to redirect the user back to your app from the invitation email. 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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":188,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":189,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["roles"]}}]},"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteMembership","weight":191,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":190,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":201,"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":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create User","operationId":"usersCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"create","weight":193,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"phone":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null},"password":{"type":"string","description":"Plain text user password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId"]}}]}},"\/users\/argon2":{"post":{"summary":"Create User with Argon2 Password","operationId":"usersCreateArgon2User","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [Argon2](https:\/\/en.wikipedia.org\/wiki\/Argon2) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createArgon2User","weight":196,"cookies":false,"type":"","demo":"users\/create-argon2user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using Argon2.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/bcrypt":{"post":{"summary":"Create User with Bcrypt Password","operationId":"usersCreateBcryptUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [Bcrypt](https:\/\/en.wikipedia.org\/wiki\/Bcrypt) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createBcryptUser","weight":194,"cookies":false,"type":"","demo":"users\/create-bcrypt-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using Bcrypt.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/md5":{"post":{"summary":"Create User with MD5 Password","operationId":"usersCreateMD5User","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [MD5](https:\/\/en.wikipedia.org\/wiki\/MD5) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createMD5User","weight":195,"cookies":false,"type":"","demo":"users\/create-m-d5user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using MD5.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/phpass":{"post":{"summary":"Create User with PHPass Password","operationId":"usersCreatePHPassUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [PHPass](https:\/\/www.openwall.com\/phpass\/) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createPHPassUser","weight":198,"cookies":false,"type":"","demo":"users\/create-p-h-pass-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using PHPass.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/scrypt":{"post":{"summary":"Create User with Scrypt Password","operationId":"usersCreateScryptUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [Scrypt](https:\/\/github.com\/Tarsnap\/scrypt) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createScryptUser","weight":199,"cookies":false,"type":"","demo":"users\/create-scrypt-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using Scrypt.","default":null,"x-example":"password"},"passwordSalt":{"type":"string","description":"Optional salt used to hash password.","default":null,"x-example":"[PASSWORD_SALT]"},"passwordCpu":{"type":"integer","description":"Optional CPU cost used to hash password.","default":null,"x-example":null},"passwordMemory":{"type":"integer","description":"Optional memory cost used to hash password.","default":null,"x-example":null},"passwordParallel":{"type":"integer","description":"Optional parallelization cost used to hash password.","default":null,"x-example":null},"passwordLength":{"type":"integer","description":"Optional hash length used to hash password.","default":null,"x-example":null},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password","passwordSalt","passwordCpu","passwordMemory","passwordParallel","passwordLength"]}}]}},"\/users\/scrypt-modified":{"post":{"summary":"Create User with Scrypt Modified Password","operationId":"usersCreateScryptModifiedUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [Scrypt Modified](https:\/\/gist.github.com\/Meldiron\/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createScryptModifiedUser","weight":200,"cookies":false,"type":"","demo":"users\/create-scrypt-modified-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using Scrypt Modified.","default":null,"x-example":"password"},"passwordSalt":{"type":"string","description":"Salt used to hash password.","default":null,"x-example":"[PASSWORD_SALT]"},"passwordSaltSeparator":{"type":"string","description":"Salt separator used to hash password.","default":null,"x-example":"[PASSWORD_SALT_SEPARATOR]"},"passwordSignerKey":{"type":"string","description":"Signer key used to hash password.","default":null,"x-example":"[PASSWORD_SIGNER_KEY]"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password","passwordSalt","passwordSaltSeparator","passwordSignerKey"]}}]}},"\/users\/sha":{"post":{"summary":"Create User with SHA Password","operationId":"usersCreateSHAUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [SHA](https:\/\/en.wikipedia.org\/wiki\/Secure_Hash_Algorithm) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createSHAUser","weight":197,"cookies":false,"type":"","demo":"users\/create-s-h-a-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using SHA.","default":null,"x-example":"password"},"passwordVersion":{"type":"string","description":"Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512\/224', 'sha512\/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'","default":"","x-example":"sha1"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":219,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":202,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"usersDelete","consumes":["application\/json"],"produces":[],"tags":["users"],"description":"Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](\/docs\/server\/users#usersUpdateStatus) endpoint instead.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":218,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":212,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":206,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Only supported methods are limit and offset","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/users\/{userId}\/memberships":{"get":{"summary":"Get User Memberships","operationId":"usersGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user membership list by its unique ID.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":205,"cookies":false,"type":"","demo":"users\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-memberships.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":210,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":211,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/users\/{userId}\/phone":{"patch":{"summary":"Update Phone","operationId":"usersUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":213,"cookies":false,"type":"","demo":"users\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"User phone number.","default":null,"x-example":null}},"required":["number"]}}]}},"\/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":203,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"usersUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":215,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":204,"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 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":217,"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 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":216,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":207,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateEmailVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmailVerification","weight":214,"cookies":false,"type":"","demo":"users\/update-email-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}},"\/users\/{userId}\/verification\/phone":{"patch":{"summary":"Update Phone Verification","operationId":"usersUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":209,"cookies":false,"type":"","demo":"users\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"phoneVerification":{"type":"boolean","description":"User phone verification status.","default":null,"x-example":false}},"required":["phoneVerification"]}}]}}},"tags":[{"name":"account","description":"The Account service allows you to authenticate and manage a user account.","x-globalAttributes":[]},{"name":"avatars","description":"The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.","x-globalAttributes":[]},{"name":"databases","description":"The Databases service allows you to create structured collections of documents, query and filter lists of documents","x-globalAttributes":["databaseId"]},{"name":"locale","description":"The Locale service allows you to customize your app based on your users' location.","x-globalAttributes":[]},{"name":"health","description":"The Health service allows you to both validate and monitor your Appwrite server's health.","x-globalAttributes":[]},{"name":"projects","description":"The Project service allows you to manage all the projects in your Appwrite server.","x-globalAttributes":[]},{"name":"storage","description":"The Storage service allows you to manage your project files.","x-globalAttributes":[]},{"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","x-globalAttributes":[]},{"name":"users","description":"The Users service allows you to manage your project users.","x-globalAttributes":[]},{"name":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions.","x-globalAttributes":[]}],"definitions":{"documentList":{"description":"Documents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of documents documents that matched your query.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["total","documents"]},"collectionList":{"description":"Collections List","type":"object","properties":{"total":{"type":"integer","description":"Total number of collections documents that matched your query.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["total","collections"]},"databaseList":{"description":"Databases List","type":"object","properties":{"total":{"type":"integer","description":"Total number of databases documents that matched your query.","x-example":5,"format":"int32"},"databases":{"type":"array","description":"List of databases.","items":{"type":"object","$ref":"#\/definitions\/database"},"x-example":""}},"required":["total","databases"]},"indexList":{"description":"Indexes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of indexes documents that matched your query.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["total","indexes"]},"userList":{"description":"Users List","type":"object","properties":{"total":{"type":"integer","description":"Total number of users documents that matched your query.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["total","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of sessions documents that matched your query.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["total","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"total":{"type":"integer","description":"Total number of logs documents that matched your query.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["total","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"total":{"type":"integer","description":"Total number of files documents that matched your query.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["total","files"]},"bucketList":{"description":"Buckets List","type":"object","properties":{"total":{"type":"integer","description":"Total number of buckets documents that matched your query.","x-example":5,"format":"int32"},"buckets":{"type":"array","description":"List of buckets.","items":{"type":"object","$ref":"#\/definitions\/bucket"},"x-example":""}},"required":["total","buckets"]},"teamList":{"description":"Teams List","type":"object","properties":{"total":{"type":"integer","description":"Total number of teams documents that matched your query.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["total","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"total":{"type":"integer","description":"Total number of memberships documents that matched your query.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["total","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of functions documents that matched your query.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["total","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of runtimes documents that matched your query.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["total","runtimes"]},"deploymentList":{"description":"Deployments List","type":"object","properties":{"total":{"type":"integer","description":"Total number of deployments documents that matched your query.","x-example":5,"format":"int32"},"deployments":{"type":"array","description":"List of deployments.","items":{"type":"object","$ref":"#\/definitions\/deployment"},"x-example":""}},"required":["total","deployments"]},"executionList":{"description":"Executions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of executions documents that matched your query.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["total","executions"]},"projectList":{"description":"Projects List","type":"object","properties":{"total":{"type":"integer","description":"Total number of projects documents that matched your query.","x-example":5,"format":"int32"},"projects":{"type":"array","description":"List of projects.","items":{"type":"object","$ref":"#\/definitions\/project"},"x-example":""}},"required":["total","projects"]},"webhookList":{"description":"Webhooks List","type":"object","properties":{"total":{"type":"integer","description":"Total number of webhooks documents that matched your query.","x-example":5,"format":"int32"},"webhooks":{"type":"array","description":"List of webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"},"x-example":""}},"required":["total","webhooks"]},"keyList":{"description":"API Keys List","type":"object","properties":{"total":{"type":"integer","description":"Total number of keys documents that matched your query.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["total","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"total":{"type":"integer","description":"Total number of platforms documents that matched your query.","x-example":5,"format":"int32"},"platforms":{"type":"array","description":"List of platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"},"x-example":""}},"required":["total","platforms"]},"domainList":{"description":"Domains List","type":"object","properties":{"total":{"type":"integer","description":"Total number of domains documents that matched your query.","x-example":5,"format":"int32"},"domains":{"type":"array","description":"List of domains.","items":{"type":"object","$ref":"#\/definitions\/domain"},"x-example":""}},"required":["total","domains"]},"countryList":{"description":"Countries List","type":"object","properties":{"total":{"type":"integer","description":"Total number of countries documents that matched your query.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["total","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of continents documents that matched your query.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["total","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"total":{"type":"integer","description":"Total number of languages documents that matched your query.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["total","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"total":{"type":"integer","description":"Total number of currencies documents that matched your query.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["total","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"total":{"type":"integer","description":"Total number of phones documents that matched your query.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["total","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"total":{"type":"integer","description":"Total number of metrics documents that matched your query.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["total","metrics"]},"variableList":{"description":"Variables List","type":"object","properties":{"total":{"type":"integer","description":"Total number of variables documents that matched your query.","x-example":5,"format":"int32"},"variables":{"type":"array","description":"List of variables.","items":{"type":"object","$ref":"#\/definitions\/variable"},"x-example":""}},"required":["total","variables"]},"database":{"description":"Database","type":"object","properties":{"$id":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Database name.","x-example":"My Database"},"$createdAt":{"type":"string","description":"Database creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Database update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"}},"required":["$id","name","$createdAt","$updatedAt"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Collection creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Collection update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$permissions":{"type":"array","description":"Collection permissions. [Learn more about permissions](\/docs\/permissions).","items":{"type":"string"},"x-example":["read(\"any\")"]},"databaseId":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"documentSecurity":{"type":"boolean","description":"Whether document-level permissions are enabled. [Learn more about permissions](\/docs\/permissions).","x-example":true},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeDatetime"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$createdAt","$updatedAt","$permissions","databaseId","name","enabled","documentSecurity","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of attributes in the given collection.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeDatetime"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["total","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"integer","description":"Attribute size.","x-example":128,"format":"int32"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"count"},"type":{"type":"string","description":"Attribute type.","x-example":"integer"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"percentageCompleted"},"type":{"type":"string","description":"Attribute type.","x-example":"double"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"isEnabled"},"type":{"type":"string","description":"Attribute type.","x-example":"boolean"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"userEmail"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"status"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"ipAddress"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"githubUrl"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeDatetime":{"description":"AttributeDatetime","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"birthDay"},"type":{"type":"string","description":"Attribute type.","x-example":"2020-10-15T06:38:00.000+00:00"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"ISO 8601 format.","x-example":"datetime"},"default":{"type":"string","description":"Default value for attribute when not provided. Only null is optional","x-example":"2020-10-15T06:38:00.000+00:00","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":"primary"},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[],"x-nullable":true}},"required":["key","type","status","attributes"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$createdAt":{"type":"string","description":"Document creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Document update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$permissions":{"type":"array","description":"Document permissions. [Learn more about permissions](\/docs\/permissions).","items":{"type":"string"},"x-example":["read(\"any\")"]}},"additionalProperties":true,"required":["$id","$collection","$createdAt","$updatedAt","$permissions"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"string","description":"Log creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["event","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"User creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"User update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"password":{"type":"string","description":"Hashed user password.","x-example":"$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE"},"hash":{"type":"string","description":"Password hashing algorithm.","x-example":"argon2"},"hashOptions":{"type":"object","description":"Password hashing algorithm configuration.","x-example":{},"items":{"x-oneOf":[{"$ref":"#\/definitions\/algoArgon2"},{"$ref":"#\/definitions\/algoScrypt"},{"$ref":"#\/definitions\/algoScryptModified"},{"$ref":"#\/definitions\/algoBcrypt"},{"$ref":"#\/definitions\/algoPhpass"},{"$ref":"#\/definitions\/algoSha"},{"$ref":"#\/definitions\/algoMd5"}]}},"registration":{"type":"string","description":"User registration date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"status":{"type":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"passwordUpdate":{"type":"string","description":"Password update time in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"phone":{"type":"string","description":"User phone number in E.164 format.","x-example":"+4930901820"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"phoneVerification":{"type":"boolean","description":"Phone verification status.","x-example":true},"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","$createdAt","$updatedAt","name","password","hash","hashOptions","registration","status","passwordUpdate","email","phone","emailVerification","phoneVerification","prefs"]},"algoMd5":{"description":"AlgoMD5","type":"object"},"algoSha":{"description":"AlgoSHA","type":"object"},"algoPhpass":{"description":"AlgoPHPass","type":"object"},"algoBcrypt":{"description":"AlgoBcrypt","type":"object"},"algoScrypt":{"description":"AlgoScrypt","type":"object","properties":{"costCpu":{"type":"integer","description":"CPU complexity of computed hash.","x-example":8,"format":"int32"},"costMemory":{"type":"integer","description":"Memory complexity of computed hash.","x-example":14,"format":"int32"},"costParallel":{"type":"integer","description":"Parallelization of computed hash.","x-example":1,"format":"int32"},"length":{"type":"integer","description":"Length used to compute hash.","x-example":1,"format":"int32"}},"required":["costCpu","costMemory","costParallel","length"]},"algoScryptModified":{"description":"AlgoScryptModified","type":"object","properties":{"salt":{"type":"string","description":"Salt used to compute hash.","x-example":"UxLMreBr6tYyjQ=="},"saltSeparator":{"type":"string","description":"Separator used to compute hash.","x-example":"Bw=="},"signerKey":{"type":"string","description":"Key used to compute hash.","x-example":"XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ=="}},"required":["salt","saltSeparator","signerKey"]},"algoArgon2":{"description":"AlgoArgon2","type":"object","properties":{"memoryCost":{"type":"integer","description":"Memory used to compute hash.","x-example":65536,"format":"int32"},"timeCost":{"type":"integer","description":"Amount of time consumed to compute hash","x-example":4,"format":"int32"},"threads":{"type":"integer","description":"Number of threads used to compute hash.","x-example":3,"format":"int32"}},"required":["memoryCost","timeCost","threads"]},"account":{"description":"Account","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"User creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"User update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"string","description":"User registration date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"status":{"type":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"passwordUpdate":{"type":"string","description":"Password update time in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"phone":{"type":"string","description":"User phone number in E.164 format.","x-example":"+4930901820"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"phoneVerification":{"type":"boolean","description":"Phone verification status.","x-example":true},"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","$createdAt","$updatedAt","name","registration","status","passwordUpdate","email","phone","emailVerification","phoneVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Session creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"userId":{"type":"string","description":"User ID.","x-example":"5e5bb8c16897e"},"expire":{"type":"string","description":"Session expiration date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"provider":{"type":"string","description":"Session Provider.","x-example":"email"},"providerUid":{"type":"string","description":"Session Provider User ID.","x-example":"user@example.com"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"string","description":"The date of when the access token expires in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","$createdAt","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"$createdAt":{"type":"string","description":"Token creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c168bb8"},"secret":{"type":"string","description":"Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.","x-example":""},"expire":{"type":"string","description":"Token expiration date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"}},"required":["$id","$createdAt","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"File creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"File update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$permissions":{"type":"array","description":"File permissions. [Learn more about permissions](\/docs\/permissions).","items":{"type":"string"},"x-example":["read(\"any\")"]},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"signature":{"type":"string","description":"File MD5 signature.","x-example":"5d529fd02b544198ae075bd57c1762bb"},"mimeType":{"type":"string","description":"File mime type.","x-example":"image\/png"},"sizeOriginal":{"type":"integer","description":"File original size in bytes.","x-example":17890,"format":"int32"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$createdAt","$updatedAt","$permissions","name","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"bucket":{"description":"Bucket","type":"object","properties":{"$id":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Bucket creation time in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Bucket update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$permissions":{"type":"array","description":"Bucket permissions. [Learn more about permissions](\/docs\/permissions).","items":{"type":"string"},"x-example":["read(\"any\")"]},"fileSecurity":{"type":"string","description":"Whether file-level security is enabled. [Learn more about permissions](\/docs\/permissions).","x-example":true},"name":{"type":"string","description":"Bucket name.","x-example":"Documents"},"enabled":{"type":"boolean","description":"Bucket enabled.","x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size supported.","x-example":100,"format":"int32"},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions.","items":{"type":"string"},"x-example":["jpg","png"]},"compression":{"type":"string","description":"Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).","x-example":"gzip"},"encryption":{"type":"boolean","description":"Bucket is encrypted.","x-example":false},"antivirus":{"type":"boolean","description":"Virus scanning is enabled.","x-example":false}},"required":["$id","$createdAt","$updatedAt","$permissions","fileSecurity","name","enabled","maximumFileSize","allowedFileExtensions","compression","encryption","antivirus"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Team creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Team update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"total":{"type":"integer","description":"Total number of team members.","x-example":7,"format":"int32"}},"required":["$id","$createdAt","$updatedAt","name","total"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Membership creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Membership update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"userName":{"type":"string","description":"User name.","x-example":"John Doe"},"userEmail":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"teamName":{"type":"string","description":"Team name.","x-example":"VIP"},"invited":{"type":"string","description":"Date, the user has been invited to join the team in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"joined":{"type":"string","description":"Date, the user has accepted the invitation to join the team in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"},"x-example":"admin"}},"required":["$id","$createdAt","$updatedAt","userId","userName","userEmail","teamId","teamName","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Function creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Function update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"execute":{"type":"array","description":"Execution permissions.","items":{"type":"string"},"x-example":"users"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"status":{"type":"string","description":"Function status. Possible values: `disabled`, `enabled`","x-example":"enabled"},"runtime":{"type":"string","description":"Function execution runtime.","x-example":"python-3.8"},"deployment":{"type":"string","description":"Function's active deployment ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"array","description":"Function variables.","items":{"type":"object","$ref":"#\/definitions\/variable"},"x-example":[]},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"},"x-example":"account.create"},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"string","description":"Function's next scheduled execution time in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"schedulePrevious":{"type":"string","description":"Function's previous scheduled execution time in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","$createdAt","$updatedAt","execute","name","status","runtime","deployment","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"deployment":{"description":"Deployment","type":"object","properties":{"$id":{"type":"string","description":"Deployment ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Deployment creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Deployment update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"resourceId":{"type":"string","description":"Resource ID.","x-example":"5e5ea6g16897e"},"resourceType":{"type":"string","description":"Resource type.","x-example":"functions"},"entrypoint":{"type":"string","description":"The entrypoint file to use to execute the deployment code.","x-example":"enabled"},"size":{"type":"integer","description":"The code size in bytes.","x-example":128,"format":"int32"},"buildId":{"type":"string","description":"The current build ID.","x-example":"5e5ea5c16897e"},"activate":{"type":"boolean","description":"Whether the deployment should be automatically activated.","x-example":true},"status":{"type":"string","description":"The deployment status. Possible values are \"processing\", \"building\", \"pending\", \"ready\", and \"failed\".","x-example":"ready"},"buildStdout":{"type":"string","description":"The build stdout.","x-example":"enabled"},"buildStderr":{"type":"string","description":"The build stderr.","x-example":"enabled"}},"required":["$id","$createdAt","$updatedAt","resourceId","resourceType","entrypoint","size","buildId","activate","status","buildStdout","buildStderr"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Execution creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Execution upate date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$permissions":{"type":"array","description":"Execution roles.","items":{"type":"string"},"x-example":["any"]},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"response":{"type":"string","description":"The script response output string. Logs the last 4,000 characters of the execution response output.","x-example":""},"stdout":{"type":"string","description":"The script stdout output string. Logs the last 4,000 characters of the execution stdout output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$createdAt","$updatedAt","$permissions","functionId","trigger","status","statusCode","response","stdout","stderr","time"]},"project":{"description":"Project","type":"object","properties":{"$id":{"type":"string","description":"Project ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Project creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Project update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"Project name.","x-example":"New Project"},"description":{"type":"string","description":"Project description.","x-example":"This is a new project."},"teamId":{"type":"string","description":"Project team ID.","x-example":"1592981250"},"logo":{"type":"string","description":"Project logo file ID.","x-example":"5f5c451b403cb"},"url":{"type":"string","description":"Project website URL.","x-example":"5f5c451b403cb"},"legalName":{"type":"string","description":"Company legal name.","x-example":"Company LTD."},"legalCountry":{"type":"string","description":"Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format.","x-example":"US"},"legalState":{"type":"string","description":"State name.","x-example":"New York"},"legalCity":{"type":"string","description":"City name.","x-example":"New York City."},"legalAddress":{"type":"string","description":"Company Address.","x-example":"620 Eighth Avenue, New York, NY 10018"},"legalTaxId":{"type":"string","description":"Company Tax ID.","x-example":"131102020"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAuth0Appid":{"type":"string","description":"Auth0 OAuth app ID.","x-example":"123247283472834787438"},"providerAuth0Secret":{"type":"string","description":"Auth0 OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAuthentikAppid":{"type":"string","description":"Authentik OAuth app ID.","x-example":"123247283472834787438"},"providerAuthentikSecret":{"type":"string","description":"Authentik OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAutodeskAppid":{"type":"string","description":"Autodesk OAuth app ID.","x-example":"123247283472834787438"},"providerAutodeskSecret":{"type":"string","description":"Autodesk OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDailymotionAppid":{"type":"string","description":"Dailymotion OAuth app ID.","x-example":"123247283472834787438"},"providerDailymotionSecret":{"type":"string","description":"Dailymotion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDisqusAppid":{"type":"string","description":"Disqus OAuth app ID.","x-example":"123247283472834787438"},"providerDisqusSecret":{"type":"string","description":"Disqus OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerEtsyAppid":{"type":"string","description":"Etsy OAuth app ID.","x-example":"123247283472834787438"},"providerEtsySecret":{"type":"string","description":"Etsy OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerNotionAppid":{"type":"string","description":"Notion OAuth app ID.","x-example":"123247283472834787438"},"providerNotionSecret":{"type":"string","description":"Notion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerOktaAppid":{"type":"string","description":"Okta OAuth app ID.","x-example":"123247283472834787438"},"providerOktaSecret":{"type":"string","description":"Okta OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPodioAppid":{"type":"string","description":"Podio OAuth app ID.","x-example":"123247283472834787438"},"providerPodioSecret":{"type":"string","description":"Podio OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerStripeAppid":{"type":"string","description":"Stripe OAuth app ID.","x-example":"123247283472834787438"},"providerStripeSecret":{"type":"string","description":"Stripe OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYammerAppid":{"type":"string","description":"Yammer OAuth app ID.","x-example":"123247283472834787438"},"providerYammerSecret":{"type":"string","description":"Yammer OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerZoomAppid":{"type":"string","description":"Zoom OAuth app ID.","x-example":"123247283472834787438"},"providerZoomSecret":{"type":"string","description":"Zoom OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabases":{"type":"boolean","description":"Databases service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","$createdAt","$updatedAt","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerAuth0Appid","providerAuth0Secret","providerAuthentikAppid","providerAuthentikSecret","providerAutodeskAppid","providerAutodeskSecret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDailymotionAppid","providerDailymotionSecret","providerDiscordAppid","providerDiscordSecret","providerDisqusAppid","providerDisqusSecret","providerDropboxAppid","providerDropboxSecret","providerEtsyAppid","providerEtsySecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerNotionAppid","providerNotionSecret","providerOktaAppid","providerOktaSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerPodioAppid","providerPodioSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerStripeAppid","providerStripeSecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerWordpressAppid","providerWordpressSecret","providerYahooAppid","providerYahooSecret","providerYammerAppid","providerYammerSecret","providerYandexAppid","providerYandexSecret","providerZoomAppid","providerZoomSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabases","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"webhook":{"description":"Webhook","type":"object","properties":{"$id":{"type":"string","description":"Webhook ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Webhook creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Webhook update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"Webhook name.","x-example":"My Webhook"},"url":{"type":"string","description":"Webhook URL endpoint.","x-example":"https:\/\/example.com\/webhook"},"events":{"type":"array","description":"Webhook trigger events.","items":{"type":"string"},"x-example":"database.collections.update"},"security":{"type":"boolean","description":"Indicated if SSL \/ TLS Certificate verification is enabled.","x-example":true},"httpUser":{"type":"string","description":"HTTP basic authentication username.","x-example":"username"},"httpPass":{"type":"string","description":"HTTP basic authentication password.","x-example":"password"},"signatureKey":{"type":"string","description":"Signature key which can be used to validated incoming","x-example":"ad3d581ca230e2b7059c545e5a"}},"required":["$id","$createdAt","$updatedAt","name","url","events","security","httpUser","httpPass","signatureKey"]},"key":{"description":"Key","type":"object","properties":{"$id":{"type":"string","description":"Key ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Key creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Key update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"Key name.","x-example":"My API Key"},"expire":{"type":"string","description":"Key expiration date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"scopes":{"type":"array","description":"Allowed permission scopes.","items":{"type":"string"},"x-example":"users.read"},"secret":{"type":"string","description":"Secret key.","x-example":"919c2d18fb5d4...a2ae413da83346ad2"},"accessedAt":{"type":"string","description":"Most recent access date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"sdks":{"type":"array","description":"List of SDK user agents that used this key.","items":{"type":"string"},"x-example":"appwrite:flutter"}},"required":["$id","$createdAt","$updatedAt","name","expire","scopes","secret","accessedAt","sdks"]},"domain":{"description":"Domain","type":"object","properties":{"$id":{"type":"string","description":"Domain ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Domain creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Domain update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"domain":{"type":"string","description":"Domain name.","x-example":"appwrite.company.com"},"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","$createdAt","$updatedAt","domain","registerable","tld","verification","certificateId"]},"platform":{"description":"Platform","type":"object","properties":{"$id":{"type":"string","description":"Platform ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Platform creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Platform update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"Platform name.","x-example":"My Web App"},"type":{"type":"string","description":"Platform type. Possible values are: web, flutter-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","$createdAt","$updatedAt","name","type","key","store","hostname","httpUser","httpPass"]},"variable":{"description":"Variable","type":"object","properties":{"$id":{"type":"string","description":"Variable ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Variable creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Variable creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"key":{"type":"string","description":"Variable key.","x-example":"API_KEY"},"value":{"type":"string","description":"Variable value.","x-example":"myPa$$word1"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"}},"required":["$id","$createdAt","$updatedAt","key","value","functionId"]},"country":{"description":"Country","type":"object","properties":{"name":{"type":"string","description":"Country name.","x-example":"United States"},"code":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"}},"required":["name","code"]},"continent":{"description":"Continent","type":"object","properties":{"name":{"type":"string","description":"Continent name.","x-example":"Europe"},"code":{"type":"string","description":"Continent two letter code.","x-example":"EU"}},"required":["name","code"]},"language":{"description":"Language","type":"object","properties":{"name":{"type":"string","description":"Language name.","x-example":"Italian"},"code":{"type":"string","description":"Language two-character ISO 639-1 codes.","x-example":"it"},"nativeName":{"type":"string","description":"Language native name.","x-example":"Italiano"}},"required":["name","code","nativeName"]},"currency":{"description":"Currency","type":"object","properties":{"symbol":{"type":"string","description":"Currency symbol.","x-example":"$"},"name":{"type":"string","description":"Currency name.","x-example":"US dollar"},"symbolNative":{"type":"string","description":"Currency native symbol.","x-example":"$"},"decimalDigits":{"type":"integer","description":"Number of decimal digits.","x-example":2,"format":"int32"},"rounding":{"type":"number","description":"Currency digit rounding.","x-example":0,"format":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]},"metric":{"description":"Metric","type":"object","properties":{"value":{"type":"integer","description":"The value of this metric at the timestamp.","x-example":1,"format":"int32"},"date":{"type":"integer","description":"The UNIX timestamp at which this metric was aggregated.","x-example":1592981250,"format":"int32"}},"required":["value","date"]},"usageDatabases":{"description":"UsageDatabases","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"databasesCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesDelete":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","databasesCount","documentsCount","collectionsCount","databasesCreate","databasesRead","databasesUpdate","databasesDelete","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCount":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCount":{"type":"array","description":"Aggregated stats for total number of buckets.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCreate":{"type":"array","description":"Aggregated stats for buckets created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsRead":{"type":"array","description":"Aggregated stats for buckets read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsUpdate":{"type":"array","description":"Aggregated stats for buckets updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsDelete":{"type":"array","description":"Aggregated stats for buckets deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","storage","filesCount","bucketsCount","bucketsCreate","bucketsRead","bucketsUpdate","bucketsDelete","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesStorage":{"type":"array","description":"Aggregated stats for total storage of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesStorage","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"executionsTotal":{"type":"array","description":"Aggregated stats for number of function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"executionsFailure":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"executionsSuccess":{"type":"array","description":"Aggregated stats for function execution successes.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"executionsTime":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"buildsTotal":{"type":"array","description":"Aggregated stats for number of function builds.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"buildsFailure":{"type":"array","description":"Aggregated stats for function build failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"buildsSuccess":{"type":"array","description":"Aggregated stats for function build successes.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"buildsTime":{"type":"array","description":"Aggregated stats for function build duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","executionsTotal","executionsFailure","executionsSuccess","executionsTime","buildsTotal","buildsFailure","buildsSuccess","buildsTime"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"executions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","executions","documents","collections","users","storage"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file From b43943b1f17c830d8b4d4661932a4e69a637b726 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 6 Sep 2022 08:04:25 +0000 Subject: [PATCH 390/555] fix param comments being escaped --- .../java/io/appwrite/services/ServiceTemplate.kt.twig | 2 +- .../kotlin/io/appwrite/services/ServiceTemplate.kt.twig | 2 +- templates/php/docs/service.md.twig | 8 ++++---- templates/ruby/lib/container/services/service.rb.twig | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index 84520b61b5..69985fffbe 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -39,7 +39,7 @@ class {{ service.name | caseUcfirst }} : Service { * {% endif %} {% for parameter in method.parameters.all %} - * @param {{ parameter.name | caseCamel }} {{ parameter.description }} + * @param {{ parameter.name | caseCamel }} {{ parameter.description | raw }} {% endfor %} * {% if method.type != "webAuth" %}@return [{{ _self.resultType(sdk.namespace, method) }}]{% endif %} diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index bdab0705e7..559444b49c 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -28,7 +28,7 @@ class {{ service.name | caseUcfirst }} : Service { * {% endif %} {% for parameter in method.parameters.all %} - * @param {{ parameter.name | caseCamel }} {{ parameter.description }} + * @param {{ parameter.name | caseCamel }} {{ parameter.description | raw }} {% endfor %} * {% if method.type != "webAuth" %}@return [{{ utils.resultType(sdk.namespace, method) }}]{% endif %} diff --git a/templates/php/docs/service.md.twig b/templates/php/docs/service.md.twig index 6c69c4d4a4..7839627103 100644 --- a/templates/php/docs/service.md.twig +++ b/templates/php/docs/service.md.twig @@ -18,22 +18,22 @@ | --- | --- | --- | --- | {% if method.parameters.path | length > 0 %} {% for parameter in method.parameters.path %} -| {{ parameter.name }} | {{ parameter.type }} | {% if parameter.required == 1 %}**Required** {% endif %}{{ parameter.description }} | {{ parameter.default }} | +| {{ parameter.name }} | {{ parameter.type }} | {% if parameter.required == 1 %}**Required** {% endif %}{{ parameter.description | raw }} | {{ parameter.default }} | {% endfor %} {% endif %} {% if method.parameters.query | length > 0 %} {% for parameter in method.parameters.query %} -| {{ parameter.name }} | {{ parameter.type }} | {% if parameter.required == 1 %}**Required** {% endif %}{{ parameter.description }} | {{ parameter.default }} | +| {{ parameter.name }} | {{ parameter.type }} | {% if parameter.required == 1 %}**Required** {% endif %}{{ parameter.description | raw }} | {{ parameter.default }} | {% endfor %} {% endif %} {% if method.parameters.body | length > 0 %} {% for parameter in method.parameters.body %} -| {{ parameter.name }} | {{ parameter.type }} | {{ parameter.description }} | {{ parameter.default }} | +| {{ parameter.name }} | {{ parameter.type }} | {{ parameter.description | raw }} | {{ parameter.default }} | {% endfor %} {% endif %} {% if method.parameters.formData | length > 0 %} {% for parameter in method.parameters.formData %} -| {{ parameter.name }} | {{ parameter.type }} | {{ parameter.description }} | {{ parameter.default }} | +| {{ parameter.name }} | {{ parameter.type }} | {{ parameter.description | raw }} | {{ parameter.default }} | {% endfor %} {% endif %} diff --git a/templates/ruby/lib/container/services/service.rb.twig b/templates/ruby/lib/container/services/service.rb.twig index 67b16e3a44..66ad9beea6 100644 --- a/templates/ruby/lib/container/services/service.rb.twig +++ b/templates/ruby/lib/container/services/service.rb.twig @@ -11,7 +11,7 @@ module {{spec.title | caseUcfirst}} {{ method.description | rubyComment }} # {% for parameter in method.parameters.all %} - # @param [{{ parameter | typeName }}] {{ parameter.name | caseSnake | escapeKeyword }} {{ parameter.description }} + # @param [{{ parameter | typeName }}] {{ parameter.name | caseSnake | escapeKeyword }} {{ parameter.description | raw }} {% endfor %} # # @return [{{ method.responseModel | caseUcfirst }}] From cebd67a9ab7581fecd204373c47c8f300143c344 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 6 Sep 2022 21:06:42 +1200 Subject: [PATCH 391/555] Add conditional RC deployments for web + node --- templates/node/.travis.yml.twig | 19 ++++++++++++++----- templates/web/.travis.yml.twig | 31 ++++++++++++++++++++----------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/templates/node/.travis.yml.twig b/templates/node/.travis.yml.twig index ebf76bfa5f..4c2f7ef13b 100644 --- a/templates/node/.travis.yml.twig +++ b/templates/node/.travis.yml.twig @@ -1,13 +1,22 @@ - language: node_js node_js: - - "14.16" + - "18.8.0" jobs: include: - - stage: npm release - node_js: "14.16" - script: echo "Deploying to npm ..." + - stage: NPM RC Release + if: tag == *-RC* + node_js: "18.8.0" + script: echo "Deploying RC to NPM..." + deploy: + provider: npm + email: $NPM_EMAIL + api_key: $NPM_API_KEY + tag: next + - stage: NPM Release + if: tag != *-RC* + node_js: "18.8.0" + script: echo "Deploying to NPM..." deploy: provider: npm email: $NPM_EMAIL diff --git a/templates/web/.travis.yml.twig b/templates/web/.travis.yml.twig index 34295c8a82..c2277ed58b 100644 --- a/templates/web/.travis.yml.twig +++ b/templates/web/.travis.yml.twig @@ -1,22 +1,31 @@ - language: node_js node_js: - - "14.16" + - "18.8.0" jobs: include: - - stage: npm release - node_js: "14.16" - script: - - echo "Installing dependencies ..." - - npm i - - echo "Building library ..." + - stage: NPM RC Release + if: tag == *-RC* + node_js: "18.8.0" + script: + - npm install - npm run build - - echo "Deploying to npm ..." + - echo "Deploying RC to NPM..." + deploy: + provider: npm + email: $NPM_EMAIL + api_key: $NPM_API_KEY + tag: next + - stage: NPM Release + if: tag != *-RC* + node_js: "18.8.0" + script: + - npm install + - npm run build + - echo "Deploying to NPM..." deploy: provider: npm email: $NPM_EMAIL api_key: $NPM_API_KEY - skip_cleanup: true on: - tags: true + tags: true \ No newline at end of file From 86ce2879a81dc5a27e61f62a9bbe34796f0e4632 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 6 Sep 2022 21:57:13 +1200 Subject: [PATCH 392/555] Update swift client + android realtime timestamp type --- .../src/main/java/io/appwrite/models/RealtimeModels.kt.twig | 2 +- templates/swift/Sources/Models/RealtimeModels.swift.twig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/models/RealtimeModels.kt.twig b/templates/android/library/src/main/java/io/appwrite/models/RealtimeModels.kt.twig index 5d48aff021..f131ecd538 100644 --- a/templates/android/library/src/main/java/io/appwrite/models/RealtimeModels.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/models/RealtimeModels.kt.twig @@ -23,7 +23,7 @@ open class RealtimeResponse( data class RealtimeResponseEvent( val events: Collection, val channels: Collection, - val timestamp: Long, + val timestamp: String, var payload: T ) diff --git a/templates/swift/Sources/Models/RealtimeModels.swift.twig b/templates/swift/Sources/Models/RealtimeModels.swift.twig index d50d1d415f..3a9c3e298b 100644 --- a/templates/swift/Sources/Models/RealtimeModels.swift.twig +++ b/templates/swift/Sources/Models/RealtimeModels.swift.twig @@ -24,13 +24,13 @@ public class RealtimeCallback { public class RealtimeResponseEvent { public let events: [String]? public let channels: [String]? - public let timestamp: Int64? + public let timestamp: String? public var payload: [String: Any]? init( events: [String], channels: [String], - timestamp: Int64, + timestamp: String, payload: [String: Any] ) { self.events = events From d676524192c4e25500153629f2c5bf27571be531 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 6 Sep 2022 16:12:41 +0000 Subject: [PATCH 393/555] feat: cast timestamp to string --- templates/swift/Sources/Services/Realtime.swift.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/swift/Sources/Services/Realtime.swift.twig b/templates/swift/Sources/Services/Realtime.swift.twig index 486b490e00..407c5ec093 100644 --- a/templates/swift/Sources/Services/Realtime.swift.twig +++ b/templates/swift/Sources/Services/Realtime.swift.twig @@ -209,7 +209,7 @@ extension Realtime: WebSocketClientDelegate { let response = RealtimeResponseEvent( events: events, channels: channels, - timestamp: data["timestamp"] as! Int64, + timestamp: data["timestamp"] as! String, payload: payload ) subscription.value.callback(response) From 684f3078667192f0f4f68d5543528f387b0ae724 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 Sep 2022 09:57:10 +1200 Subject: [PATCH 394/555] Revert node version updates --- templates/node/.travis.yml.twig | 6 +++--- templates/web/.travis.yml.twig | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/node/.travis.yml.twig b/templates/node/.travis.yml.twig index 4c2f7ef13b..b8f9cf81ce 100644 --- a/templates/node/.travis.yml.twig +++ b/templates/node/.travis.yml.twig @@ -1,12 +1,12 @@ language: node_js node_js: - - "18.8.0" + - "14.16" jobs: include: - stage: NPM RC Release if: tag == *-RC* - node_js: "18.8.0" + node_js: "14.16" script: echo "Deploying RC to NPM..." deploy: provider: npm @@ -15,7 +15,7 @@ jobs: tag: next - stage: NPM Release if: tag != *-RC* - node_js: "18.8.0" + node_js: "14.16" script: echo "Deploying to NPM..." deploy: provider: npm diff --git a/templates/web/.travis.yml.twig b/templates/web/.travis.yml.twig index c2277ed58b..e2f525d322 100644 --- a/templates/web/.travis.yml.twig +++ b/templates/web/.travis.yml.twig @@ -1,12 +1,12 @@ language: node_js node_js: - - "18.8.0" + - "14.16" jobs: include: - stage: NPM RC Release if: tag == *-RC* - node_js: "18.8.0" + node_js: "14.16" script: - npm install - npm run build @@ -18,7 +18,7 @@ jobs: tag: next - stage: NPM Release if: tag != *-RC* - node_js: "18.8.0" + node_js: "14.16" script: - npm install - npm run build From 270ce74df5cfa84d96c1581f76d2d873e8b247ea Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 Sep 2022 10:17:25 +1200 Subject: [PATCH 395/555] Account for additional properties when handling models with no attributes --- .../kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig index 24d0a342cf..63a2cd761c 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig @@ -6,7 +6,7 @@ import com.google.gson.annotations.SerializedName /** * {{ definition.description }} */ -{% if definition.properties | length == 0 %} +{% if definition.properties | length == 0 and not definition.additionalProperties %} class {{ definition.name | caseUcfirst }} {} {% else %} data class {{ definition.name | caseUcfirst }}( From 54fbbaabb2be7b46cdeb66d7aa0ef948b50d0975 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 Sep 2022 14:01:42 +1200 Subject: [PATCH 396/555] Fix ruby service params --- templates/ruby/base/params.twig | 7 ++++--- templates/ruby/lib/container/services/service.rb.twig | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/ruby/base/params.twig b/templates/ruby/base/params.twig index 81b8863983..85d57afd0c 100644 --- a/templates/ruby/base/params.twig +++ b/templates/ruby/base/params.twig @@ -1,3 +1,7 @@ +{% for parameter in method.parameters.path %} + .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {{ parameter.name | caseSnake | escapeKeyword }}) +{% endfor %} + params = { {% for parameter in method.parameters.query | merge(method.parameters.body) %} {{ parameter.name }}: {{ parameter.name | caseSnake | escapeKeyword }}, @@ -21,7 +25,4 @@ {% endif %} {% endfor %} -{% for parameter in method.parameters.path %} - .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {{ parameter.name | caseSnake | escapeKeyword }}) -{% endfor %} {% endif %} \ No newline at end of file diff --git a/templates/ruby/lib/container/services/service.rb.twig b/templates/ruby/lib/container/services/service.rb.twig index 66ad9beea6..74cc802e43 100644 --- a/templates/ruby/lib/container/services/service.rb.twig +++ b/templates/ruby/lib/container/services/service.rb.twig @@ -18,7 +18,6 @@ module {{spec.title | caseUcfirst}} def {{ method.name | caseSnake }}({% for parameter in method.parameters.all %}{{ parameter.name | caseSnake | escapeKeyword }}:{% if not parameter.required %} nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress: nil{% endif %}) path = '{{ method.path }}' - {{ include('ruby/base/params.twig')}} {% if 'multipart/form-data' in method.consumes %} {{ include('ruby/base/requests/file.twig')}} From 4d592196e6b4b91452afab1b807cfd58f7399354 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 Sep 2022 14:51:50 +1200 Subject: [PATCH 397/555] Check required params first --- templates/ruby/base/params.twig | 24 +++++++++---------- templates/ruby/docs/example.md.twig | 11 ++++----- .../lib/container/services/service.rb.twig | 2 -- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/templates/ruby/base/params.twig b/templates/ruby/base/params.twig index 85d57afd0c..d9706f26d6 100644 --- a/templates/ruby/base/params.twig +++ b/templates/ruby/base/params.twig @@ -1,5 +1,15 @@ + path = '{{ method.path }}' {% for parameter in method.parameters.path %} - .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {{ parameter.name | caseSnake | escapeKeyword }}) + .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {{ parameter.name | caseSnake | escapeKeyword }}) +{% endfor %} + +{% for parameter in method.parameters.all %} +{% if parameter.required %} + if {{ parameter.name | caseSnake | escapeKeyword }}.nil? + raise {{spec.title | caseUcfirst}}::Exception.new('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"') + end + +{% endif %} {% endfor %} params = { @@ -15,14 +25,4 @@ {% for key, header in method.headers %} "{{ key }}": '{{ header }}', {% endfor %} - } -{% if method.parameters.all | length %} -{% for parameter in method.parameters.all %} -{% if parameter.required %} - if {{ parameter.name | caseSnake | escapeKeyword }}.nil? - raise {{spec.title | caseUcfirst}}::Exception.new('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"') - end - -{% endif %} -{% endfor %} -{% endif %} \ No newline at end of file + } \ No newline at end of file diff --git a/templates/ruby/docs/example.md.twig b/templates/ruby/docs/example.md.twig index 341b590223..c9384efe14 100644 --- a/templates/ruby/docs/example.md.twig +++ b/templates/ruby/docs/example.md.twig @@ -1,11 +1,8 @@ require 'appwrite' -client = Appwrite::Client.new -{% if method.type == "upload" %} -InputFile = Appwrite::InputFile -{% endif %} +include Appwrite -client +client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint {% for node in method.security %} {% for key,header in node|keys %} @@ -13,8 +10,8 @@ client {% endfor %} {% endfor %} -{{ service.name | caseSnake }} = {{spec.title | caseUcfirst}}::{{ service.name | caseUcfirst }}.new(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{parameter.name | caseSnake}}:{{ parameter | paramExample }}{% endfor %}{% endif %}) +{{ service.name | caseSnake }} = {{ service.name | caseUcfirst }}.new(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{parameter.name | caseSnake}}:{{ parameter | paramExample }}{% endfor %}{% endif %}) -response = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{parameter.name|caseSnake}}: {% if parameter.type == 'file' %}{{spec.title | caseUcfirst}}::{{ parameter | paramExample }}{% else %}{{ parameter | paramExample }}{% endif %}{% endif %}{% endfor %}) +response = {{ service.name | caseSnake }}.{{ method.name | caseSnake }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{parameter.name|caseSnake}}: {% if parameter.type == 'file' %}{{ parameter | paramExample }}{% else %}{{ parameter | paramExample }}{% endif %}{% endif %}{% endfor %}) puts response.inspect \ No newline at end of file diff --git a/templates/ruby/lib/container/services/service.rb.twig b/templates/ruby/lib/container/services/service.rb.twig index 74cc802e43..dbfc91d678 100644 --- a/templates/ruby/lib/container/services/service.rb.twig +++ b/templates/ruby/lib/container/services/service.rb.twig @@ -16,8 +16,6 @@ module {{spec.title | caseUcfirst}} # # @return [{{ method.responseModel | caseUcfirst }}] def {{ method.name | caseSnake }}({% for parameter in method.parameters.all %}{{ parameter.name | caseSnake | escapeKeyword }}:{% if not parameter.required %} nil{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress: nil{% endif %}) - - path = '{{ method.path }}' {{ include('ruby/base/params.twig')}} {% if 'multipart/form-data' in method.consumes %} {{ include('ruby/base/requests/file.twig')}} From 17bcf1a374ad7ffd0fa8ed5379165b504f939f5b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 Sep 2022 14:59:13 +1200 Subject: [PATCH 398/555] Fix spacing --- templates/ruby/base/params.twig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/ruby/base/params.twig b/templates/ruby/base/params.twig index d9706f26d6..081a11ea10 100644 --- a/templates/ruby/base/params.twig +++ b/templates/ruby/base/params.twig @@ -1,13 +1,13 @@ - path = '{{ method.path }}' + path = '{{ method.path }}' {% for parameter in method.parameters.path %} - .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {{ parameter.name | caseSnake | escapeKeyword }}) + .gsub('{{ '{' }}{{ parameter.name }}{{ '}' }}', {{ parameter.name | caseSnake | escapeKeyword }}) {% endfor %} {% for parameter in method.parameters.all %} {% if parameter.required %} - if {{ parameter.name | caseSnake | escapeKeyword }}.nil? - raise {{spec.title | caseUcfirst}}::Exception.new('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"') - end + if {{ parameter.name | caseSnake | escapeKeyword }}.nil? + raise {{spec.title | caseUcfirst}}::Exception.new('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"') + end {% endif %} {% endfor %} From a3490b202ba620ab1a781b15bdc49d0eaf3a1e59 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 Sep 2022 15:14:01 +1200 Subject: [PATCH 399/555] Fix newlines --- templates/ruby/base/params.twig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/ruby/base/params.twig b/templates/ruby/base/params.twig index 081a11ea10..8483a2bf4c 100644 --- a/templates/ruby/base/params.twig +++ b/templates/ruby/base/params.twig @@ -11,7 +11,6 @@ {% endif %} {% endfor %} - params = { {% for parameter in method.parameters.query | merge(method.parameters.body) %} {{ parameter.name }}: {{ parameter.name | caseSnake | escapeKeyword }}, @@ -25,4 +24,4 @@ {% for key, header in method.headers %} "{{ key }}": '{{ header }}', {% endfor %} - } \ No newline at end of file + } From 50b9428d5d5af1bfda27e5ad81e7fd1f1d2c6c99 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 Sep 2022 17:24:40 +1200 Subject: [PATCH 400/555] Fix swift no param models --- templates/swift/Sources/Models/Model.swift.twig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/swift/Sources/Models/Model.swift.twig b/templates/swift/Sources/Models/Model.swift.twig index d9036210f3..4629f0fd16 100644 --- a/templates/swift/Sources/Models/Model.swift.twig +++ b/templates/swift/Sources/Models/Model.swift.twig @@ -1,6 +1,9 @@ {% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}[{{property.sub_schema | caseUcfirst}}]{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}[String : Any]{% else %}{{property | typeName}}{% endif %}{% endif %}{% endmacro %} /// {{ definition.description }} +{% if definition.properties | length == 0 and not definition.additionalProperties %} +public class {{ definition.name | caseUcfirst }} {} +{% else %} public class {{ definition.name | caseUcfirst }} { {% for property in definition.properties %} @@ -72,4 +75,5 @@ public class {{ definition.name | caseUcfirst }} { {% endif %} {% endfor %} -} \ No newline at end of file +} +{% endif %} \ No newline at end of file From ff7206d5c9d5e98653fe504afddc58748dc8a3aa Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 Sep 2022 10:35:52 +1200 Subject: [PATCH 401/555] Remove hardcoded Appwrite --- templates/ruby/docs/example.md.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/ruby/docs/example.md.twig b/templates/ruby/docs/example.md.twig index c9384efe14..268de5a5ac 100644 --- a/templates/ruby/docs/example.md.twig +++ b/templates/ruby/docs/example.md.twig @@ -1,6 +1,6 @@ -require 'appwrite' +require '{{ spec.title }}' -include Appwrite +include {{ spec.title | caseUcfirst }} client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint From bb347574be4013b0b787113c159e9cbca9946d2d Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 9 Sep 2022 12:38:33 +1200 Subject: [PATCH 402/555] Add `member` function to all role helpers --- .../src/main/java/io/appwrite/Role.kt.twig | 33 ++++++++++--------- templates/dart/lib/role.dart.twig | 4 +++ templates/deno/src/role.ts.twig | 4 +++ .../src/main/kotlin/io/appwrite/Role.kt.twig | 33 ++++++++++--------- templates/node/lib/role.js.twig | 3 ++ templates/php/src/Role.php.twig | 4 +++ templates/python/package/role.py.twig | 4 +++ templates/ruby/lib/container/role.rb.twig | 4 +++ templates/swift/Sources/Role.swift.twig | 4 +++ templates/web/src/role.ts.twig | 4 +++ 10 files changed, 65 insertions(+), 32 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig index 39ee8f7393..99edb87b37 100644 --- a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig @@ -2,21 +2,22 @@ package {{ sdk.namespace | caseDot }} class Role { companion object { - fun any(): String - = "any" - fun user(id: String): String - = "user:$id" - fun users(): String - = "users" - fun guests(): String - = "guests" - fun team(id: String, role: String = ""): String - = if(role.isEmpty()) { - "team:$id" - } else { - "team:$id/$role" - } - fun status(status: String): String - = "status:$status" + fun any(): String = "any" + + fun user(id: String): String = "user:$id" + + fun users(): String = "users" + + fun guests(): String = "guests" + + fun team(id: String, role: String = ""): String = if(role.isEmpty()) { + "team:$id" + } else { + "team:$id/$role" + } + + fun member(id: String): String = "member:$id" + + fun status(status: String): String = "status:$status" } } \ No newline at end of file diff --git a/templates/dart/lib/role.dart.twig b/templates/dart/lib/role.dart.twig index 65ebf83657..43a2ff9827 100644 --- a/templates/dart/lib/role.dart.twig +++ b/templates/dart/lib/role.dart.twig @@ -23,6 +23,10 @@ class Role { } return 'team:$id/$role'; } + + static String member(String id) { + return 'member:$id'; + } static String status(String status) { return 'status:$status'; diff --git a/templates/deno/src/role.ts.twig b/templates/deno/src/role.ts.twig index c0e7bd761c..4b00bb15c4 100644 --- a/templates/deno/src/role.ts.twig +++ b/templates/deno/src/role.ts.twig @@ -21,6 +21,10 @@ export class Role { } return `team:${id}/${role}` } + + public static member(id: string): string { + return `member:${id}` + } public static status(status: string): string { return `status:${status}` diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig index 39ee8f7393..c1d9703b09 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig @@ -2,21 +2,22 @@ package {{ sdk.namespace | caseDot }} class Role { companion object { - fun any(): String - = "any" - fun user(id: String): String - = "user:$id" - fun users(): String - = "users" - fun guests(): String - = "guests" - fun team(id: String, role: String = ""): String - = if(role.isEmpty()) { - "team:$id" - } else { - "team:$id/$role" - } - fun status(status: String): String - = "status:$status" + fun any(): String = "any" + + fun user(id: String): String = "user:$id" + + fun users(): String = "users" + + fun guests(): String= "guests" + + fun team(id: String, role: String = ""): String = if(role.isEmpty()) { + "team:$id" + } else { + "team:$id/$role" + } + + fun member(id: String): String = "member:$id" + + fun status(status: String): String = "status:$status" } } \ No newline at end of file diff --git a/templates/node/lib/role.js.twig b/templates/node/lib/role.js.twig index bb35d0f8e8..028f50f18b 100644 --- a/templates/node/lib/role.js.twig +++ b/templates/node/lib/role.js.twig @@ -17,6 +17,9 @@ class Role { } return 'team:' + id + '/' + role } + static member = (id) => { + return 'member:' + id + } static status = (status) => { return 'status:' + status } diff --git a/templates/php/src/Role.php.twig b/templates/php/src/Role.php.twig index 8225a9db94..dfdad89534 100644 --- a/templates/php/src/Role.php.twig +++ b/templates/php/src/Role.php.twig @@ -27,6 +27,10 @@ class Role } return "team:$id/$role"; } + public static function member(string $id): string + { + return "member:$id"; + } public static function status(string $status): string { return "status:$status"; diff --git a/templates/python/package/role.py.twig b/templates/python/package/role.py.twig index 3d02b69cda..4a17e99fa7 100644 --- a/templates/python/package/role.py.twig +++ b/templates/python/package/role.py.twig @@ -21,6 +21,10 @@ class Role: return f'team:{id}/{role}' return f'team:{id}' + @staticmethod + def member(id): + return f'member:{id}' + @staticmethod def status(status): return f'status:{status}' \ No newline at end of file diff --git a/templates/ruby/lib/container/role.rb.twig b/templates/ruby/lib/container/role.rb.twig index 393da16393..753f7d0551 100644 --- a/templates/ruby/lib/container/role.rb.twig +++ b/templates/ruby/lib/container/role.rb.twig @@ -23,6 +23,10 @@ module {{spec.title | caseUcfirst}} "team:#{id}/#{role}" end end + + def self.member(id) + "member:#{id}" + end def self.status(status) "status:#{status}" diff --git a/templates/swift/Sources/Role.swift.twig b/templates/swift/Sources/Role.swift.twig index 32a7a393c2..7984fe35eb 100644 --- a/templates/swift/Sources/Role.swift.twig +++ b/templates/swift/Sources/Role.swift.twig @@ -22,6 +22,10 @@ public class Role { return "team:\(id)/\(role)" } + public static func member(_ id: String) -> String { + return "member:\(id)" + } + public static func status(_ status: String) -> String { return "status:\(status)" } diff --git a/templates/web/src/role.ts.twig b/templates/web/src/role.ts.twig index c0e7bd761c..4b00bb15c4 100644 --- a/templates/web/src/role.ts.twig +++ b/templates/web/src/role.ts.twig @@ -21,6 +21,10 @@ export class Role { } return `team:${id}/${role}` } + + public static member(id: string): string { + return `member:${id}` + } public static status(status: string): string { return `status:${status}` From 9492636a72b4014c4dd96175cf7001ff7a5b10b2 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 9 Sep 2022 13:06:02 +1200 Subject: [PATCH 403/555] Add member role helper tests --- tests/Base.php | 3 +- tests/languages/android/Tests.kt | 1 + tests/languages/dart/tests.dart | 1 + tests/languages/deno/tests.ts | 1 + tests/languages/flutter/tests.dart | 1 + tests/languages/kotlin/Tests.kt | 1 + tests/languages/node/test.js | 1 + tests/languages/php/test.php | 2 +- tests/languages/python/tests.py | 1 + tests/languages/ruby/tests.rb | 66 ++++++++++++------------ tests/languages/swift-client/Tests.swift | 61 +++++++++++----------- tests/languages/swift-server/Tests.swift | 61 +++++++++++----------- 12 files changed, 104 insertions(+), 96 deletions(-) diff --git a/tests/Base.php b/tests/Base.php index f3e3bc07b5..dfde7d843f 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -78,7 +78,8 @@ abstract class Base extends TestCase 'create("users")', 'update("guests")', 'delete("team:teamId/owner")', - 'delete("team:teamId")' + 'delete("team:teamId")', + 'create("member:memberId")', ]; const ID_HELPER_RESPONSES = [ diff --git a/tests/languages/android/Tests.kt b/tests/languages/android/Tests.kt index aee90e7ca0..ea728854ae 100644 --- a/tests/languages/android/Tests.kt +++ b/tests/languages/android/Tests.kt @@ -180,6 +180,7 @@ class ServiceTest { writeToFile(Permission.update(Role.guests())) writeToFile(Permission.delete(Role.team("teamId", "owner"))) writeToFile(Permission.delete(Role.team("teamId"))) + writeToFile(Permission.create(Role.member("memberId"))) // ID helper tests writeToFile(ID.unique()) diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 40afe43eb6..58fc8c4403 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -108,6 +108,7 @@ void main() async { print(Permission.update(Role.guests())); print(Permission.delete(Role.team('teamId', 'owner'))); print(Permission.delete(Role.team('teamId'))); + print(Permission.create(Role.member("memberId"))); // ID helper tests print(ID.unique()); diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts index bb937c45f0..8a3fe3be0f 100644 --- a/tests/languages/deno/tests.ts +++ b/tests/languages/deno/tests.ts @@ -117,6 +117,7 @@ async function start() { console.log(Permission.update(Role.guests())); console.log(Permission.delete(Role.team('teamId', 'owner'))); console.log(Permission.delete(Role.team('teamId'))); + console.log(Permission.create(Role.member("memberId"))); // ID helper tests console.log(ID.unique()); diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index b7b5490151..d467f03fc6 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -128,6 +128,7 @@ void main() async { print(Permission.update(Role.guests())); print(Permission.delete(Role.team('teamId', 'owner'))); print(Permission.delete(Role.team('teamId'))); + print(Permission.create(Role.member("memberId"))); // ID helper tests print(ID.unique()); diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt index 0dfb8b90d1..4ac3a269a0 100644 --- a/tests/languages/kotlin/Tests.kt +++ b/tests/languages/kotlin/Tests.kt @@ -140,6 +140,7 @@ class ServiceTest { writeToFile(Permission.update(Role.guests())) writeToFile(Permission.delete(Role.team("teamId", "owner"))) writeToFile(Permission.delete(Role.team("teamId"))) + writeToFile(Permission.create(Role.member("memberId"))) // ID helper tests writeToFile(ID.unique()) diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index cb5b453c8f..bbdffa43c6 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -105,6 +105,7 @@ async function start() { console.log(Permission.update(Role.guests())); console.log(Permission.delete(Role.team('teamId', 'owner'))); console.log(Permission.delete(Role.team('teamId'))); + console.log(Permission.create(Role.member("memberId"))); // ID helper tests console.log(ID.unique()); diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index 2255d60ac5..878c537efc 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -123,7 +123,7 @@ echo Permission::update(Role::guests()) . "\n"; echo Permission::delete(Role::team('teamId', 'owner')) . "\n"; echo Permission::delete(Role::team('teamId')) . "\n"; - +echo Permission::create(Role::member('memberId')) . "\n"; // ID helper tests echo ID::unique() . "\n"; echo ID::custom('custom_id') . "\n"; diff --git a/tests/languages/python/tests.py b/tests/languages/python/tests.py index a906571a18..1d0a1331eb 100644 --- a/tests/languages/python/tests.py +++ b/tests/languages/python/tests.py @@ -112,6 +112,7 @@ print(Permission.update(Role.guests())) print(Permission.delete(Role.team('teamId', 'owner'))) print(Permission.delete(Role.team('teamId'))) +print(Permission.create(Role.member('memberId'))) # ID helper tests print(ID.unique()) diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index 7872857ba1..b5e2b142a4 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -1,16 +1,13 @@ require_relative '../../sdks/ruby/lib/appwrite' -query = Appwrite::Query -permission = Appwrite::Permission -role = Appwrite::Role -id = Appwrite::ID +include Appwrite -client = Appwrite::Client.new +client = Client.new client.add_header('Origin', 'http://localhost') -foo = Appwrite::Foo.new(client) -bar = Appwrite::Bar.new(client) -general = Appwrite::General.new(client) +foo = Foo.new(client) +bar = Bar.new(client) +general = General.new(client) puts '' puts 'Test Started' @@ -55,14 +52,14 @@ puts response["result"] begin - response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.from_path('./tests/resources/file.png')) + response = general.upload(x: 'string', y: 123, z:['string in array'], file: InputFile.from_path('./tests/resources/file.png')) puts response.result rescue => e puts e end begin - response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.from_path('./tests/resources/large_file.mp4')) + response = general.upload(x: 'string', y: 123, z:['string in array'], file: InputFile.from_path('./tests/resources/large_file.mp4')) puts response.result rescue => e puts e @@ -70,7 +67,7 @@ begin string = IO.read('./tests/resources/file.png') - response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.from_string(string, filename:'file.png', mime_type: 'image/png')) + response = general.upload(x: 'string', y: 123, z:['string in array'], file: InputFile.from_string(string, filename:'file.png', mime_type: 'image/png')) puts response.result rescue => e puts e @@ -78,7 +75,7 @@ begin string = IO.read('./tests/resources/large_file.mp4') - response = general.upload(x: 'string', y: 123, z:['string in array'], file: Appwrite::InputFile.from_string(string, filename:'large_file.mp4', mime_type: 'video/mp4')) + response = general.upload(x: 'string', y: 123, z:['string in array'], file: InputFile.from_string(string, filename:'large_file.mp4', mime_type: 'video/mp4')) puts response.result rescue => e puts e @@ -86,48 +83,49 @@ begin general.error400() -rescue Appwrite::Exception => error +rescue Exception => error puts error.message end begin general.error500() -rescue Appwrite::Exception => error +rescue Exception => error puts error.message end begin general.error502() -rescue Appwrite::Exception => error +rescue Exception => error puts error.message end general.empty() # Query helper tests -puts query.equal('title', ['Spiderman', 'Dr. Strange']) -puts query.notEqual('title', 'Spiderman') -puts query.lessThan('releasedYear', 1990) -puts query.greaterThan('releasedYear', 1990) -puts query.search('name', 'john') -puts query.orderAsc("title") -puts query.orderDesc("title") -puts query.cursorAfter("my_movie_id") -puts query.cursorBefore("my_movie_id") -puts query.limit(50) -puts query.offset(20) +puts Query.equal('title', ['Spiderman', 'Dr. Strange']) +puts Query.notEqual('title', 'Spiderman') +puts Query.lessThan('releasedYear', 1990) +puts Query.greaterThan('releasedYear', 1990) +puts Query.search('name', 'john') +puts Query.orderAsc("title") +puts Query.orderDesc("title") +puts Query.cursorAfter("my_movie_id") +puts Query.cursorBefore("my_movie_id") +puts Query.limit(50) +puts Query.offset(20) # Permission & Role helper tests -puts permission.read(role.any()) -puts permission.write(role.user(id.custom('userid'))) -puts permission.create(role.users()) -puts permission.update(role.guests()) -puts permission.delete(role.team('teamId', 'owner')) -puts permission.delete(role.team('teamId')) +puts Permission.read(Role.any()) +puts Permission.write(Role.user(id.custom('userid'))) +puts Permission.create(Role.users()) +puts Permission.update(Role.guests()) +puts Permission.delete(Role.team('teamId', 'owner')) +puts Permission.delete(Role.team('teamId')) +puts Permission.create(Role.member('memberId')) # ID helper tests -puts id.unique() -puts id.custom('custom_id') +puts ID.unique() +puts ID.custom('custom_id') response = general.headers() puts response.result \ No newline at end of file diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/swift-client/Tests.swift index c187f1c148..eb20edeb84 100644 --- a/tests/languages/swift-client/Tests.swift +++ b/tests/languages/swift-client/Tests.swift @@ -82,16 +82,16 @@ class Tests: XCTestCase { var file = InputFile.fromPath("\(FileManager.default.currentDirectoryPath)/../../resources/file.png") mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) print(mock.result) - } catch let error as AppwriteError { - print(error.message) + } catch { + print(error.localizedDescription) } do { var file = InputFile.fromPath("\(FileManager.default.currentDirectoryPath)/../../resources/large_file.mp4") mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) print(mock.result) - } catch let error as AppwriteError { - print(error.message) + } catch { + print(error.localizedDescription) } do { @@ -100,8 +100,8 @@ class Tests: XCTestCase { var file = InputFile.fromBuffer(buffer, filename: "file.png", mimeType: "image/png") mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) print(mock.result) - } catch let error as AppwriteError { - print(error.message) + } catch { + print(error.localizedDescription) } do { @@ -110,14 +110,14 @@ class Tests: XCTestCase { var file = InputFile.fromBuffer(buffer, filename: "large_file.mp4", mimeType: "video/mp4") mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) print(mock.result) - } catch let error as AppwriteError { - print(error.message) + } catch { + print(error.localizedDescription) } do { try await general.error400() - } catch let error as AppwriteError { - print(error.message) + } catch { + print(error.localizedDescription) } do { @@ -129,7 +129,7 @@ class Tests: XCTestCase { do { try await general.error502() } catch { - print(String(describing: error)) + print(error.localizedDescription) } wait(for: [expectation], timeout: 10.0) @@ -144,29 +144,30 @@ class Tests: XCTestCase { try! await general.empty() // Query helper tests - print(Query.equal("title", value: ["Spiderman", "Dr. Strange"])); - print(Query.notEqual("title", value: "Spiderman")); - print(Query.lessThan("releasedYear", value: 1990)); - print(Query.greaterThan("releasedYear", value: 1990)); - print(Query.search("name", value: "john")); - print(Query.orderAsc("title")); - print(Query.orderDesc("title")); - print(Query.cursorAfter("my_movie_id")); - print(Query.cursorBefore("my_movie_id")); - print(Query.limit(50)); - print(Query.offset(20)); + print(Query.equal("title", value: ["Spiderman", "Dr. Strange"])) + print(Query.notEqual("title", value: "Spiderman")) + print(Query.lessThan("releasedYear", value: 1990)) + print(Query.greaterThan("releasedYear", value: 1990)) + print(Query.search("name", value: "john")) + print(Query.orderAsc("title")) + print(Query.orderDesc("title")) + print(Query.cursorAfter("my_movie_id")) + print(Query.cursorBefore("my_movie_id")) + print(Query.limit(50)) + print(Query.offset(20)) // Permission & Role helper tests - print(Permission.read(Role.any())); - print(Permission.write(Role.user(ID.custom("userid")))); - print(Permission.create(Role.users())); - print(Permission.update(Role.guests())); - print(Permission.delete(Role.team("teamId", "owner"))); - print(Permission.delete(Role.team("teamId"))); + print(Permission.read(Role.any())) + print(Permission.write(Role.user(ID.custom("userid")))) + print(Permission.create(Role.users())) + print(Permission.update(Role.guests())) + print(Permission.delete(Role.team("teamId", "owner"))) + print(Permission.delete(Role.team("teamId"))) + print(Permission.create(Role.member("memberId"))) // ID helper tests - print(ID.unique()); - print(ID.custom("custom_id")); + print(ID.unique()) + print(ID.custom("custom_id")) mock = try await general.headers() print(mock.result) diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index 8832c92d8d..4f288a82c1 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -72,16 +72,16 @@ class Tests: XCTestCase { var file = InputFile.fromPath("\(FileManager.default.currentDirectoryPath)/../../resources/file.png") mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) print(mock.result) - } catch let error as AppwriteError { - print(error.message) + } catch { + print(error.localizedDescription) } do { var file = InputFile.fromPath("\(FileManager.default.currentDirectoryPath)/../../resources/large_file.mp4") mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) print(mock.result) - } catch let error as AppwriteError { - print(error.message) + } catch { + print(error.localizedDescription) } do { @@ -90,8 +90,8 @@ class Tests: XCTestCase { var file = InputFile.fromBuffer(buffer, filename: "file.png", mimeType: "image/png") mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) print(mock.result) - } catch let error as AppwriteError { - print(error.message) + } catch { + print(error.localizedDescription) } do { @@ -100,14 +100,14 @@ class Tests: XCTestCase { var file = InputFile.fromBuffer(buffer, filename: "large_file.mp4", mimeType: "video/mp4") mock = try await general.upload(x: "string", y: 123, z: ["string in array"], file: file, onProgress: nil) print(mock.result) - } catch let error as AppwriteError { - print(error.message) + } catch { + print(error.localizedDescription) } do { try await general.error400() - } catch let error as AppwriteError { - print(error.message) + } catch { + print(error.localizedDescription) } do { @@ -119,35 +119,36 @@ class Tests: XCTestCase { do { try await general.error502() } catch { - print(String(describing: error)) + print(error.localizedDescription) } try! await general.empty() // Query helper tests - print(Query.equal("title", value: ["Spiderman", "Dr. Strange"])); - print(Query.notEqual("title", value: "Spiderman")); - print(Query.lessThan("releasedYear", value: 1990)); - print(Query.greaterThan("releasedYear", value: 1990)); - print(Query.search("name", value: "john")); - print(Query.orderAsc("title")); - print(Query.orderDesc("title")); - print(Query.cursorAfter("my_movie_id")); - print(Query.cursorBefore("my_movie_id")); - print(Query.limit(50)); - print(Query.offset(20)); + print(Query.equal("title", value: ["Spiderman", "Dr. Strange"])) + print(Query.notEqual("title", value: "Spiderman")) + print(Query.lessThan("releasedYear", value: 1990)) + print(Query.greaterThan("releasedYear", value: 1990)) + print(Query.search("name", value: "john")) + print(Query.orderAsc("title")) + print(Query.orderDesc("title")) + print(Query.cursorAfter("my_movie_id")) + print(Query.cursorBefore("my_movie_id")) + print(Query.limit(50)) + print(Query.offset(20)) // Permission & Role helper tests - print(Permission.read(Role.any())); - print(Permission.write(Role.user(ID.custom("userid")))); - print(Permission.create(Role.users())); - print(Permission.update(Role.guests())); - print(Permission.delete(Role.team("teamId", "owner"))); - print(Permission.delete(Role.team("teamId"))); + print(Permission.read(Role.any())) + print(Permission.write(Role.user(ID.custom("userid")))) + print(Permission.create(Role.users())) + print(Permission.update(Role.guests())) + print(Permission.delete(Role.team("teamId", "owner"))) + print(Permission.delete(Role.team("teamId"))) + print(Permission.create(Role.team("memberId"))) // ID helper tests - print(ID.unique()); - print(ID.custom("custom_id")); + print(ID.unique()) + print(ID.custom("custom_id")) mock = try await general.headers() print(mock.result) From fe00e826dcfc37c381e02c31b35af475709110d7 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 9 Sep 2022 13:06:17 +1200 Subject: [PATCH 404/555] Name fix --- tests/languages/ruby/tests.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index b5e2b142a4..a25443cd6b 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -116,7 +116,7 @@ # Permission & Role helper tests puts Permission.read(Role.any()) -puts Permission.write(Role.user(id.custom('userid'))) +puts Permission.write(Role.user(ID.custom('userid'))) puts Permission.create(Role.users()) puts Permission.update(Role.guests()) puts Permission.delete(Role.team('teamId', 'owner')) From 88d3a96bcfd2fa0205314a81943807a9364803c7 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 9 Sep 2022 16:08:02 +1200 Subject: [PATCH 405/555] Fix tests --- tests/languages/swift-server/Tests.swift | 2 +- tests/languages/web/index.html | 1 + tests/languages/web/node.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index 4f288a82c1..dd51203d44 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -144,7 +144,7 @@ class Tests: XCTestCase { print(Permission.update(Role.guests())) print(Permission.delete(Role.team("teamId", "owner"))) print(Permission.delete(Role.team("teamId"))) - print(Permission.create(Role.team("memberId"))) + print(Permission.create(Role.member("memberId"))) // ID helper tests print(ID.unique()) diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index 9d7056aa30..9c6d77b5bc 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -133,6 +133,7 @@ console.log(Permission.update(Role.guests())); console.log(Permission.delete(Role.team('teamId', 'owner'))); console.log(Permission.delete(Role.team('teamId'))); + console.log(Permission.create(Role.member('memberId'))); // ID helper tests console.log(ID.unique()); diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js index 70d57ea19a..b9537e0314 100644 --- a/tests/languages/web/node.js +++ b/tests/languages/web/node.js @@ -90,6 +90,7 @@ async function start() { console.log(Permission.update(Role.guests())); console.log(Permission.delete(Role.team('teamId', 'owner'))); console.log(Permission.delete(Role.team('teamId'))); + console.log(Permission.create(Role.member('memberId'))); // ID helper tests console.log(ID.unique()); From 3784b4dd25e429eb1baf59ee0a5210677d4c4ef8 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 9 Sep 2022 17:19:27 +1200 Subject: [PATCH 406/555] Temporarily disable realtime tests --- tests/FlutterBetaTest.php | 2 +- tests/FlutterStableTest.php | 2 +- tests/SwiftClient55Test.php | 2 +- tests/languages/flutter/tests.dart | 8 ++++---- tests/languages/swift-client/Tests.swift | 16 ++++++++-------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/FlutterBetaTest.php b/tests/FlutterBetaTest.php index 278fd9cb95..bbb1ff2bf5 100644 --- a/tests/FlutterBetaTest.php +++ b/tests/FlutterBetaTest.php @@ -24,7 +24,7 @@ class FlutterBetaTest extends Base ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, - ...Base::REALTIME_RESPONSES, + //...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, ...Base::PERMISSION_HELPER_RESPONSES, diff --git a/tests/FlutterStableTest.php b/tests/FlutterStableTest.php index ee5057ac8e..342820ddd4 100644 --- a/tests/FlutterStableTest.php +++ b/tests/FlutterStableTest.php @@ -24,7 +24,7 @@ class FlutterStableTest extends Base ...Base::GENERAL_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, - ...Base::REALTIME_RESPONSES, + //...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, ...Base::PERMISSION_HELPER_RESPONSES, diff --git a/tests/SwiftClient55Test.php b/tests/SwiftClient55Test.php index 799c8abb7f..b5e1ffe7f6 100644 --- a/tests/SwiftClient55Test.php +++ b/tests/SwiftClient55Test.php @@ -26,7 +26,7 @@ class SwiftClient55Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, - ...Base::REALTIME_RESPONSES, + //...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, ...Base::PERMISSION_HELPER_RESPONSES, diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index d467f03fc6..b1ed71da9b 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -93,10 +93,10 @@ void main() async { print(e.message); } - rtsub.stream.listen((message) { - print(message.payload["response"]); - rtsub.close(); - }); + // rtsub.stream.listen((message) { + // print(message.payload["response"]); + // rtsub.close(); + // }); await Future.delayed(Duration(seconds: 5)); diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/swift-client/Tests.swift index eb20edeb84..0a5f997fc0 100644 --- a/tests/languages/swift-client/Tests.swift +++ b/tests/languages/swift-client/Tests.swift @@ -31,12 +31,12 @@ class Tests: XCTestCase { let realtime = Realtime(client) var realtimeResponse = "Realtime failed!" - let expectation = XCTestExpectation(description: "realtime server") - - realtime.subscribe(channels: ["tests"]) { message in - realtimeResponse = message.payload!["response"] as! String - expectation.fulfill() - } +// let expectation = XCTestExpectation(description: "realtime server") +// +// realtime.subscribe(channels: ["tests"]) { message in +// realtimeResponse = message.payload!["response"] as! String +// expectation.fulfill() +// } var mock: Mock @@ -132,8 +132,8 @@ class Tests: XCTestCase { print(error.localizedDescription) } - wait(for: [expectation], timeout: 10.0) - print(realtimeResponse) +// wait(for: [expectation], timeout: 10.0) +// print(realtimeResponse) mock = try await general.setCookie() print(mock.result) From 9de26b31031ccfe8db91daf21d37ddb091ec0a7b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 9 Sep 2022 17:41:21 +1200 Subject: [PATCH 407/555] Don't subscribe flutter --- tests/languages/flutter/tests.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index b1ed71da9b..73bfa82e45 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -15,7 +15,7 @@ void main() async { "wss://demo.appwrite.io/v1"); // change this later to appwrite.io Realtime realtime = Realtime(client); - final rtsub = realtime.subscribe(["tests"]); + // final rtsub = realtime.subscribe(["tests"]); await Future.delayed(Duration(seconds: 5)); client.addHeader('Origin', 'http://localhost'); From f0945315eda32138825cafe7bf13a1836171aab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sun, 11 Sep 2022 18:25:09 +0000 Subject: [PATCH 408/555] CLI: Fix bigInt, add 1.0 support --- templates/cli/lib/client.js.twig | 1 + templates/cli/lib/commands/deploy.js.twig | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/templates/cli/lib/client.js.twig b/templates/cli/lib/client.js.twig index b13764a122..aca94bb5e2 100644 --- a/templates/cli/lib/client.js.twig +++ b/templates/cli/lib/client.js.twig @@ -137,6 +137,7 @@ class Client { method.toUpperCase() === "GET" || contentType.startsWith("multipart/form-data") ? formData : params, json: contentType.startsWith("application/json"), transformRequest: method.toUpperCase() === "GET" || contentType.startsWith("multipart/form-data") ? undefined : (data) => JSONbig.stringify(data), + transformResponse: [ (data) => data ? JSONbig.parse(data) : data ], responseType: responseType, }; try { diff --git a/templates/cli/lib/commands/deploy.js.twig b/templates/cli/lib/commands/deploy.js.twig index 4161669e81..c15b618e05 100644 --- a/templates/cli/lib/commands/deploy.js.twig +++ b/templates/cli/lib/commands/deploy.js.twig @@ -15,6 +15,7 @@ const { databasesCreateIntegerAttribute, databasesCreateFloatAttribute, databasesCreateEmailAttribute, + databasesCreateDatetimeAttribute, databasesCreateIndex, databasesCreateUrlAttribute, databasesCreateIpAttribute, @@ -338,6 +339,15 @@ const createAttribute = async (databaseId, collectionId, attribute) => { case 'boolean': return databasesCreateBooleanAttribute({ databaseId, + collectionId, + key: attribute.key, + required: attribute.required, + xdefault: attribute.default, + array: attribute.array, + parseOutput: false + }) + case 'datetime': + return databasesCreateDatetimeAttribute({ databaseId, collectionId, key: attribute.key, @@ -494,9 +504,8 @@ const deployCollection = async ({ all } = {}) => { databaseId, collectionId: collection['$id'], name: collection.name, - permission: collection.permission, - read: collection['$read'], - write: collection['$write'], + documentSecurity: collection.documentSecurity, + '$permissions': collection['$permissions'], parseOutput: false }) From fd8984f515e9effb40876d9fedc90d9c8f83fd83 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 12 Sep 2022 18:24:26 +1200 Subject: [PATCH 409/555] Convert bool to lower case string for queries --- templates/python/package/query.py.twig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/python/package/query.py.twig b/templates/python/package/query.py.twig index 7df3c1fa60..7896958367 100644 --- a/templates/python/package/query.py.twig +++ b/templates/python/package/query.py.twig @@ -62,5 +62,7 @@ class Query: def parseValues(value): if type(value) == str: return f'"{value}"' + elif type(value) == bool: + return str(value).lower() else: return str(value) \ No newline at end of file From ae7e56d89e0f984d090a0de5bd3f12531af4ea0b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 12 Sep 2022 18:29:46 +1200 Subject: [PATCH 410/555] Add bool query tests --- tests/Base.php | 1 + tests/languages/android/Tests.kt | 1 + tests/languages/dart/tests.dart | 1 + tests/languages/deno/tests.ts | 1 + tests/languages/flutter/tests.dart | 1 + tests/languages/kotlin/Tests.kt | 1 + tests/languages/node/test.js | 1 + tests/languages/php/test.php | 1 + tests/languages/python/tests.py | 1 + tests/languages/ruby/tests.rb | 1 + tests/languages/swift-client/Tests.swift | 1 + tests/languages/swift-server/Tests.swift | 1 + tests/languages/web/index.html | 1 + tests/languages/web/node.js | 1 + 14 files changed, 14 insertions(+) diff --git a/tests/Base.php b/tests/Base.php index dfde7d843f..e4d020f156 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -59,6 +59,7 @@ abstract class Base extends TestCase ]; const QUERY_HELPER_RESPONSES = [ + 'equal("released", ["true"])', 'equal("title", ["Spiderman","Dr. Strange"])', 'notEqual("title", ["Spiderman"])', 'lessThan("releasedYear", [1990])', diff --git a/tests/languages/android/Tests.kt b/tests/languages/android/Tests.kt index ea728854ae..c29c1217a2 100644 --- a/tests/languages/android/Tests.kt +++ b/tests/languages/android/Tests.kt @@ -161,6 +161,7 @@ class ServiceTest { general.empty() // Query helper tests + writeToFile(Query.equal("released", listOf(true))) writeToFile(Query.equal("title", listOf("Spiderman", "Dr. Strange"))) writeToFile(Query.notEqual("title", "Spiderman")) writeToFile(Query.lessThan("releasedYear", 1990)) diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 58fc8c4403..6b6d36b757 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -89,6 +89,7 @@ void main() async { await general.empty(); // Query helper tests + print(Query.equal('released', [true])); print(Query.equal('title', ['Spiderman', 'Dr. Strange'])); print(Query.notEqual('title', 'Spiderman')); print(Query.lessThan('releasedYear', 1990)); diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts index 8a3fe3be0f..ea89e07307 100644 --- a/tests/languages/deno/tests.ts +++ b/tests/languages/deno/tests.ts @@ -98,6 +98,7 @@ async function start() { await general.empty(); // Query helper tests + console.log(Query.equal('released', [true])); console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); console.log(Query.notEqual('title', 'Spiderman')); console.log(Query.lessThan('releasedYear', 1990)); diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index 73bfa82e45..d7b86486a0 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -109,6 +109,7 @@ void main() async { await general.empty(); // Query helper tests + print(Query.equal('released', [true])); print(Query.equal('title', ['Spiderman', 'Dr. Strange'])); print(Query.notEqual('title', 'Spiderman')); print(Query.lessThan('releasedYear', 1990)); diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt index 4ac3a269a0..1d2eeeb7bb 100644 --- a/tests/languages/kotlin/Tests.kt +++ b/tests/languages/kotlin/Tests.kt @@ -121,6 +121,7 @@ class ServiceTest { general.empty() // Query helper tests + writeToFile(Query.equal("released", listOf(true))) writeToFile(Query.equal("title", listOf("Spiderman", "Dr. Strange"))) writeToFile(Query.notEqual("title", "Spiderman")) writeToFile(Query.lessThan("releasedYear", 1990)) diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index bbdffa43c6..0e7ea0fd45 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -86,6 +86,7 @@ async function start() { await general.empty(); // Query helper tests + console.log(Query.equal('released', [true])); console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); console.log(Query.notEqual('title', 'Spiderman')); console.log(Query.lessThan('releasedYear', 1990)); diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index 878c537efc..2bc29bb59a 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -104,6 +104,7 @@ $general->empty(); // Query helper tests +echo Query::equal('released', [true]) . "\n"; echo Query::equal('title', ['Spiderman', 'Dr. Strange']) . "\n"; echo Query::notEqual('title', 'Spiderman') . "\n"; echo Query::lessThan('releasedYear', 1990) . "\n"; diff --git a/tests/languages/python/tests.py b/tests/languages/python/tests.py index 1d0a1331eb..e044550871 100644 --- a/tests/languages/python/tests.py +++ b/tests/languages/python/tests.py @@ -93,6 +93,7 @@ general.empty() # Query helper tests +print(Query.equal('released', [True])) print(Query.equal('title', ['Spiderman', 'Dr. Strange'])) print(Query.notEqual('title', 'Spiderman')) print(Query.lessThan('releasedYear', 1990)) diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index a25443cd6b..467900d7f6 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -102,6 +102,7 @@ general.empty() # Query helper tests +puts Query.equal('released', [true]) puts Query.equal('title', ['Spiderman', 'Dr. Strange']) puts Query.notEqual('title', 'Spiderman') puts Query.lessThan('releasedYear', 1990) diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/swift-client/Tests.swift index 0a5f997fc0..cb62565b86 100644 --- a/tests/languages/swift-client/Tests.swift +++ b/tests/languages/swift-client/Tests.swift @@ -144,6 +144,7 @@ class Tests: XCTestCase { try! await general.empty() // Query helper tests + print(Query.equal("released", value: [true])) print(Query.equal("title", value: ["Spiderman", "Dr. Strange"])) print(Query.notEqual("title", value: "Spiderman")) print(Query.lessThan("releasedYear", value: 1990)) diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index dd51203d44..b3d624b69c 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -125,6 +125,7 @@ class Tests: XCTestCase { try! await general.empty() // Query helper tests + print(Query.equal("released", value: [true])) print(Query.equal("title", value: ["Spiderman", "Dr. Strange"])) print(Query.notEqual("title", value: "Spiderman")) print(Query.lessThan("releasedYear", value: 1990)) diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index 9c6d77b5bc..d52eed82e4 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -114,6 +114,7 @@ console.log(responseRealtime) // Query helper tests + console.log(Query.equal('released', [true])); console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); console.log(Query.notEqual('title', 'Spiderman')); console.log(Query.lessThan('releasedYear', 1990)); diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js index b9537e0314..bdba4ba6a9 100644 --- a/tests/languages/web/node.js +++ b/tests/languages/web/node.js @@ -71,6 +71,7 @@ async function start() { console.log('WS:/v1/realtime:passed'); // Skip realtime test on Node.js // Query helper tests + console.log(Query.equal('released', [true])); console.log(Query.equal('title', ['Spiderman', 'Dr. Strange'])); console.log(Query.notEqual('title', 'Spiderman')); console.log(Query.lessThan('releasedYear', 1990)); From 77fc00b7fdf360adf64c4aaaa2e950875178ce7d Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 12 Sep 2022 19:06:33 +1200 Subject: [PATCH 411/555] Fix tests --- tests/Base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Base.php b/tests/Base.php index e4d020f156..6d99d400af 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -59,7 +59,7 @@ abstract class Base extends TestCase ]; const QUERY_HELPER_RESPONSES = [ - 'equal("released", ["true"])', + 'equal("released", [true])', 'equal("title", ["Spiderman","Dr. Strange"])', 'notEqual("title", ["Spiderman"])', 'lessThan("releasedYear", [1990])', From c920ae33d03ac9b19efeb430fe66e1f1bdabb26d Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 12 Sep 2022 19:45:27 +1200 Subject: [PATCH 412/555] Fix PHP bool value queries --- templates/php/src/Query.php.twig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/php/src/Query.php.twig b/templates/php/src/Query.php.twig index 499158548c..828345a6ee 100644 --- a/templates/php/src/Query.php.twig +++ b/templates/php/src/Query.php.twig @@ -167,6 +167,12 @@ class Query */ private static function parseValues($value): string { - return is_string($value) ? '"' . $value . '"' : $value; + if (is_string($value)) { + return '"' . $value . '"'; + } + if (is_bool($value)) { + return $value ? 'true' : 'false'; + } + return $value; } } From e3e577618b4ec7b12f8588d2c189bf2ab1f6d9c1 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 13 Sep 2022 16:09:53 +0000 Subject: [PATCH 413/555] feat: add status helper --- .../src/main/java/io/appwrite/Role.kt.twig | 14 +++++++++++--- templates/dart/lib/role.dart.twig | 14 ++++++++++---- templates/deno/src/role.ts.twig | 14 ++++++++++---- .../src/main/kotlin/io/appwrite/Role.kt.twig | 12 ++++++++++-- templates/node/lib/role.js.twig | 14 ++++++++++---- templates/php/src/Role.php.twig | 14 ++++++++++---- templates/python/package/role.py.twig | 8 ++++++-- templates/ruby/lib/container/role.rb.twig | 16 ++++++++++++---- templates/swift/Sources/Role.swift.twig | 14 ++++++++++---- templates/web/src/role.ts.twig | 14 ++++++++++---- tests/Base.php | 2 ++ tests/languages/android/Tests.kt | 2 ++ tests/languages/dart/tests.dart | 2 ++ tests/languages/deno/tests.ts | 2 ++ tests/languages/flutter/tests.dart | 2 ++ tests/languages/kotlin/Tests.kt | 2 ++ tests/languages/node/test.js | 2 ++ tests/languages/php/test.php | 3 +++ tests/languages/python/tests.py | 2 ++ tests/languages/ruby/tests.rb | 2 ++ tests/languages/swift-client/Tests.swift | 2 ++ tests/languages/swift-server/Tests.swift | 2 ++ tests/languages/web/index.html | 3 +++ tests/languages/web/node.js | 3 +++ 24 files changed, 130 insertions(+), 35 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig index 99edb87b37..a99e5e1c22 100644 --- a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig @@ -4,11 +4,19 @@ class Role { companion object { fun any(): String = "any" - fun user(id: String): String = "user:$id" + fun user(id: String, status: String): String = if(status.isEmpty()) { + "user:$id" + } else { + "user:$id/$status" + } - fun users(): String = "users" + fun users(status: String): String = if(status.isEmpty()) { + "users" + } else { + "users/$status" + } - fun guests(): String = "guests" + fun guests(): String= "guests" fun team(id: String, role: String = ""): String = if(role.isEmpty()) { "team:$id" diff --git a/templates/dart/lib/role.dart.twig b/templates/dart/lib/role.dart.twig index 43a2ff9827..0c1c4a4953 100644 --- a/templates/dart/lib/role.dart.twig +++ b/templates/dart/lib/role.dart.twig @@ -5,12 +5,18 @@ class Role { return 'any'; } - static String user(String id) { - return 'user:$id'; + static String user(String id, [String status = '']) { + if(status.isEmpty) { + return 'user:$id'; + } + return 'user:$id/$status'; } - static String users() { - return 'users'; + static String users([String status = '']) { + if(status.isEmpty) { + return 'users'; + } + return 'users/$status'; } static String guests() { diff --git a/templates/deno/src/role.ts.twig b/templates/deno/src/role.ts.twig index 4b00bb15c4..579e6f8195 100644 --- a/templates/deno/src/role.ts.twig +++ b/templates/deno/src/role.ts.twig @@ -3,12 +3,18 @@ export class Role { return 'any' } - public static user(id: string): string { - return `user:${id}` + public static user(id: string, status: string = ''): string { + if(status === '') { + return `user:${id}` + } + return `user:${id}/${status}` } - public static users(): string { - return 'users' + public static users(status: string = ''): string { + if(status === '') { + return 'users' + } + return `users/${status}` } public static guests(): string { diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig index c1d9703b09..a99e5e1c22 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig @@ -4,9 +4,17 @@ class Role { companion object { fun any(): String = "any" - fun user(id: String): String = "user:$id" + fun user(id: String, status: String): String = if(status.isEmpty()) { + "user:$id" + } else { + "user:$id/$status" + } - fun users(): String = "users" + fun users(status: String): String = if(status.isEmpty()) { + "users" + } else { + "users/$status" + } fun guests(): String= "guests" diff --git a/templates/node/lib/role.js.twig b/templates/node/lib/role.js.twig index 028f50f18b..b7c7b5d325 100644 --- a/templates/node/lib/role.js.twig +++ b/templates/node/lib/role.js.twig @@ -2,11 +2,17 @@ class Role { static any = () => { return 'any' } - static user = (id) => { - return 'user:' + id + static user = (id, status = '') => { + if(status === '') { + return `user:${id}` + } + return `user:${id}/${status}` } - static users = () => { - return 'users' + static users = (status = '') => { + if(status === '') { + return 'users' + } + return `users/${status}` } static guests = () => { return 'guests' diff --git a/templates/php/src/Role.php.twig b/templates/php/src/Role.php.twig index dfdad89534..17393e252f 100644 --- a/templates/php/src/Role.php.twig +++ b/templates/php/src/Role.php.twig @@ -8,13 +8,19 @@ class Role { return 'any'; } - public static function user(string $id): string + public static function user(string $id, string $status = ""): string { - return "user:$id"; + if(empty($status)) { + return "user:$id"; + } + return "user:$id/$status"; } - public static function users(): string + public static function users(string $status = ""): string { - return 'users'; + if(empty($status)) { + return 'users'; + } + return "users/$status"; } public static function guests(): string { diff --git a/templates/python/package/role.py.twig b/templates/python/package/role.py.twig index 4a17e99fa7..850b4c16df 100644 --- a/templates/python/package/role.py.twig +++ b/templates/python/package/role.py.twig @@ -4,11 +4,15 @@ class Role: return 'any' @staticmethod - def user(id): + def user(id, status): + if status: + return f'user:{id}/{status}' return f'user:{id}' @staticmethod - def users(): + def users(status): + if status: + return f'users/{status}' return 'users' @staticmethod diff --git a/templates/ruby/lib/container/role.rb.twig b/templates/ruby/lib/container/role.rb.twig index 753f7d0551..4e90caddff 100644 --- a/templates/ruby/lib/container/role.rb.twig +++ b/templates/ruby/lib/container/role.rb.twig @@ -4,12 +4,20 @@ module {{spec.title | caseUcfirst}} 'any' end - def self.user(id) - "user:#{id}" + def self.user(id, status = "") + if(status.empty?) + "user:#{id}" + else + "user:#{id}/#{status}" + end end - def self.users - 'users' + def self.users(status = "") + if(status.empty?) + 'users' + else + "users/#{status}" + end end def self.guests diff --git a/templates/swift/Sources/Role.swift.twig b/templates/swift/Sources/Role.swift.twig index 7984fe35eb..0a2be0a8d2 100644 --- a/templates/swift/Sources/Role.swift.twig +++ b/templates/swift/Sources/Role.swift.twig @@ -3,12 +3,18 @@ public class Role { return "any" } - public static func user(_ id: String) -> String { - return "user:\(id)" + public static func user(_ id: String, _ status: String = "") -> String { + if(status.isEmpty) { + return "user:\(id)" + } + return "user:\(id)/\(status)" } - public static func users() -> String { - return "users" + public static func users(_ status: String = "") -> String { + if(status.isEmpty) { + return "users" + } + return "users/\(status)" } public static func guests() -> String { diff --git a/templates/web/src/role.ts.twig b/templates/web/src/role.ts.twig index 4b00bb15c4..579e6f8195 100644 --- a/templates/web/src/role.ts.twig +++ b/templates/web/src/role.ts.twig @@ -3,12 +3,18 @@ export class Role { return 'any' } - public static user(id: string): string { - return `user:${id}` + public static user(id: string, status: string = ''): string { + if(status === '') { + return `user:${id}` + } + return `user:${id}/${status}` } - public static users(): string { - return 'users' + public static users(status: string = ''): string { + if(status === '') { + return 'users' + } + return `users/${status}` } public static guests(): string { diff --git a/tests/Base.php b/tests/Base.php index 6d99d400af..d2c92e55f6 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -81,6 +81,8 @@ abstract class Base extends TestCase 'delete("team:teamId/owner")', 'delete("team:teamId")', 'create("member:memberId")', + 'update("users/verified")', + 'update("user:userid/unverified")', ]; const ID_HELPER_RESPONSES = [ diff --git a/tests/languages/android/Tests.kt b/tests/languages/android/Tests.kt index c29c1217a2..6d1cb291a6 100644 --- a/tests/languages/android/Tests.kt +++ b/tests/languages/android/Tests.kt @@ -182,6 +182,8 @@ class ServiceTest { writeToFile(Permission.delete(Role.team("teamId", "owner"))) writeToFile(Permission.delete(Role.team("teamId"))) writeToFile(Permission.create(Role.member("memberId"))) + writeToFile(Permission.update(Role.users("verified"))) + writeToFile(Permission.update(Role.user("userid", "unverified"))) // ID helper tests writeToFile(ID.unique()) diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 6b6d36b757..4e29c2bfd0 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -110,6 +110,8 @@ void main() async { print(Permission.delete(Role.team('teamId', 'owner'))); print(Permission.delete(Role.team('teamId'))); print(Permission.create(Role.member("memberId"))); + print(Permission.update(Role.user("verified"))); + print(Permission.update(Role.users("userid", "unverified"))); // ID helper tests print(ID.unique()); diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts index ea89e07307..39bd650bbc 100644 --- a/tests/languages/deno/tests.ts +++ b/tests/languages/deno/tests.ts @@ -119,6 +119,8 @@ async function start() { console.log(Permission.delete(Role.team('teamId', 'owner'))); console.log(Permission.delete(Role.team('teamId'))); console.log(Permission.create(Role.member("memberId"))); + console.log(Permission.update(Role.users("verified"))); + console.log(Permission.update(Role.user("userid", "unverified"))); // ID helper tests console.log(ID.unique()); diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index d7b86486a0..2298c21c6a 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -130,6 +130,8 @@ void main() async { print(Permission.delete(Role.team('teamId', 'owner'))); print(Permission.delete(Role.team('teamId'))); print(Permission.create(Role.member("memberId"))); + print(Permission.update(Role.users("verified"))); + print(Permission.update(Role.user("userid", "unverified"))); // ID helper tests print(ID.unique()); diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt index 1d2eeeb7bb..4522b4fed7 100644 --- a/tests/languages/kotlin/Tests.kt +++ b/tests/languages/kotlin/Tests.kt @@ -142,6 +142,8 @@ class ServiceTest { writeToFile(Permission.delete(Role.team("teamId", "owner"))) writeToFile(Permission.delete(Role.team("teamId"))) writeToFile(Permission.create(Role.member("memberId"))) + writeToFile(Permission.update(Role.user("verified"))); + writeToFile(Permission.update(Role.users("userid", "unverified"))); // ID helper tests writeToFile(ID.unique()) diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index 0e7ea0fd45..c174b2f583 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -107,6 +107,8 @@ async function start() { console.log(Permission.delete(Role.team('teamId', 'owner'))); console.log(Permission.delete(Role.team('teamId'))); console.log(Permission.create(Role.member("memberId"))); + console.log(Permission.update(Role.users("verified"))); + console.log(Permission.update(Role.user("userid", "unverified"))); // ID helper tests console.log(ID.unique()); diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index 2bc29bb59a..d9a64b14c8 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -125,6 +125,9 @@ echo Permission::delete(Role::team('teamId', 'owner')) . "\n"; echo Permission::delete(Role::team('teamId')) . "\n"; echo Permission::create(Role::member('memberId')) . "\n"; +echo Permission::update(Role::users('verified')) . "\n"; +echo Permission::update(Role::user('userid', 'unverified')) . "\n"; + // ID helper tests echo ID::unique() . "\n"; echo ID::custom('custom_id') . "\n"; diff --git a/tests/languages/python/tests.py b/tests/languages/python/tests.py index e044550871..d97cd95f44 100644 --- a/tests/languages/python/tests.py +++ b/tests/languages/python/tests.py @@ -114,6 +114,8 @@ print(Permission.delete(Role.team('teamId', 'owner'))) print(Permission.delete(Role.team('teamId'))) print(Permission.create(Role.member('memberId'))) +print(Permission.update(Role.users('verified'))) +print(Permission.update(Role.user('userid', 'unverified'))) # ID helper tests print(ID.unique()) diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index 467900d7f6..879a6e50df 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -123,6 +123,8 @@ puts Permission.delete(Role.team('teamId', 'owner')) puts Permission.delete(Role.team('teamId')) puts Permission.create(Role.member('memberId')) +puts Permission.update(Role.users('verified')) +puts Permission.update(Role.user('userid', 'unverified')) # ID helper tests puts ID.unique() diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/swift-client/Tests.swift index cb62565b86..fd835b4652 100644 --- a/tests/languages/swift-client/Tests.swift +++ b/tests/languages/swift-client/Tests.swift @@ -165,6 +165,8 @@ class Tests: XCTestCase { print(Permission.delete(Role.team("teamId", "owner"))) print(Permission.delete(Role.team("teamId"))) print(Permission.create(Role.member("memberId"))) + print(Permission.update(Role.users("verified"))) + print(Permission.update(Role.user("userid", "unverified"))) // ID helper tests print(ID.unique()) diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index b3d624b69c..22c9f1229a 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -146,6 +146,8 @@ class Tests: XCTestCase { print(Permission.delete(Role.team("teamId", "owner"))) print(Permission.delete(Role.team("teamId"))) print(Permission.create(Role.member("memberId"))) + print(Permission.update(Role.users("verified"))) + print(Permission.update(Role.user("userid", "unverified"))) // ID helper tests print(ID.unique()) diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index d52eed82e4..fc2d9ed0ca 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -135,6 +135,9 @@ console.log(Permission.delete(Role.team('teamId', 'owner'))); console.log(Permission.delete(Role.team('teamId'))); console.log(Permission.create(Role.member('memberId'))); + console.log(Permission.update(Role.users("verified"))); + console.log(Permission.update(Role.user("userid", "unverified"))); + // ID helper tests console.log(ID.unique()); diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js index bdba4ba6a9..a303cb0089 100644 --- a/tests/languages/web/node.js +++ b/tests/languages/web/node.js @@ -92,6 +92,9 @@ async function start() { console.log(Permission.delete(Role.team('teamId', 'owner'))); console.log(Permission.delete(Role.team('teamId'))); console.log(Permission.create(Role.member('memberId'))); + console.log(Permission.update(Role.users("verified"))); + console.log(Permission.update(Role.user("userid", "unverified"))); + // ID helper tests console.log(ID.unique()); From 3947da28de22ede4bf3d803dfb331a43da14af81 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 13 Sep 2022 16:12:03 +0000 Subject: [PATCH 414/555] feat: revert formatting --- .../android/library/src/main/java/io/appwrite/Role.kt.twig | 2 +- templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig index a99e5e1c22..2ef8036f5a 100644 --- a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig @@ -16,7 +16,7 @@ class Role { "users/$status" } - fun guests(): String= "guests" + fun guests(): String = "guests" fun team(id: String, role: String = ""): String = if(role.isEmpty()) { "team:$id" diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig index a99e5e1c22..2ef8036f5a 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig @@ -16,7 +16,7 @@ class Role { "users/$status" } - fun guests(): String= "guests" + fun guests(): String = "guests" fun team(id: String, role: String = ""): String = if(role.isEmpty()) { "team:$id" From a6960422bc2776c2dcea8f6a0f9d2d40f6301c57 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 13 Sep 2022 16:21:13 +0000 Subject: [PATCH 415/555] feat: update tests --- tests/languages/android/Tests.kt | 2 +- tests/languages/dart/tests.dart | 6 +++--- tests/languages/deno/tests.ts | 6 +++--- tests/languages/flutter/tests.dart | 6 +++--- tests/languages/kotlin/Tests.kt | 2 +- tests/languages/node/test.js | 6 +++--- tests/languages/php/test.php | 2 +- tests/languages/python/tests.py | 2 +- tests/languages/ruby/tests.rb | 2 +- tests/languages/swift-client/Tests.swift | 2 +- tests/languages/swift-server/Tests.swift | 2 +- tests/languages/web/index.html | 4 ++-- tests/languages/web/node.js | 4 ++-- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/languages/android/Tests.kt b/tests/languages/android/Tests.kt index 6d1cb291a6..815aac44b8 100644 --- a/tests/languages/android/Tests.kt +++ b/tests/languages/android/Tests.kt @@ -183,7 +183,7 @@ class ServiceTest { writeToFile(Permission.delete(Role.team("teamId"))) writeToFile(Permission.create(Role.member("memberId"))) writeToFile(Permission.update(Role.users("verified"))) - writeToFile(Permission.update(Role.user("userid", "unverified"))) + writeToFile(Permission.update(Role.user(ID.custom("userid"), "unverified"))) // ID helper tests writeToFile(ID.unique()) diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 4e29c2bfd0..0970aeacf5 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -109,9 +109,9 @@ void main() async { print(Permission.update(Role.guests())); print(Permission.delete(Role.team('teamId', 'owner'))); print(Permission.delete(Role.team('teamId'))); - print(Permission.create(Role.member("memberId"))); - print(Permission.update(Role.user("verified"))); - print(Permission.update(Role.users("userid", "unverified"))); + print(Permission.create(Role.member('memberId'))); + print(Permission.update(Role.user('verified'))); + print(Permission.update(Role.users(ID.custom('userid'), 'unverified'))); // ID helper tests print(ID.unique()); diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts index 39bd650bbc..6ee92085c3 100644 --- a/tests/languages/deno/tests.ts +++ b/tests/languages/deno/tests.ts @@ -118,9 +118,9 @@ async function start() { console.log(Permission.update(Role.guests())); console.log(Permission.delete(Role.team('teamId', 'owner'))); console.log(Permission.delete(Role.team('teamId'))); - console.log(Permission.create(Role.member("memberId"))); - console.log(Permission.update(Role.users("verified"))); - console.log(Permission.update(Role.user("userid", "unverified"))); + console.log(Permission.create(Role.member('memberId'))); + console.log(Permission.update(Role.users('verified'))); + console.log(Permission.update(Role.user(ID.custom('userid'), 'unverified'))); // ID helper tests console.log(ID.unique()); diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart index 2298c21c6a..224c963b51 100644 --- a/tests/languages/flutter/tests.dart +++ b/tests/languages/flutter/tests.dart @@ -129,9 +129,9 @@ void main() async { print(Permission.update(Role.guests())); print(Permission.delete(Role.team('teamId', 'owner'))); print(Permission.delete(Role.team('teamId'))); - print(Permission.create(Role.member("memberId"))); - print(Permission.update(Role.users("verified"))); - print(Permission.update(Role.user("userid", "unverified"))); + print(Permission.create(Role.member('memberId'))); + print(Permission.update(Role.users('verified'))); + print(Permission.update(Role.user(ID.custom('userid'), 'unverified'))); // ID helper tests print(ID.unique()); diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt index 4522b4fed7..9d2e8fae62 100644 --- a/tests/languages/kotlin/Tests.kt +++ b/tests/languages/kotlin/Tests.kt @@ -143,7 +143,7 @@ class ServiceTest { writeToFile(Permission.delete(Role.team("teamId"))) writeToFile(Permission.create(Role.member("memberId"))) writeToFile(Permission.update(Role.user("verified"))); - writeToFile(Permission.update(Role.users("userid", "unverified"))); + writeToFile(Permission.update(Role.users(ID.custom("userid"), "unverified"))); // ID helper tests writeToFile(ID.unique()) diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js index c174b2f583..523a42fa45 100644 --- a/tests/languages/node/test.js +++ b/tests/languages/node/test.js @@ -106,9 +106,9 @@ async function start() { console.log(Permission.update(Role.guests())); console.log(Permission.delete(Role.team('teamId', 'owner'))); console.log(Permission.delete(Role.team('teamId'))); - console.log(Permission.create(Role.member("memberId"))); - console.log(Permission.update(Role.users("verified"))); - console.log(Permission.update(Role.user("userid", "unverified"))); + console.log(Permission.create(Role.member('memberId'))); + console.log(Permission.update(Role.users('verified'))); + console.log(Permission.update(Role.user(ID.custom('userid'), 'unverified'))); // ID helper tests console.log(ID.unique()); diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php index d9a64b14c8..f19a302ab3 100644 --- a/tests/languages/php/test.php +++ b/tests/languages/php/test.php @@ -126,7 +126,7 @@ echo Permission::delete(Role::team('teamId')) . "\n"; echo Permission::create(Role::member('memberId')) . "\n"; echo Permission::update(Role::users('verified')) . "\n"; -echo Permission::update(Role::user('userid', 'unverified')) . "\n"; +echo Permission::update(Role::user(ID::custom('userid'), 'unverified')) . "\n"; // ID helper tests echo ID::unique() . "\n"; diff --git a/tests/languages/python/tests.py b/tests/languages/python/tests.py index d97cd95f44..8dbb6c8751 100644 --- a/tests/languages/python/tests.py +++ b/tests/languages/python/tests.py @@ -115,7 +115,7 @@ print(Permission.delete(Role.team('teamId'))) print(Permission.create(Role.member('memberId'))) print(Permission.update(Role.users('verified'))) -print(Permission.update(Role.user('userid', 'unverified'))) +print(Permission.update(Role.user(ID.custom('userid'), 'unverified'))) # ID helper tests print(ID.unique()) diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb index 879a6e50df..f65ec7c389 100644 --- a/tests/languages/ruby/tests.rb +++ b/tests/languages/ruby/tests.rb @@ -124,7 +124,7 @@ puts Permission.delete(Role.team('teamId')) puts Permission.create(Role.member('memberId')) puts Permission.update(Role.users('verified')) -puts Permission.update(Role.user('userid', 'unverified')) +puts Permission.update(Role.user(ID.custom('userid'), 'unverified')) # ID helper tests puts ID.unique() diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/swift-client/Tests.swift index fd835b4652..9e6d3f4909 100644 --- a/tests/languages/swift-client/Tests.swift +++ b/tests/languages/swift-client/Tests.swift @@ -166,7 +166,7 @@ class Tests: XCTestCase { print(Permission.delete(Role.team("teamId"))) print(Permission.create(Role.member("memberId"))) print(Permission.update(Role.users("verified"))) - print(Permission.update(Role.user("userid", "unverified"))) + print(Permission.update(Role.user(ID.custom("userid"), "unverified"))) // ID helper tests print(ID.unique()) diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift-server/Tests.swift index 22c9f1229a..226b5e3cb9 100644 --- a/tests/languages/swift-server/Tests.swift +++ b/tests/languages/swift-server/Tests.swift @@ -147,7 +147,7 @@ class Tests: XCTestCase { print(Permission.delete(Role.team("teamId"))) print(Permission.create(Role.member("memberId"))) print(Permission.update(Role.users("verified"))) - print(Permission.update(Role.user("userid", "unverified"))) + print(Permission.update(Role.user(ID.custom("userid"), "unverified"))) // ID helper tests print(ID.unique()) diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html index fc2d9ed0ca..3d54e7f9f4 100644 --- a/tests/languages/web/index.html +++ b/tests/languages/web/index.html @@ -135,8 +135,8 @@ console.log(Permission.delete(Role.team('teamId', 'owner'))); console.log(Permission.delete(Role.team('teamId'))); console.log(Permission.create(Role.member('memberId'))); - console.log(Permission.update(Role.users("verified"))); - console.log(Permission.update(Role.user("userid", "unverified"))); + console.log(Permission.update(Role.users('verified'))); + console.log(Permission.update(Role.user(ID.custom('userid'), 'unverified'))); // ID helper tests diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js index a303cb0089..d464315a60 100644 --- a/tests/languages/web/node.js +++ b/tests/languages/web/node.js @@ -92,8 +92,8 @@ async function start() { console.log(Permission.delete(Role.team('teamId', 'owner'))); console.log(Permission.delete(Role.team('teamId'))); console.log(Permission.create(Role.member('memberId'))); - console.log(Permission.update(Role.users("verified"))); - console.log(Permission.update(Role.user("userid", "unverified"))); + console.log(Permission.update(Role.users('verified'))); + console.log(Permission.update(Role.user(ID.custom('userid'), 'unverified'))); // ID helper tests From 769444b03a1dbefb4d15362f84eb9cd2c2c8645a Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 13 Sep 2022 17:37:22 +0000 Subject: [PATCH 416/555] feat: update tests --- .../android/library/src/main/java/io/appwrite/Role.kt.twig | 4 ++-- templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig | 4 ++-- templates/python/package/role.py.twig | 4 ++-- tests/languages/dart/tests.dart | 4 ++-- tests/languages/kotlin/Tests.kt | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig index 2ef8036f5a..d871c46cb1 100644 --- a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig @@ -4,13 +4,13 @@ class Role { companion object { fun any(): String = "any" - fun user(id: String, status: String): String = if(status.isEmpty()) { + fun user(id: String, status: String = ""): String = if(status.isEmpty()) { "user:$id" } else { "user:$id/$status" } - fun users(status: String): String = if(status.isEmpty()) { + fun users(status: String = ""): String = if(status.isEmpty()) { "users" } else { "users/$status" diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig index 2ef8036f5a..d871c46cb1 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig @@ -4,13 +4,13 @@ class Role { companion object { fun any(): String = "any" - fun user(id: String, status: String): String = if(status.isEmpty()) { + fun user(id: String, status: String = ""): String = if(status.isEmpty()) { "user:$id" } else { "user:$id/$status" } - fun users(status: String): String = if(status.isEmpty()) { + fun users(status: String = ""): String = if(status.isEmpty()) { "users" } else { "users/$status" diff --git a/templates/python/package/role.py.twig b/templates/python/package/role.py.twig index 850b4c16df..73780b29e7 100644 --- a/templates/python/package/role.py.twig +++ b/templates/python/package/role.py.twig @@ -4,13 +4,13 @@ class Role: return 'any' @staticmethod - def user(id, status): + def user(id, status = ""): if status: return f'user:{id}/{status}' return f'user:{id}' @staticmethod - def users(status): + def users(status = ""): if status: return f'users/{status}' return 'users' diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart index 0970aeacf5..bdcdd2fd96 100644 --- a/tests/languages/dart/tests.dart +++ b/tests/languages/dart/tests.dart @@ -110,8 +110,8 @@ void main() async { print(Permission.delete(Role.team('teamId', 'owner'))); print(Permission.delete(Role.team('teamId'))); print(Permission.create(Role.member('memberId'))); - print(Permission.update(Role.user('verified'))); - print(Permission.update(Role.users(ID.custom('userid'), 'unverified'))); + print(Permission.update(Role.users('verified'))); + print(Permission.update(Role.user(ID.custom('userid'), 'unverified'))); // ID helper tests print(ID.unique()); diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt index 9d2e8fae62..132cb77c1c 100644 --- a/tests/languages/kotlin/Tests.kt +++ b/tests/languages/kotlin/Tests.kt @@ -142,8 +142,8 @@ class ServiceTest { writeToFile(Permission.delete(Role.team("teamId", "owner"))) writeToFile(Permission.delete(Role.team("teamId"))) writeToFile(Permission.create(Role.member("memberId"))) - writeToFile(Permission.update(Role.user("verified"))); - writeToFile(Permission.update(Role.users(ID.custom("userid"), "unverified"))); + writeToFile(Permission.update(Role.users("verified"))); + writeToFile(Permission.update(Role.user(ID.custom("userid"), "unverified"))); // ID helper tests writeToFile(ID.unique()) From 5e699af4c475cd22f430886a32972726641f7068 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 15 Sep 2022 00:56:40 +0530 Subject: [PATCH 417/555] fix: web sdk CI issues --- templates/web/.travis.yml.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/web/.travis.yml.twig b/templates/web/.travis.yml.twig index e2f525d322..5a81edf613 100644 --- a/templates/web/.travis.yml.twig +++ b/templates/web/.travis.yml.twig @@ -27,5 +27,6 @@ jobs: provider: npm email: $NPM_EMAIL api_key: $NPM_API_KEY + skip_cleanup: true on: tags: true \ No newline at end of file From 62a8156e0c527bcb239ffe3880bb9ce7bc3b1645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 15 Sep 2022 08:45:02 +0200 Subject: [PATCH 418/555] Fix missing permissions after deploy --- templates/cli/lib/commands/deploy.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cli/lib/commands/deploy.js.twig b/templates/cli/lib/commands/deploy.js.twig index c15b618e05..425be153f3 100644 --- a/templates/cli/lib/commands/deploy.js.twig +++ b/templates/cli/lib/commands/deploy.js.twig @@ -505,7 +505,7 @@ const deployCollection = async ({ all } = {}) => { collectionId: collection['$id'], name: collection.name, documentSecurity: collection.documentSecurity, - '$permissions': collection['$permissions'], + permissions: collection['$permissions'], parseOutput: false }) From 62e15d679f9137af6cd27c63239c51d8cd4f8c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 19 Sep 2022 05:52:00 +0000 Subject: [PATCH 419/555] Update node type definitions with new classes --- templates/node/index.d.ts.twig | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/templates/node/index.d.ts.twig b/templates/node/index.d.ts.twig index 39f4acda77..0e14e27352 100644 --- a/templates/node/index.d.ts.twig +++ b/templates/node/index.d.ts.twig @@ -174,6 +174,29 @@ declare module "{{ language.params.npmPackage|caseDash }}" { private static parseValues(value: QueryTypes): string; } + export class ID { + static unique = (): string; + static custom = (id: string): string; + } + + export class Permission { + static read = (role: string): string; + static write = (role: string): string; + static create = (role: string): string; + static update = (role: string): string; + static delete = (role: string): string; + } + + export class Role { + static any = (): string; + static user = (id: string, status?: string): string; + static users = (status?: string): string; + static guests = (): string; + static team = (id: string, role?: string): string; + static member = (id: string): string; + static status = (status: string): string; + } + {% for service in spec.services %} export class {{ service.name | caseUcfirst }} extends Service { constructor(client: Client{% for parameter in service.globalParams %}, {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName }}{% if not parameter.required %}|null{% endif %}{% endfor %}); From 5821cebc27e29efd9cf2b1f8db5692eda1ca87d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 19 Sep 2022 05:54:59 +0000 Subject: [PATCH 420/555] Fix syntax --- templates/node/index.d.ts.twig | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/templates/node/index.d.ts.twig b/templates/node/index.d.ts.twig index 0e14e27352..aa4a753fd6 100644 --- a/templates/node/index.d.ts.twig +++ b/templates/node/index.d.ts.twig @@ -167,7 +167,7 @@ declare module "{{ language.params.npmPackage|caseDash }}" { static limit(value: number): string; - static offset = (value: number): string; + static offset(value: number): string; private static addQuery(attribute: string, method: string, value: QueryTypes): string; @@ -175,26 +175,26 @@ declare module "{{ language.params.npmPackage|caseDash }}" { } export class ID { - static unique = (): string; - static custom = (id: string): string; + static unique(): string; + static custom(id: string): string; } export class Permission { - static read = (role: string): string; - static write = (role: string): string; - static create = (role: string): string; - static update = (role: string): string; - static delete = (role: string): string; + static read(role: string): string; + static write(role: string): string; + static create(role: string): string; + static update(role: string): string; + static delete(role: string): string; } export class Role { - static any = (): string; - static user = (id: string, status?: string): string; - static users = (status?: string): string; - static guests = (): string; - static team = (id: string, role?: string): string; - static member = (id: string): string; - static status = (status: string): string; + static any(): string; + static user(id: string, status?: string): string; + static users(status?: string): string; + static guests(): string; + static team(id: string, role?: string): string; + static member(id: string): string; + static status(status: string): string; } {% for service in spec.services %} From 2bc0cb8ef1ebd259c8d56a75c55bd1699ccb53b5 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 20 Sep 2022 13:55:37 +1200 Subject: [PATCH 421/555] Remove redundant status role method --- .../android/library/src/main/java/io/appwrite/Role.kt.twig | 2 -- templates/dart/lib/role.dart.twig | 4 ---- templates/deno/src/role.ts.twig | 4 ---- templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig | 2 -- templates/node/lib/role.js.twig | 3 --- templates/php/src/Role.php.twig | 4 ---- templates/python/package/role.py.twig | 6 +----- templates/ruby/lib/container/role.rb.twig | 4 ---- templates/swift/Sources/Role.swift.twig | 4 ---- templates/web/src/role.ts.twig | 4 ---- 10 files changed, 1 insertion(+), 36 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig index d871c46cb1..d5f59c3a64 100644 --- a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig @@ -25,7 +25,5 @@ class Role { } fun member(id: String): String = "member:$id" - - fun status(status: String): String = "status:$status" } } \ No newline at end of file diff --git a/templates/dart/lib/role.dart.twig b/templates/dart/lib/role.dart.twig index 0c1c4a4953..35eb07414c 100644 --- a/templates/dart/lib/role.dart.twig +++ b/templates/dart/lib/role.dart.twig @@ -33,8 +33,4 @@ class Role { static String member(String id) { return 'member:$id'; } - - static String status(String status) { - return 'status:$status'; - } } \ No newline at end of file diff --git a/templates/deno/src/role.ts.twig b/templates/deno/src/role.ts.twig index 579e6f8195..d94e398c67 100644 --- a/templates/deno/src/role.ts.twig +++ b/templates/deno/src/role.ts.twig @@ -31,8 +31,4 @@ export class Role { public static member(id: string): string { return `member:${id}` } - - public static status(status: string): string { - return `status:${status}` - } } \ No newline at end of file diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig index d871c46cb1..d5f59c3a64 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig @@ -25,7 +25,5 @@ class Role { } fun member(id: String): String = "member:$id" - - fun status(status: String): String = "status:$status" } } \ No newline at end of file diff --git a/templates/node/lib/role.js.twig b/templates/node/lib/role.js.twig index b7c7b5d325..5c168c2399 100644 --- a/templates/node/lib/role.js.twig +++ b/templates/node/lib/role.js.twig @@ -26,9 +26,6 @@ class Role { static member = (id) => { return 'member:' + id } - static status = (status) => { - return 'status:' + status - } } module.exports = Role; \ No newline at end of file diff --git a/templates/php/src/Role.php.twig b/templates/php/src/Role.php.twig index 17393e252f..87cf43a1d4 100644 --- a/templates/php/src/Role.php.twig +++ b/templates/php/src/Role.php.twig @@ -37,8 +37,4 @@ class Role { return "member:$id"; } - public static function status(string $status): string - { - return "status:$status"; - } } \ No newline at end of file diff --git a/templates/python/package/role.py.twig b/templates/python/package/role.py.twig index 73780b29e7..c794826708 100644 --- a/templates/python/package/role.py.twig +++ b/templates/python/package/role.py.twig @@ -27,8 +27,4 @@ class Role: @staticmethod def member(id): - return f'member:{id}' - - @staticmethod - def status(status): - return f'status:{status}' \ No newline at end of file + return f'member:{id}' \ No newline at end of file diff --git a/templates/ruby/lib/container/role.rb.twig b/templates/ruby/lib/container/role.rb.twig index 4e90caddff..6333fbd64d 100644 --- a/templates/ruby/lib/container/role.rb.twig +++ b/templates/ruby/lib/container/role.rb.twig @@ -35,9 +35,5 @@ module {{spec.title | caseUcfirst}} def self.member(id) "member:#{id}" end - - def self.status(status) - "status:#{status}" - end end end \ No newline at end of file diff --git a/templates/swift/Sources/Role.swift.twig b/templates/swift/Sources/Role.swift.twig index 0a2be0a8d2..b8acdbb32c 100644 --- a/templates/swift/Sources/Role.swift.twig +++ b/templates/swift/Sources/Role.swift.twig @@ -31,8 +31,4 @@ public class Role { public static func member(_ id: String) -> String { return "member:\(id)" } - - public static func status(_ status: String) -> String { - return "status:\(status)" - } } \ No newline at end of file diff --git a/templates/web/src/role.ts.twig b/templates/web/src/role.ts.twig index 579e6f8195..d94e398c67 100644 --- a/templates/web/src/role.ts.twig +++ b/templates/web/src/role.ts.twig @@ -31,8 +31,4 @@ export class Role { public static member(id: string): string { return `member:${id}` } - - public static status(status: string): string { - return `status:${status}` - } } \ No newline at end of file From abdd81240d58dc5b03075b6c690017f76e448cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 20 Sep 2022 10:11:12 +0200 Subject: [PATCH 422/555] Update templates/node/index.d.ts.twig --- templates/node/index.d.ts.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/node/index.d.ts.twig b/templates/node/index.d.ts.twig index aa4a753fd6..69e2cab0d8 100644 --- a/templates/node/index.d.ts.twig +++ b/templates/node/index.d.ts.twig @@ -194,7 +194,6 @@ declare module "{{ language.params.npmPackage|caseDash }}" { static guests(): string; static team(id: string, role?: string): string; static member(id: string): string; - static status(status: string): string; } {% for service in spec.services %} From ce7c5018f88b6df147a52e04fd22bfa32d202305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 20 Sep 2022 14:44:05 +0000 Subject: [PATCH 423/555] CLI function variables feature, CLI --yes param --- templates/cli/lib/commands/deploy.js.twig | 63 +++++++++++++++++++---- templates/cli/lib/questions.js.twig | 9 +++- 2 files changed, 61 insertions(+), 11 deletions(-) diff --git a/templates/cli/lib/commands/deploy.js.twig b/templates/cli/lib/commands/deploy.js.twig index 425be153f3..a71c16f46b 100644 --- a/templates/cli/lib/commands/deploy.js.twig +++ b/templates/cli/lib/commands/deploy.js.twig @@ -2,9 +2,9 @@ const inquirer = require("inquirer"); const JSONbig = require("json-bigint")({ storeAsString: false }); const { Command } = require("commander"); const { localConfig } = require("../config"); -const { questionsDeployFunctions, questionsGetEntrypoint, questionsDeployCollections } = require("../questions"); +const { questionsDeployFunctions, questionsGetEntrypoint, questionsDeployCollections, questionsConfirmDeployCollections } = require("../questions"); const { actionRunner, success, log, error, commandDescriptions } = require("../parser"); -const { functionsGet, functionsCreate, functionsUpdate, functionsCreateDeployment, functionsUpdateDeployment } = require('./functions'); +const { functionsGet, functionsCreate, functionsUpdate, functionsCreateDeployment, functionsUpdateDeployment, functionsListVariables, functionsDeleteVariable, functionsCreateVariable } = require('./functions'); const { databasesGet, databasesCreate, @@ -142,7 +142,7 @@ const deploy = new Command("deploy") command.help() })); -const deployFunction = async ({ functionId, all } = {}) => { +const deployFunction = async ({ functionId, all, yes } = {}) => { let response = {}; const functionIds = []; @@ -160,7 +160,7 @@ const deployFunction = async ({ functionId, all } = {}) => { } if(functionIds.length <= 0) { - const answers = await inquirer.prompt(questionsDeployFunctions); + const answers = await inquirer.prompt(questionsDeployFunctions[0]); functionIds.push(...answers.functions); } @@ -188,6 +188,47 @@ const deployFunction = async ({ functionId, all } = {}) => { throw new Error(`Runtime missmatch! (local=${func.runtime},remote=${response.runtime}) Please delete remote function or update your appwrite.json`); } + if(func.variables) { + // Delete existing variables + + // TODO: Pagination? + const { variables: remoteVariables } = await functionsListVariables({ + functionId: func['$id'], + limit: 100, + parseOutput: false + }); + + if(remoteVariables.length > 0) { + if(!yes) { + const variableAnswers = await inquirer.prompt(questionsDeployFunctions[1]) + + if (variableAnswers.override !== "YES") { + log(`Received "${variableAnswers.override}". Skipping ${func.name} ( ${func['$id']} )`); + continue; + } + } + + await Promise.all(remoteVariables.map(async remoteVariable => { + await functionsDeleteVariable({ + functionId: func['$id'], + variableId: remoteVariable['$id'], + parseOutput: false + }); + })); + } + + // Deploy local variables + + await Promise.all(Object.keys(func.variables).map(async localVariableKey => { + await functionsCreateVariable({ + functionId: func['$id'], + key: localVariableKey, + value: func.variables[localVariableKey], + parseOutput: false + }); + })); + } + response = await functionsUpdate({ functionId: func['$id'], name: func.name, @@ -359,7 +400,7 @@ const createAttribute = async (databaseId, collectionId, attribute) => { } } -const deployCollection = async ({ all } = {}) => { +const deployCollection = async ({ all, yes } = {}) => { let response = {}; let collectionIds = []; @@ -413,10 +454,12 @@ const deployCollection = async ({ all } = {}) => { }) log(`Collection ${collection.name} ( ${collection['$id']} ) already exists.`); - answers = await inquirer.prompt(questionsDeployCollections[1]) - if (answers.override !== "YES") { - log(`Received "${answers.override}". Skipping ${collection.name} ( ${collection['$id']} )`); - continue; + if(!yes) { + answers = await inquirer.prompt(questionsDeployCollections[1]) + if (answers.override !== "YES") { + log(`Received "${answers.override}". Skipping ${collection.name} ( ${collection['$id']} )`); + continue; + } } log(`Updating attributes ... `); @@ -556,12 +599,14 @@ deploy .description("Deploy functions in the current directory.") .option(`--functionId `, `Function ID`) .option(`--all`, `Flag to deploy all functions`) + .option(`--yes`, `Flag to confirm all warnings`) .action(actionRunner(deployFunction)); deploy .command("collection") .description("Deploy collections in the current project.") .option(`--all`, `Flag to deploy all functions`) + .option(`--yes`, `Flag to confirm all warnings`) .action(actionRunner(deployCollection)); module.exports = { diff --git a/templates/cli/lib/questions.js.twig b/templates/cli/lib/questions.js.twig index c04e2915ac..0e9efd1f3c 100644 --- a/templates/cli/lib/questions.js.twig +++ b/templates/cli/lib/questions.js.twig @@ -113,7 +113,7 @@ const questionsInitProject = [ type: "input", name: "id", message: "What ID would you like to have for your project?", - default: "myAwesomeProject", + default: "unique()", when(answers) { return answers.start == "new"; }, @@ -251,7 +251,12 @@ const questionsDeployFunctions = [ }) return choices; } - } + }, + { + type: "input", + name: "override", + message: 'Are you sure you want to override this function variables? This can lead to loss of secrets! Type "YES" to confirm.' + }, ] const questionsDeployCollections = [ From a3215119d788775877166c7f87e18dc1e4509f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 20 Sep 2022 14:59:25 +0000 Subject: [PATCH 424/555] Upgrade CLI limit to 1.0 syntax --- templates/cli/lib/commands/deploy.js.twig | 14 +++++++------- templates/cli/lib/commands/init.js.twig | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/cli/lib/commands/deploy.js.twig b/templates/cli/lib/commands/deploy.js.twig index a71c16f46b..431e8549e3 100644 --- a/templates/cli/lib/commands/deploy.js.twig +++ b/templates/cli/lib/commands/deploy.js.twig @@ -39,7 +39,7 @@ const awaitPools = { const { attributes: remoteAttributes } = await databasesListAttributes({ databaseId, collectionId, - limit: 100, + queries: [ 'limit(100)' ], parseOutput: false }); @@ -59,7 +59,7 @@ const awaitPools = { const { indexes: remoteIndexes } = await databasesListIndexes({ databaseId, collectionId, - limit: 100, + queries: [ 'limit(100)' ], parseOutput: false }); @@ -79,7 +79,7 @@ const awaitPools = { const { attributes: remoteAttributes } = await databasesListAttributes({ databaseId, collectionId, - limit: 100, + queries: [ 'limit(100)' ], parseOutput: false }); @@ -111,7 +111,7 @@ const awaitPools = { const { indexes: remoteIndexes } = await databasesListIndexes({ databaseId, collectionId, - limit: 100, + queries: [ 'limit(100)' ], parseOutput: false }); @@ -194,7 +194,7 @@ const deployFunction = async ({ functionId, all, yes } = {}) => { // TODO: Pagination? const { variables: remoteVariables } = await functionsListVariables({ functionId: func['$id'], - limit: 100, + queries: [ 'limit(100)' ], parseOutput: false }); @@ -468,7 +468,7 @@ const deployCollection = async ({ all, yes } = {}) => { const { indexes: remoteIndexes } = await databasesListIndexes({ databaseId, collectionId: collection['$id'], - limit: 100, + queries: [ 'limit(100)' ], parseOutput: false }); @@ -490,7 +490,7 @@ const deployCollection = async ({ all, yes } = {}) => { const { attributes: remoteAttributes } = await databasesListAttributes({ databaseId, collectionId: collection['$id'], - limit: 100, + queries: [ 'limit(100)' ], parseOutput: false }); diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index 42e606ae1e..8db8952793 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -170,7 +170,7 @@ const initCollection = async ({ all, databaseId } = {}) => { // TODO: Pagination? let response = await databasesListCollections({ databaseId, - limit: 100, + queries: [ 'limit(100)' ], parseOutput: false }) From 133b2fd7c91d9631a5055516b7dabb9f4449a2fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 21 Sep 2022 16:40:50 +0200 Subject: [PATCH 425/555] Apply suggestions from code review Co-authored-by: Christy Jacob --- templates/cli/lib/commands/deploy.js.twig | 1 - templates/cli/lib/questions.js.twig | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/cli/lib/commands/deploy.js.twig b/templates/cli/lib/commands/deploy.js.twig index 431e8549e3..e177498962 100644 --- a/templates/cli/lib/commands/deploy.js.twig +++ b/templates/cli/lib/commands/deploy.js.twig @@ -218,7 +218,6 @@ const deployFunction = async ({ functionId, all, yes } = {}) => { } // Deploy local variables - await Promise.all(Object.keys(func.variables).map(async localVariableKey => { await functionsCreateVariable({ functionId: func['$id'], diff --git a/templates/cli/lib/questions.js.twig b/templates/cli/lib/questions.js.twig index 0e9efd1f3c..bd19767d9b 100644 --- a/templates/cli/lib/questions.js.twig +++ b/templates/cli/lib/questions.js.twig @@ -255,7 +255,7 @@ const questionsDeployFunctions = [ { type: "input", name: "override", - message: 'Are you sure you want to override this function variables? This can lead to loss of secrets! Type "YES" to confirm.' + message: 'Are you sure you want to override this function's variables? This can lead to loss of secrets! Type "YES" to confirm.' }, ] From ca7e9204ff9a8b0383619b252009dcf7bffd6276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 22 Sep 2022 09:09:56 +0000 Subject: [PATCH 426/555] Fix CLI syntax --- templates/cli/lib/questions.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cli/lib/questions.js.twig b/templates/cli/lib/questions.js.twig index bd19767d9b..1c5f40f08c 100644 --- a/templates/cli/lib/questions.js.twig +++ b/templates/cli/lib/questions.js.twig @@ -255,7 +255,7 @@ const questionsDeployFunctions = [ { type: "input", name: "override", - message: 'Are you sure you want to override this function's variables? This can lead to loss of secrets! Type "YES" to confirm.' + message: 'Are you sure you want to override this function\'s variables? This can lead to loss of secrets! Type "YES" to confirm.' }, ] From fe30201f733903f987ea4c20a97d142798403023 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Sep 2022 01:15:31 +1300 Subject: [PATCH 427/555] Add has generic type filter --- src/SDK/Language/Kotlin.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index b8035c2f7b..7c9350e4b9 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -3,6 +3,7 @@ namespace Appwrite\SDK\Language; use Appwrite\SDK\Language; +use Twig\TwigFilter; class Kotlin extends Language { @@ -439,5 +440,37 @@ public function getFiles() ], ]; } + + public function getFilters(): array + { + return [ + new TwigFilter('hasGenericType', function (string $model, array $spec) { + return $this->hasGenericType($model, $spec); + }), + ]; + } + + protected function hasGenericType(?string $model, array $spec): string + { + if (empty($model)) { + return false; + } + + $model = $spec['definitions'][$model]; + + if ($model['additionalProperties']) { + return true; + } + + foreach ($model['properties'] as $property) { + if (!\array_key_exists('sub_schema', $property) || !$property['sub_schema']) { + continue; + } + + return $this->hasGenericType($property['sub_schema'], $spec); + } + + return false; + } } From 3fac7848d3011a8126748b4c44f108729a17d560 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Sep 2022 01:16:04 +1300 Subject: [PATCH 428/555] Add return type generic filter --- src/SDK/Language/Kotlin.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index 7c9350e4b9..818d2b8c51 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -444,12 +444,39 @@ public function getFiles() public function getFilters(): array { return [ + new TwigFilter('returnType', function (array $method, array $spec, string $namespace, string $generic = 'T') { + return $this->getReturnType($method, $spec, $namespace, $generic); + }), new TwigFilter('hasGenericType', function (string $model, array $spec) { return $this->hasGenericType($model, $spec); }), ]; } + protected function getReturnType(array $method, array $spec, string $namespace, string $generic = 'T'): string + { + if ($method['type'] === 'webAuth') { + return 'Bool'; + } + if ($method['type'] === 'location') { + return 'ByteArray'; + } + + if (!\array_key_exists('responseModel', $method) + || empty($method['responseModel']) + || $method['responseModel'] === 'any') { + return 'Any'; + } + + $ret = $this->toUpperCase($method['responseModel']); + + if ($this->hasGenericType($method['responseModel'], $spec)) { + $ret .= '<' . $generic . '>'; + } + + return $namespace . '.models.' . $ret; + } + protected function hasGenericType(?string $model, array $spec): string { if (empty($model)) { From 504ca9bbda6921d0fb2532da651df449d4012175 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Sep 2022 01:16:23 +1300 Subject: [PATCH 429/555] Add model type and property type generic filters --- src/SDK/Language/Kotlin.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index 818d2b8c51..438dbca181 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -447,6 +447,12 @@ public function getFilters(): array new TwigFilter('returnType', function (array $method, array $spec, string $namespace, string $generic = 'T') { return $this->getReturnType($method, $spec, $namespace, $generic); }), + new TwigFilter('modelType', function (array $property, array $spec, string $generic = 'T') { + return $this->getModelType($property, $spec, $generic); + }), + new TwigFilter('propertyType', function (array $property, array $spec, string $generic = 'T') { + return $this->getPropertyType($property, $spec, $generic); + }), new TwigFilter('hasGenericType', function (string $model, array $spec) { return $this->hasGenericType($model, $spec); }), @@ -477,6 +483,37 @@ protected function getReturnType(array $method, array $spec, string $namespace, return $namespace . '.models.' . $ret; } + protected function getModelType(array $definition, array $spec, string $generic = 'T'): string + { + if ($this->hasGenericType($definition['name'], $spec)) { + return $this->toUpperCase($definition['name']) . '<' . $generic . '>'; + } + return $this->toUpperCase($definition['name']); + } + + protected function getPropertyType(array $property, array $spec, string $generic = 'T'): string + { + if (\array_key_exists('sub_schema', $property)) { + $type = $this->toUpperCase($property['sub_schema']); + + if ($this->hasGenericType($property['sub_schema'], $spec)) { + $type .= '<' . $generic . '>'; + } + + if ($property['type'] === 'array') { + $type = 'List<' . $type . '>'; + } + } else { + $type = $this->getTypeName($property); + } + + if (!$property['required']) { + $type .= '?'; + } + + return $type; + } + protected function hasGenericType(?string $model, array $spec): string { if (empty($model)) { From c2fa5e3da412523aa44b2d041585b86fc3013dbf Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Sep 2022 01:16:53 +1300 Subject: [PATCH 430/555] Move casing helpers up to language --- src/SDK/Language.php | 15 +++++++++++++++ src/SDK/Language/Web.php | 16 ---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/SDK/Language.php b/src/SDK/Language.php index e8f5d23eb8..57bd514232 100644 --- a/src/SDK/Language.php +++ b/src/SDK/Language.php @@ -83,4 +83,19 @@ public function getFilters(): array { return []; } + + protected function toUpperCase(string $value): string + { + return ucfirst($this->helperCamelCase($value)); + } + + protected function helperCamelCase($str): string + { + $str = preg_replace('/[^a-z0-9' . implode("", []) . ']+/i', ' ', $str); + $str = trim($str); + $str = ucwords($str); + $str = str_replace(" ", "", $str); + + return lcfirst($str); + } } \ No newline at end of file diff --git a/src/SDK/Language/Web.php b/src/SDK/Language/Web.php index 985eac46bd..f6ee17fbe4 100644 --- a/src/SDK/Language/Web.php +++ b/src/SDK/Language/Web.php @@ -301,22 +301,6 @@ public function getReturn(array $method, array $spec): string return ""; } - public function toUpperCase(string $value): string - { - return ucfirst((string)$this->helperCamelCase($value)); - } - - protected function helperCamelCase($str) - { - $str = preg_replace('/[^a-z0-9' . implode("", []) . ']+/i', ' ', $str); - $str = trim($str); - $str = ucwords($str); - $str = str_replace(" ", "", $str); - $str = lcfirst($str); - - return $str; - } - public function getSubSchema(array $property, array $spec): string { if (array_key_exists('sub_schema', $property)) { From 9114cadcf870a4267b35169a81883ae2836d3593 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Sep 2022 01:17:18 +1300 Subject: [PATCH 431/555] Update dependencies --- templates/android/build.gradle.twig | 2 +- templates/android/library/build.gradle.twig | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/templates/android/build.gradle.twig b/templates/android/build.gradle.twig index 79f6b0b8c7..3071c5a51b 100644 --- a/templates/android/build.gradle.twig +++ b/templates/android/build.gradle.twig @@ -10,7 +10,7 @@ buildscript { mavenCentral() } dependencies { - classpath "com.android.tools.build:gradle:4.2.0" + classpath "com.android.tools.build:gradle:4.2.2" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'io.github.gradle-nexus:publish-plugin:1.1.0' diff --git a/templates/android/library/build.gradle.twig b/templates/android/library/build.gradle.twig index 614bf90bb6..25ac68156e 100644 --- a/templates/android/library/build.gradle.twig +++ b/templates/android/library/build.gradle.twig @@ -54,21 +54,21 @@ android { dependencies { implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION}") - api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") - api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2") + api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1") + api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1") - api(platform("com.squareup.okhttp3:okhttp-bom:4.9.0")) + api(platform("com.squareup.okhttp3:okhttp-bom:4.10.0")) api("com.squareup.okhttp3:okhttp") implementation("com.squareup.okhttp3:okhttp-urlconnection") implementation("com.squareup.okhttp3:logging-interceptor") - implementation("com.google.code.gson:gson:2.8.7") + implementation("com.google.code.gson:gson:2.9.0") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.1") - implementation("androidx.lifecycle:lifecycle-common-java8:2.3.1") - implementation("androidx.appcompat:appcompat:1.3.1") - implementation("androidx.fragment:fragment-ktx:1.3.6") - implementation("androidx.activity:activity-ktx:1.3.1") - implementation("androidx.browser:browser:1.3.0") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.5.1") + implementation("androidx.lifecycle:lifecycle-common-java8:2.5.1") + implementation("androidx.appcompat:appcompat:1.5.1") + implementation("androidx.fragment:fragment-ktx:1.5.3") + implementation("androidx.activity:activity-ktx:1.6.0") + implementation("androidx.browser:browser:1.4.0") testImplementation 'junit:junit:4.+' testImplementation "androidx.test.ext:junit-ktx:1.1.3" From 4e2ad5421f5f2937df0ee361de0d885ff5460926 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Sep 2022 01:17:30 +1300 Subject: [PATCH 432/555] Update compile SDK --- templates/android/library/build.gradle.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/android/library/build.gradle.twig b/templates/android/library/build.gradle.twig index 25ac68156e..518c597392 100644 --- a/templates/android/library/build.gradle.twig +++ b/templates/android/library/build.gradle.twig @@ -22,11 +22,11 @@ ext { version PUBLISH_VERSION android { - compileSdkVersion(31) + compileSdkVersion(33) defaultConfig { minSdkVersion(21) - targetSdkVersion(31) + targetSdkVersion(33) versionCode = 1 versionName = "1.0" buildConfigField "String", "SDK_VERSION", "\"${PUBLISH_VERSION}\"" @@ -74,7 +74,7 @@ dependencies { testImplementation "androidx.test.ext:junit-ktx:1.1.3" testImplementation "androidx.test:core-ktx:1.4.0" testImplementation "org.robolectric:robolectric:4.5.1" - testApi("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.1") + testApi("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.1") } apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" \ No newline at end of file From cde2a80fb86875600665820dc94a77549216f3f9 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Sep 2022 01:17:44 +1300 Subject: [PATCH 433/555] Update to Kotlin 1.7 --- templates/android/build.gradle.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/android/build.gradle.twig b/templates/android/build.gradle.twig index 3071c5a51b..d475d546d7 100644 --- a/templates/android/build.gradle.twig +++ b/templates/android/build.gradle.twig @@ -2,7 +2,7 @@ apply plugin: 'io.github.gradle-nexus.publish-plugin' // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.5.31" + ext.kotlin_version = "1.7.10" version System.getenv("SDK_VERSION") repositories { maven { url "https://plugins.gradle.org/m2/" } From 57d291d2ce237adf41ddd676671f204ec8937484 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Sep 2022 01:18:51 +1300 Subject: [PATCH 434/555] Refactor model template for generics and improve formatting --- .../java/io/appwrite/models/Model.kt.twig | 97 ++++++++++--------- 1 file changed, 53 insertions(+), 44 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/models/Model.kt.twig b/templates/android/library/src/main/java/io/appwrite/models/Model.kt.twig index e7803dbfba..1a363e0b5c 100644 --- a/templates/android/library/src/main/java/io/appwrite/models/Model.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/models/Model.kt.twig @@ -1,62 +1,71 @@ -{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst}}>{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}Map{% else %}{{property | typeName}}{% endif %}{% endif %}{% endmacro %} package {{ sdk.namespace | caseDot }}.models import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast /** * {{ definition.description }} */ -data class {{ definition.name | caseUcfirst }}( -{% for property in definition.properties %} +data class {{ definition | modelType(spec) | raw }}( + {%~ for property in definition.properties %} /** * {{ property.description }} - * */ @SerializedName("{{ property.name | escapeKeyword | escapeDollarSign}}") - {% if property.required %}val{% else%}var{% endif %} {{ property.name | escapeKeyword | removeDollarSign }}: {{_self.sub_schema(property)}}{% if not property.required %}?{% endif %}{% if not loop.last or (loop.last and definition.additionalProperties) %},{{ "\n" }}{% endif %} + {% if property.required -%} val + {%- else -%} var + {%- endif %} {{ property.name | escapeKeyword | removeDollarSign }}: {{ property | propertyType(spec) | raw }}, -{% endfor %} -{% if definition.additionalProperties %} - val data: Map -{% endif %} + {%~ endfor %} + {%~ if definition.additionalProperties %} + /** + * Additional properties + */ + @SerializedName("data") + val data: T + {%~ endif %} ) { - companion object { - @Suppress("UNCHECKED_CAST") - fun from(map: Map) = {{ definition.name | caseUcfirst }}( -{% for property in definition.properties %} - {{ property.name | escapeKeyword | removeDollarSign }} = {% if property.sub_schema %}{% if property.type == 'array' %}(map["{{ property.name | escapeDollarSign }}"] as List>).map { {{property.sub_schema | caseUcfirst}}.from(map = it) }{% else %}{{property.sub_schema | caseUcfirst}}.from(map = map["{{property.name | escapeDollarSign }}"] as Map){% endif %}{% else %}{% if property.type == "integer" or property.type == "number" %}({% endif %}map["{{ property.name | escapeDollarSign }}"]{% if property.type == "integer" or property.type == "number" %} as{% if not property.required %}?{% endif %} Number){% endif %}{% if property.type == "integer" %}{% if not property.required %}?{% endif %}.toLong(){% elseif property.type == "number" %}{% if not property.required %}?{% endif %}.toDouble(){% else %} as{% if not property.required %}?{% endif %} {{ _self.sub_schema(property) }}{% endif %}{% endif %}{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %} - -{% endfor %} -{% if definition.additionalProperties %} - data = map -{% endif %} - ) - } - fun toMap(): Map = mapOf( -{% for property in definition.properties %} - "{{ property.name | escapeDollarSign }}" to {% if property.sub_schema %}{% if property.type == 'array' %}{{property.name | escapeKeyword | removeDollarSign}}.map { it.toMap() }{% else %}{{property.name | escapeKeyword | removeDollarSign}}.toMap(){% endif %}{% else %}{{property.name | escapeKeyword | removeDollarSign}}{% endif %} as Any{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %} - -{% endfor %} -{% if definition.additionalProperties %} - "data" to data -{% endif %} + {%~ for property in definition.properties %} + "{{ property.name | escapeDollarSign }}" to {% if property.sub_schema %}{% if property.type == 'array' %}{{property.name | escapeKeyword | removeDollarSign}}.map { it.toMap() }{% else %}{{property.name | escapeKeyword | removeDollarSign}}.toMap(){% endif %}{% else %}{{property.name | escapeKeyword | removeDollarSign}}{% endif %} as Any, + {%~ endfor %} + {%~ if definition.additionalProperties %} + "data" to data!!.jsonCast(to = Map::class.java) + {%~ endif %} ) -{% if definition.additionalProperties %} - fun convertTo(fromJson: (Map) -> T): T { - return fromJson(data) - } -{% endif %} -{% for property in definition.properties %} -{% if property.sub_schema %} -{% for def in spec.definitions %} -{% if def.name == property.sub_schema and def.additionalProperties and property.type == 'array' %} + companion object { + {%~ if definition.name | hasGenericType(spec) %} + operator fun invoke( + {%~ for property in definition.properties %} + {{ property.name | escapeKeyword | removeDollarSign }}: {{ property | propertyType(spec, 'Map') | raw }}, + {%~ endfor %} + {%~ if definition.additionalProperties %} + data: Map + {%~ endif %} + ) = {{ definition | modelType(spec, 'Map') | raw }}( + {%~ for property in definition.properties %} + {{ property.name | escapeKeyword | removeDollarSign }}, + {%~ endfor %} + {%~ if definition.additionalProperties %} + data + {%~ endif %} + ) + {%~ endif %} - fun convertTo(fromJson: (Map) -> T) = - {{property.name | removeDollarSign}}.map { it.convertTo(fromJson = fromJson) } -{% endif %} -{% endfor %} -{% endif %} -{% endfor %} + @Suppress("UNCHECKED_CAST") + fun {% if definition.name | hasGenericType(spec) %} {% endif %}from( + map: Map, + {%~ if definition.name | hasGenericType(spec) %} + nestedType: Class + {%~ endif %} + ) = {{ definition | modelType(spec) | raw }}( + {%~ for property in definition.properties %} + {{ property.name | escapeKeyword | removeDollarSign }} = {% if property.sub_schema %}{% if property.type == 'array' %}(map["{{ property.name | escapeDollarSign }}"] as List>).map { {{ property.sub_schema | caseUcfirst }}.from(map = it{% if definition.name | hasGenericType(spec) %}, nestedType{% endif %}) }{% else %}{{ property.sub_schema | caseUcfirst }}.from(map = map["{{property.name | escapeDollarSign }}"] as Map{% if definition.name | hasGenericType(spec) %}, nestedType{% endif %}){% endif %}{% else %}{% if property.type == "integer" or property.type == "number" %}({% endif %}map["{{ property.name | escapeDollarSign }}"]{% if property.type == "integer" or property.type == "number" %} as{% if not property.required %}?{% endif %} Number){% endif %}{% if property.type == "integer" %}{% if not property.required %}?{% endif %}.toLong(){% elseif property.type == "number" %}{% if not property.required %}?{% endif %}.toDouble(){% else %} as{% if not property.required %}?{% endif %} {{ property | propertyType(spec) | raw }}{% endif %}{% endif %}, + {%~ endfor %} + {%~ if definition.additionalProperties %} + data = map.jsonCast(to = nestedType) + {%~ endif %} + ) + } } \ No newline at end of file From de6de48fd7d646d46d8e5c5e2314313e8fbf1946 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Sep 2022 01:20:08 +1300 Subject: [PATCH 435/555] Refactor service template for generics and improve formatting --- .../appwrite/services/ServiceTemplate.kt.twig | 121 +++++++++--------- 1 file changed, 63 insertions(+), 58 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index 69985fffbe..37c5809081 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -1,13 +1,3 @@ -{% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} -{% macro method_parameters(parameters, consumes) %} -{% if parameters.all|length > 0 %}{% for parameter in parameters.all %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} -{% endmacro %} -{% macro methodNeedsSecurityParameters(method) %} -{% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} -{% endmacro %} -{% macro resultType(namespace, method) %} -{% if method.type == "webAuth" %}Bool{% elseif method.type == "location" %}ByteArray{% elseif not method.responseModel or method.responseModel == 'any' %}Any{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} -{% endmacro %} package {{ sdk.namespace | caseDot }}.services import android.net.Uri @@ -19,12 +9,13 @@ import androidx.activity.ComponentActivity {% endif %} import {{ sdk.namespace | caseDot }}.exceptions.{{ spec.title | caseUcfirst }}Exception import okhttp3.Cookie -import okhttp3.Response {% if (service.features.webAuth or service.features.location) %} import okhttp3.HttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl {% endif %} import java.io.File +import kotlin.reflect.KClass +import kotlin.reflect.typeOf class {{ service.name | caseUcfirst }} : Service { @@ -34,34 +25,44 @@ class {{ service.name | caseUcfirst }} : Service { /** * {{ method.title }} * -{% if method.description %} -{{ method.description|comment1 }} + * {{ method.description | raw | replace({"\n": "", "\r": ""}) }} * -{% endif %} -{% for parameter in method.parameters.all %} + {%~ for parameter in method.parameters.all %} * @param {{ parameter.name | caseCamel }} {{ parameter.description | raw }} -{% endfor %} - * {% if method.type != "webAuth" %}@return [{{ _self.resultType(sdk.namespace, method) }}]{% endif %} - + {%~ endfor %} + {%~ if method.type != "webAuth" %} + * @return [{{ method | returnType(spec, sdk.namespace | caseDot) | raw }}] + {%~ endif %} */ + {%~ if method.parameters.all | reduce((carry, param) => carry or not param.required) %} @JvmOverloads + {%~ endif %} @Throws({{ spec.title | caseUcfirst }}Exception::class) - suspend fun {{ method.name | caseCamel }}({% if method.type == "webAuth" %}{{ '\n\t\t' }}activity: ComponentActivity{% if method.parameters.all | length > 0 %}, {% endif %}{% endif %}{{ _self.method_parameters(method.parameters, method.consumes) }}{% if method.parameters.all|length > 0 %}{{ '\n\t' }}{% endif %}){% if method.type != "webAuth" %}: {{ _self.resultType(sdk.namespace, method) }}{% endif %} { - val path = "{{ method.path }}"{% for parameter in method.parameters.path %}.replace("{{ '{' ~ parameter.name | caseCamel ~ '}' }}", {{ parameter.name | caseCamel }}){% endfor %} + suspend fun {% if method.responseModel | hasGenericType(spec) %}{{ '' | raw }} {% endif %}{{ method.name | caseCamel }}( + {%~ if method.type == "webAuth" %} + activity: ComponentActivity, + {%~ endif %} + {%~ for parameter in method.parameters.all %} + {{ parameter.name | caseCamel }}: {{ parameter | typeName }}{%~ if not parameter.required %}? = null{% endif %}, + {%~ endfor %} + {%~ if method.responseModel | hasGenericType(spec) %} + nestedType: Class, + {%~ endif %} + {%~ if 'multipart/form-data' in method.consumes %} + onProgress: ((UploadProgress) -> Unit)? = null + {%~ endif %} + ){% if method.type != "webAuth" %}: {{ method | returnType(spec, sdk.namespace | caseDot) | raw }}{% endif %} { + val path = "{{ method.path }}" + {%~ for parameter in method.parameters.path %} + .replace("{{ '{' ~ parameter.name | caseCamel ~ '}' }}", {{ parameter.name | caseCamel }}) + {%~ endfor %} val params = mutableMapOf( -{% for parameter in method.parameters.query | merge(method.parameters.body) %} - "{{ parameter.name }}" to {{ parameter.name | caseCamel }}{% if not loop.last or _self.methodNeedsSecurityParameters(method) %},{% endif %} - -{% endfor %} -{% if _self.methodNeedsSecurityParameters(method) %} -{% for node in method.security %} -{% for key,header in node|keys %} - "{{header|caseLower}}" to client.config["{{header|caseLower}}"]{% if not loop.last %},{% endif %} - -{% endfor %}{% endfor %}{% endif %} + {%~ for parameter in method.parameters.query | merge(method.parameters.body) %} + "{{ parameter.name }}" to {{ parameter.name | caseCamel }}, + {%~ endfor %} ) -{% if method.type == 'webAuth' %} + {%~ if method.type == 'webAuth' %} val query = mutableListOf() params.forEach { when (it.value) { @@ -104,60 +105,64 @@ class {{ service.name | caseUcfirst }} : Service { listOf(cookie) ) } -{% elseif method.type == 'location' %} + {%~ elseif method.type == 'location' %} return client.call( "{{ method.method | caseUpper }}", path, params = params, - responseType = {{ _self.resultType(sdk.namespace, method) }}::class.java + responseType = {{ method | returnType(spec, sdk.namespace | caseDot) | raw }}::class.java ) -{% else %} + {%~ else %} val headers = mutableMapOf( -{{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} + {%~ for key, header in method.headers %} + "{{ key }}" to "{{ header }}", + {%~ endfor %} ) -{% if method.responseModel %} - val converter: (Map) -> {{ _self.resultType(sdk.namespace, method) }} = { -{% if method.responseModel == 'any' %} + {%~ if method.responseModel %} + val converter: (Map) -> {{ method | returnType(spec, sdk.namespace | caseDot) | raw }} = { + {%~ if method.responseModel == 'any' %} it -{% else %} - {{ _self.resultType(sdk.namespace, method) }}.from(map = it) -{% endif %} + {%~ else %} + {{ sdk.namespace | caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) + {%~ endif %} } -{% endif %} -{% if 'multipart/form-data' in method.consumes %} + {%~ endif %} + {%~ if 'multipart/form-data' in method.consumes %} val idParamName: String? = {% if method.parameters.all | filter(p => p.isUploadID) | length > 0 %}{% for parameter in method.parameters.all | filter(parameter => parameter.isUploadID) %}"{{ parameter.name }}"{% endfor %}{% else %}null{% endif %} -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} + {%~ for parameter in method.parameters.all %} + {%~ if parameter.type == 'file' %} val paramName = "{{ parameter.name }}" -{% endif %} -{% endfor %} + {%~ endif %} + {%~ endfor %} return client.chunkedUpload( path, headers, params, - responseType = {{ _self.resultType(sdk.namespace, method) }}::class.java, -{% if method.responseModel %} + responseType = {{ method | returnType(spec, sdk.namespace | caseDot) | raw }}::class.java, + {%~ if method.responseModel %} converter, -{% endif %} + {%~ endif %} paramName, idParamName, onProgress, ) -{% else %} + {%~ else %} return client.call( "{{ method.method | caseUpper }}", path, headers, params, - responseType = {{ _self.resultType(sdk.namespace, method) }}::class.java, -{% if method.responseModel %} + {%~ if method.responseModel | hasGenericType(spec) %} + responseType = (typeOf<{{ method | returnType(spec, sdk.namespace | caseDot) | raw }}>().classifier!! as KClass<{{ method | returnType(spec, sdk.namespace | caseDot) | raw }}>).java, + {%~ else %} + responseType = {{ method | returnType(spec, sdk.namespace | caseDot) | raw }}::class.java, + {%~ endif %} + {%~ if method.responseModel %} converter, -{% endif %} + {%~ endif %} ) -{% endif %} -{% endif %} + {%~ endif %} + {%~ endif %} } - -{% endfor %} } \ No newline at end of file From d3f97aaabcd6dfd88008ed88c4061f4f11c14788 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Sep 2022 01:21:15 +1300 Subject: [PATCH 436/555] Add service function overload for generics with map default --- .../appwrite/services/ServiceTemplate.kt.twig | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index 37c5809081..b99cd43dc6 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -165,4 +165,49 @@ class {{ service.name | caseUcfirst }} : Service { {%~ endif %} {%~ endif %} } + + {%~ if method.responseModel | hasGenericType(spec) %} + /** + * {{ method.title }} + * + * {{ method.description | raw | replace({"\n": "", "\r": ""}) }} + * + {%~ for parameter in method.parameters.all %} + * @param {{ parameter.name | caseCamel }} {{ parameter.description | raw }} + {%~ endfor %} + {%~ if method.type != "webAuth" %} + * @return [{{ method | returnType(spec, sdk.namespace | caseDot) | raw }}] + {%~ endif %} + */ + {%~ if method.parameters.all | reduce((carry, param) => carry or not param.required) %} + @JvmOverloads + {%~ endif %} + @Throws({{ spec.title | caseUcfirst }}Exception::class) + suspend fun {{ method.name | caseCamel }}( + {%~ if method.type == "webAuth" %} + activity: ComponentActivity, + {%~ endif %} + {%~ for parameter in method.parameters.all %} + {{ parameter.name | caseCamel }}: {{ parameter | typeName }}{%~ if not parameter.required %}? = null{% endif %}, + {%~ endfor %} + {%~ if 'multipart/form-data' in method.consumes %} + onProgress: ((UploadProgress) -> Unit)? = null + {%~ endif %} + ) = {{ method.name | caseCamel }}( + {%~ if method.type == "webAuth" %} + activity, + {%~ endif %} + {%~ for parameter in method.parameters.all %} + {{ parameter.name | caseCamel }}, + {%~ endfor %} + {%~ if method.responseModel | hasGenericType(spec) %} + nestedType = (typeOf>().classifier!! as KClass>).java, + {%~ endif %} + {%~ if 'multipart/form-data' in method.consumes %} + onProgress = onProgress + {%~ endif %} + ) + {%~ endif %} + + {%~ endfor %} } \ No newline at end of file From 9ef2204b52e19a596d4f1b3eef241d30f18628e7 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Sep 2022 02:04:36 +1300 Subject: [PATCH 437/555] Return false for generics checks on 'any' model --- src/SDK/Language/Kotlin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index 438dbca181..c566e9cb9a 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -516,7 +516,7 @@ protected function getPropertyType(array $property, array $spec, string $generic protected function hasGenericType(?string $model, array $spec): string { - if (empty($model)) { + if (empty($model) || $model === 'any') { return false; } From 878a40b8b39ea72b20c47bd4217cc535e15d8036 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 28 Sep 2022 21:11:08 +1300 Subject: [PATCH 438/555] Lint --- composer.lock | 174 ++++++++++------------------------- src/SDK/Language/Dart.php | 24 ++--- src/SDK/Language/Flutter.php | 40 ++++---- src/SDK/SDK.php | 2 +- tests/KotlinJava11Test.php | 2 +- tests/Node14Test.php | 2 +- tests/PHP80Test.php | 2 +- tests/Ruby30Test.php | 2 +- tests/Ruby31Test.php | 2 +- tests/WebNodeTest.php | 2 +- 10 files changed, 86 insertions(+), 166 deletions(-) diff --git a/composer.lock b/composer.lock index e98ef33527..8d202ab0ea 100644 --- a/composer.lock +++ b/composer.lock @@ -374,16 +374,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v6.6.3", + "version": "v6.6.4", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "f2d781bb9136cda2f5e73ee778049e80ba681cf6" + "reference": "4ce800dc32fd0292a4f05c00f347142dce1ecdda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/f2d781bb9136cda2f5e73ee778049e80ba681cf6", - "reference": "f2d781bb9136cda2f5e73ee778049e80ba681cf6", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/4ce800dc32fd0292a4f05c00f347142dce1ecdda", + "reference": "4ce800dc32fd0292a4f05c00f347142dce1ecdda", "shasum": "" }, "require": { @@ -393,24 +393,23 @@ "ext-simplexml": "*", "jean85/pretty-package-versions": "^2.0.5", "php": "^7.3 || ^8.0", - "phpunit/php-code-coverage": "^9.2.16", + "phpunit/php-code-coverage": "^9.2.17", "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-timer": "^5.0.3", - "phpunit/phpunit": "^9.5.23", + "phpunit/phpunit": "^9.5.24", "sebastian/environment": "^5.1.4", - "symfony/console": "^5.4.9 || ^6.1.2", - "symfony/polyfill-php80": "^v1.26.0", - "symfony/process": "^5.4.8 || ^6.1.0" + "symfony/console": "^5.4.12 || ^6.1.4", + "symfony/process": "^5.4.11 || ^6.1.3" }, "require-dev": { - "doctrine/coding-standard": "^9.0.0", + "doctrine/coding-standard": "^10.0.0", "ext-pcov": "*", "ext-posix": "*", - "infection/infection": "^0.26.13", + "infection/infection": "^0.26.14", "malukenho/mcbumpface": "^1.1.5", "squizlabs/php_codesniffer": "^3.7.1", - "symfony/filesystem": "^5.4.9 || ^6.1.0", - "vimeo/psalm": "^4.26.0" + "symfony/filesystem": "^5.4.12 || ^6.1.4", + "vimeo/psalm": "^4.27.0" }, "bin": [ "bin/paratest", @@ -451,7 +450,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v6.6.3" + "source": "https://github.com/paratestphp/paratest/tree/v6.6.4" }, "funding": [ { @@ -463,7 +462,7 @@ "type": "paypal" } ], - "time": "2022-08-25T05:44:14+00:00" + "time": "2022-09-13T10:47:01+00:00" }, { "name": "doctrine/instantiator", @@ -1140,16 +1139,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.24", + "version": "9.5.25", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5" + "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", - "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", + "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", "shasum": "" }, "require": { @@ -1171,14 +1170,14 @@ "phpunit/php-timer": "^5.0.2", "sebastian/cli-parser": "^1.0.1", "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", + "sebastian/comparator": "^4.0.8", "sebastian/diff": "^4.0.3", "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", + "sebastian/exporter": "^4.0.5", "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.1", + "sebastian/type": "^3.2", "sebastian/version": "^3.0.2" }, "suggest": { @@ -1222,7 +1221,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.24" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.25" }, "funding": [ { @@ -1232,9 +1231,13 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-08-30T07:42:16+00:00" + "time": "2022-09-25T03:44:45+00:00" }, { "name": "psr/container", @@ -1458,16 +1461,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -1520,7 +1523,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { @@ -1528,7 +1531,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", @@ -1718,16 +1721,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -1783,7 +1786,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -1791,7 +1794,7 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", @@ -2146,16 +2149,16 @@ }, { "name": "sebastian/type", - "version": "3.1.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb44e1cc6e557418387ad815780360057e40753e" + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb44e1cc6e557418387ad815780360057e40753e", - "reference": "fb44e1cc6e557418387ad815780360057e40753e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", "shasum": "" }, "require": { @@ -2167,7 +2170,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2190,7 +2193,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.1.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" }, "funding": [ { @@ -2198,7 +2201,7 @@ "type": "github" } ], - "time": "2022-08-29T06:55:37+00:00" + "time": "2022-09-12T14:47:03+00:00" }, { "name": "sebastian/version", @@ -2637,89 +2640,6 @@ ], "time": "2022-05-24T11:49:31+00:00" }, - { - "name": "symfony/polyfill-php80", - "version": "v1.26.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-10T07:21:04+00:00" - }, { "name": "symfony/process", "version": "v6.1.3", @@ -3014,5 +2934,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index 4da5adcf9d..dd7c14b726 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -372,20 +372,20 @@ public function getFiles(): array 'template' => 'dart/lib/src/service.dart.twig', ], [ - 'scope' => 'default', - 'destination' => '/lib/src/enums.dart', - 'template' => 'dart/lib/src/enums.dart.twig', - ], + 'scope' => 'default', + 'destination' => '/lib/src/enums.dart', + 'template' => 'dart/lib/src/enums.dart.twig', + ], [ - 'scope' => 'default', - 'destination' => '/lib/src/models/model.dart', - 'template' => 'dart/lib/src/models/model_base.dart.twig', - ], + 'scope' => 'default', + 'destination' => '/lib/src/models/model.dart', + 'template' => 'dart/lib/src/models/model_base.dart.twig', + ], [ - 'scope' => 'default', - 'destination' => '/lib/models.dart', - 'template' => 'dart/lib/models.dart.twig', - ], + 'scope' => 'default', + 'destination' => '/lib/models.dart', + 'template' => 'dart/lib/models.dart.twig', + ], [ 'scope' => 'service', 'destination' => '/lib/services/{{service.name | caseDash}}.dart', diff --git a/src/SDK/Language/Flutter.php b/src/SDK/Language/Flutter.php index 135df71b96..cda24dc346 100644 --- a/src/SDK/Language/Flutter.php +++ b/src/SDK/Language/Flutter.php @@ -44,17 +44,17 @@ public function getFiles(): array 'minify' => false, ], [ - 'scope' => 'default', - 'destination' => '/lib/src/enums.dart', - 'template' => 'dart/lib/src/enums.dart.twig', - 'minify' => false, - ], + 'scope' => 'default', + 'destination' => '/lib/src/enums.dart', + 'template' => 'dart/lib/src/enums.dart.twig', + 'minify' => false, + ], [ - 'scope' => 'default', - 'destination' => '/lib/src/exception.dart', - 'template' => 'dart/lib/src/exception.dart.twig', - 'minify' => false, - ], + 'scope' => 'default', + 'destination' => '/lib/src/exception.dart', + 'template' => 'dart/lib/src/exception.dart.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/lib/src/upload_progress.dart', @@ -62,11 +62,11 @@ public function getFiles(): array 'minify' => false, ], [ - 'scope' => 'default', - 'destination' => '/lib/models.dart', - 'template' => 'dart/lib/models.dart.twig', - 'minify' => false, - ], + 'scope' => 'default', + 'destination' => '/lib/models.dart', + 'template' => 'dart/lib/models.dart.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/lib/permission.dart', @@ -86,11 +86,11 @@ public function getFiles(): array 'minify' => false, ], [ - 'scope' => 'default', - 'destination' => '/lib/query.dart', - 'template' => 'dart/lib/query.dart.twig', - 'minify' => false, - ], + 'scope' => 'default', + 'destination' => '/lib/query.dart', + 'template' => 'dart/lib/query.dart.twig', + 'minify' => false, + ], [ 'scope' => 'definition', 'destination' => '/lib/src/models/{{definition.name | caseSnake }}.dart', diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index e7f9ec0a00..9017130df4 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -49,7 +49,7 @@ class SDK 'description' => '', 'shortDescription' => '', 'version' => '', - 'platform'=>'', + 'platform' => '', 'license' => '', 'licenseContent' => '', 'gitURL' => '', diff --git a/tests/KotlinJava11Test.php b/tests/KotlinJava11Test.php index e0e01cd597..0522fc7ccf 100644 --- a/tests/KotlinJava11Test.php +++ b/tests/KotlinJava11Test.php @@ -8,7 +8,7 @@ class KotlinJava11Test extends Base protected string $sdkPlatform = 'server'; protected string $sdkLanguage = 'kotlin'; protected string $version = '0.0.1'; - + protected string $language = 'kotlin'; protected string $class = 'Appwrite\SDK\Language\Kotlin'; protected array $build = [ diff --git a/tests/Node14Test.php b/tests/Node14Test.php index 2f33ee120c..fdacb50af2 100644 --- a/tests/Node14Test.php +++ b/tests/Node14Test.php @@ -8,7 +8,7 @@ class Node14Test extends Base protected string $sdkPlatform = 'server'; protected string $sdkLanguage = 'nodejs'; protected string $version = '0.0.1'; - + protected string $language = 'node'; protected string $class = 'Appwrite\SDK\Language\Node'; protected array $build = [ diff --git a/tests/PHP80Test.php b/tests/PHP80Test.php index 5224a91d37..32a0a1c765 100644 --- a/tests/PHP80Test.php +++ b/tests/PHP80Test.php @@ -8,7 +8,7 @@ class PHP80Test extends Base protected string $sdkPlatform = 'server'; protected string $sdkLanguage = 'php'; protected string $version = '0.0.1'; - + protected string $language = 'php'; protected string $class = 'Appwrite\SDK\Language\PHP'; protected array $build = []; diff --git a/tests/Ruby30Test.php b/tests/Ruby30Test.php index 5e920a16ba..1d2d4c1026 100644 --- a/tests/Ruby30Test.php +++ b/tests/Ruby30Test.php @@ -8,7 +8,7 @@ class Ruby30Test extends Base protected string $sdkPlatform = 'server'; protected string $sdkLanguage = 'ruby'; protected string $version = '0.0.1'; - + protected string $language = 'ruby'; protected string $class = 'Appwrite\SDK\Language\Ruby'; protected array $build = [ diff --git a/tests/Ruby31Test.php b/tests/Ruby31Test.php index 3c440a5d13..97039da868 100644 --- a/tests/Ruby31Test.php +++ b/tests/Ruby31Test.php @@ -8,7 +8,7 @@ class Ruby31Test extends Base protected string $sdkPlatform = 'server'; protected string $sdkLanguage = 'ruby'; protected string $version = '0.0.1'; - + protected string $language = 'ruby'; protected string $class = 'Appwrite\SDK\Language\Ruby'; protected array $build = [ diff --git a/tests/WebNodeTest.php b/tests/WebNodeTest.php index f4f5a2d3e4..b6154aa1a1 100644 --- a/tests/WebNodeTest.php +++ b/tests/WebNodeTest.php @@ -8,7 +8,7 @@ class WebNodeTest extends Base protected string $sdkPlatform = 'client'; protected string $sdkLanguage = 'web'; protected string $version = '0.0.1'; - + protected string $language = 'web'; protected string $class = 'Appwrite\SDK\Language\Web'; protected array $build = [ From 1d58a39a7288906305de65f50e5d7c767eab9d2d Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 28 Sep 2022 21:57:10 +1300 Subject: [PATCH 439/555] Apply to Kotlin --- .../java/io/appwrite/models/Model.kt.twig | 2 +- .../appwrite/services/ServiceTemplate.kt.twig | 8 +- templates/kotlin/base/requests/api.twig | 11 +- templates/kotlin/base/requests/file.twig | 15 +- templates/kotlin/base/requests/location.twig | 3 +- templates/kotlin/base/utils.twig | 10 - .../kotlin/io/appwrite/models/Model.kt.twig | 103 +++++----- .../appwrite/services/ServiceTemplate.kt.twig | 184 +++++++++--------- 8 files changed, 170 insertions(+), 166 deletions(-) delete mode 100644 templates/kotlin/base/utils.twig diff --git a/templates/android/library/src/main/java/io/appwrite/models/Model.kt.twig b/templates/android/library/src/main/java/io/appwrite/models/Model.kt.twig index 1a363e0b5c..6b049555cb 100644 --- a/templates/android/library/src/main/java/io/appwrite/models/Model.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/models/Model.kt.twig @@ -6,7 +6,7 @@ import io.appwrite.extensions.jsonCast /** * {{ definition.description }} */ -data class {{ definition | modelType(spec) | raw }}( +{% if definition.properties | length != 0 or definition.additionalProperties %}data {% endif %}class {{ definition | modelType(spec) | raw }}( {%~ for property in definition.properties %} /** * {{ property.description }} diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index b99cd43dc6..5963091213 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -3,20 +3,22 @@ package {{ sdk.namespace | caseDot }}.services import android.net.Uri import {{ sdk.namespace | caseDot }}.Client import {{ sdk.namespace | caseDot }}.models.* +import {{ sdk.namespace | caseDot }}.exceptions.{{ spec.title | caseUcfirst }}Exception +import {{ sdk.namespace | caseDot }}.extensions.classOf {% if service.features.webAuth %} import {{ sdk.namespace | caseDot }}.WebAuthComponent import androidx.activity.ComponentActivity {% endif %} -import {{ sdk.namespace | caseDot }}.exceptions.{{ spec.title | caseUcfirst }}Exception import okhttp3.Cookie {% if (service.features.webAuth or service.features.location) %} import okhttp3.HttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl {% endif %} import java.io.File -import kotlin.reflect.KClass -import kotlin.reflect.typeOf +/** + * {{ service.description | raw | replace({"\n": "", "\r": ""}) }} +**/ class {{ service.name | caseUcfirst }} : Service { public constructor (client: Client) : super(client) { } diff --git a/templates/kotlin/base/requests/api.twig b/templates/kotlin/base/requests/api.twig index 14d89c7306..a823ba5069 100644 --- a/templates/kotlin/base/requests/api.twig +++ b/templates/kotlin/base/requests/api.twig @@ -1,11 +1,14 @@ -{% import 'kotlin/base/utils.twig' as utils%} return client.call( "{{ method.method | caseUpper }}", path, headers, params, - responseType = {{ utils.resultType(sdk.namespace, method) }}::class.java, -{% if method.responseModel %} + {%~ if method.responseModel | hasGenericType(spec) %} + responseType = classOf(), + {%~ else %} + responseType = {{ method | returnType(spec, sdk.namespace | caseDot) | raw }}::class.java, + {%~ endif %} + {%~ if method.responseModel %} converter, -{% endif %} + {%~ endif %} ) \ No newline at end of file diff --git a/templates/kotlin/base/requests/file.twig b/templates/kotlin/base/requests/file.twig index d06aa20ec3..4da9ef84dd 100644 --- a/templates/kotlin/base/requests/file.twig +++ b/templates/kotlin/base/requests/file.twig @@ -1,19 +1,18 @@ -{% import 'kotlin/base/utils.twig' as utils %} val idParamName: String? = {% if method.parameters.all | filter(p => p.isUploadID) | length > 0 %}{% for parameter in method.parameters.all | filter(parameter => parameter.isUploadID) %}"{{ parameter.name }}"{% endfor %}{% else %}null{% endif %} -{% for parameter in method.parameters.all %} -{% if parameter.type == 'file' %} + {%~ for parameter in method.parameters.all %} + {%~ if parameter.type == 'file' %} val paramName = "{{ parameter.name }}" -{% endif %} -{% endfor %} + {%~ endif %} + {%~ endfor %} return client.chunkedUpload( path, headers, params, - responseType = {{ utils.resultType(sdk.namespace, method) }}::class.java, -{% if method.responseModel %} + responseType = {{ method | returnType(spec, sdk.namespace | caseDot) | raw }}::class.java, + {%~ if method.responseModel %} converter, -{% endif %} + {%~ endif %} paramName, idParamName, onProgress, diff --git a/templates/kotlin/base/requests/location.twig b/templates/kotlin/base/requests/location.twig index 5174981af5..df3f671719 100644 --- a/templates/kotlin/base/requests/location.twig +++ b/templates/kotlin/base/requests/location.twig @@ -1,7 +1,6 @@ -{% import 'kotlin/base/utils.twig' as utils%} return client.call( "{{ method.method | caseUpper }}", path, params = params, - responseType = {{ utils.resultType(sdk.namespace, method) }}::class.java + responseType = {{ method | returnType(spec, sdk.namespace | caseDot) | raw }}::class.java ) \ No newline at end of file diff --git a/templates/kotlin/base/utils.twig b/templates/kotlin/base/utils.twig deleted file mode 100644 index 8770b8a947..0000000000 --- a/templates/kotlin/base/utils.twig +++ /dev/null @@ -1,10 +0,0 @@ -{% macro parameter(parameter) %}{{ parameter.name | caseCamel }}: {{ parameter | typeName }}{% if not parameter.required %}? = null{% endif %}{% endmacro %} -{% macro method_parameters(parameters, consumes) %} -{% if parameters.all|length > 0 %}{% for parameter in parameters.all %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} -{% endmacro %} -{% macro methodNeedsSecurityParameters(method) %} -{% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} -{% endmacro %} -{% macro resultType(namespace, method) %} -{% if method.type == "webAuth" %}Bool{% elseif method.type == "location" %}ByteArray{% elseif not method.responseModel or method.responseModel == 'any' %}Any{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} -{% endmacro %} \ No newline at end of file diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig index 63a2cd761c..6b049555cb 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig @@ -1,66 +1,71 @@ -{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}List<{{property.sub_schema | caseUcfirst}}>{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}Map{% else %}{{property | typeName}}{% endif %}{% endif %}{% endmacro %} package {{ sdk.namespace | caseDot }}.models import com.google.gson.annotations.SerializedName +import io.appwrite.extensions.jsonCast /** * {{ definition.description }} */ -{% if definition.properties | length == 0 and not definition.additionalProperties %} -class {{ definition.name | caseUcfirst }} {} -{% else %} -data class {{ definition.name | caseUcfirst }}( -{% for property in definition.properties %} +{% if definition.properties | length != 0 or definition.additionalProperties %}data {% endif %}class {{ definition | modelType(spec) | raw }}( + {%~ for property in definition.properties %} /** * {{ property.description }} - * */ @SerializedName("{{ property.name | escapeKeyword | escapeDollarSign}}") - {% if property.required %}val{% else%}var{% endif %} {{ property.name | escapeKeyword | removeDollarSign }}: {{_self.sub_schema(property)}}{% if not property.required %}?{% endif %}{% if not loop.last or (loop.last and definition.additionalProperties) %},{{ "\n" }}{% endif %} + {% if property.required -%} val + {%- else -%} var + {%- endif %} {{ property.name | escapeKeyword | removeDollarSign }}: {{ property | propertyType(spec) | raw }}, -{% endfor %} -{% if definition.additionalProperties %} - val data: Map -{% endif %} + {%~ endfor %} + {%~ if definition.additionalProperties %} + /** + * Additional properties + */ + @SerializedName("data") + val data: T + {%~ endif %} ) { - companion object { - @Suppress("UNCHECKED_CAST") - fun from(map: Map) = {{ definition.name | caseUcfirst }}( -{% for property in definition.properties %} - {{ property.name | escapeKeyword | removeDollarSign }} = {% if property.sub_schema %}{% if property.type == 'array' %}(map["{{ property.name | escapeDollarSign }}"] as List>).map { {{property.sub_schema | caseUcfirst}}.from(map = it) }{% else %}{{property.sub_schema | caseUcfirst}}.from(map = map["{{property.name | escapeDollarSign }}"] as Map){% endif %}{% else %}{% if property.type == "integer" or property.type == "number" %}({% endif %}map["{{ property.name | escapeDollarSign }}"]{% if property.type == "integer" or property.type == "number" %} as{% if not property.required %}?{% endif %} Number){% endif %}{% if property.type == "integer" %}{% if not property.required %}?{% endif %}.toLong(){% elseif property.type == "number" %}{% if not property.required %}?{% endif %}.toDouble(){% else %} as{% if not property.required %}?{% endif %} {{ _self.sub_schema(property) }}{% endif %}{% endif %}{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %} - -{% endfor %} -{% if definition.additionalProperties %} - data = map -{% endif %} - ) - } - fun toMap(): Map = mapOf( -{% for property in definition.properties %} - "{{ property.name | escapeDollarSign }}" to {% if property.sub_schema %}{% if property.type == 'array' %}{{property.name | escapeKeyword | removeDollarSign}}.map { it.toMap() }{% else %}{{property.name | escapeKeyword | removeDollarSign}}.toMap(){% endif %}{% else %}{{property.name | escapeKeyword | removeDollarSign}}{% endif %} as Any{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %} - -{% endfor %} -{% if definition.additionalProperties %} - "data" to data -{% endif %} + {%~ for property in definition.properties %} + "{{ property.name | escapeDollarSign }}" to {% if property.sub_schema %}{% if property.type == 'array' %}{{property.name | escapeKeyword | removeDollarSign}}.map { it.toMap() }{% else %}{{property.name | escapeKeyword | removeDollarSign}}.toMap(){% endif %}{% else %}{{property.name | escapeKeyword | removeDollarSign}}{% endif %} as Any, + {%~ endfor %} + {%~ if definition.additionalProperties %} + "data" to data!!.jsonCast(to = Map::class.java) + {%~ endif %} ) -{% if definition.additionalProperties %} - fun convertTo(fromJson: (Map) -> T): T { - return fromJson(data) - } -{% endif %} -{% for property in definition.properties %} -{% if property.sub_schema %} -{% for def in spec.definitions %} -{% if def.name == property.sub_schema and def.additionalProperties and property.type == 'array' %} + companion object { + {%~ if definition.name | hasGenericType(spec) %} + operator fun invoke( + {%~ for property in definition.properties %} + {{ property.name | escapeKeyword | removeDollarSign }}: {{ property | propertyType(spec, 'Map') | raw }}, + {%~ endfor %} + {%~ if definition.additionalProperties %} + data: Map + {%~ endif %} + ) = {{ definition | modelType(spec, 'Map') | raw }}( + {%~ for property in definition.properties %} + {{ property.name | escapeKeyword | removeDollarSign }}, + {%~ endfor %} + {%~ if definition.additionalProperties %} + data + {%~ endif %} + ) + {%~ endif %} - fun convertTo(fromJson: (Map) -> T) = - {{property.name | removeDollarSign}}.map { it.convertTo(fromJson = fromJson) } -{% endif %} -{% endfor %} -{% endif %} -{% endfor %} -} -{% endif %} \ No newline at end of file + @Suppress("UNCHECKED_CAST") + fun {% if definition.name | hasGenericType(spec) %} {% endif %}from( + map: Map, + {%~ if definition.name | hasGenericType(spec) %} + nestedType: Class + {%~ endif %} + ) = {{ definition | modelType(spec) | raw }}( + {%~ for property in definition.properties %} + {{ property.name | escapeKeyword | removeDollarSign }} = {% if property.sub_schema %}{% if property.type == 'array' %}(map["{{ property.name | escapeDollarSign }}"] as List>).map { {{ property.sub_schema | caseUcfirst }}.from(map = it{% if definition.name | hasGenericType(spec) %}, nestedType{% endif %}) }{% else %}{{ property.sub_schema | caseUcfirst }}.from(map = map["{{property.name | escapeDollarSign }}"] as Map{% if definition.name | hasGenericType(spec) %}, nestedType{% endif %}){% endif %}{% else %}{% if property.type == "integer" or property.type == "number" %}({% endif %}map["{{ property.name | escapeDollarSign }}"]{% if property.type == "integer" or property.type == "number" %} as{% if not property.required %}?{% endif %} Number){% endif %}{% if property.type == "integer" %}{% if not property.required %}?{% endif %}.toLong(){% elseif property.type == "number" %}{% if not property.required %}?{% endif %}.toDouble(){% else %} as{% if not property.required %}?{% endif %} {{ property | propertyType(spec) | raw }}{% endif %}{% endif %}, + {%~ endfor %} + {%~ if definition.additionalProperties %} + data = map.jsonCast(to = nestedType) + {%~ endif %} + ) + } +} \ No newline at end of file diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index 559444b49c..1ba2106583 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -1,20 +1,19 @@ -{% import 'kotlin/base/utils.twig' as utils %} package {{ sdk.namespace | caseDot }}.services + import {{ sdk.namespace | caseDot }}.Client import {{ sdk.namespace | caseDot }}.models.* -{% if service.features.webAuth %} -import {{ sdk.namespace | caseDot }}.WebAuthComponent -import androidx.activity.ComponentActivity -{% endif %} import {{ sdk.namespace | caseDot }}.exceptions.{{ spec.title | caseUcfirst }}Exception +import {{ sdk.namespace | caseDot }}.extensions.classOf import okhttp3.Cookie -import okhttp3.Response -{% if (service.features.webAuth or service.features.location) %} +{% if service.features.location %} import okhttp3.HttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl {% endif %} import java.io.File +/** + * {{ service.description | raw | replace({"\n": "", "\r": ""}) }} +**/ class {{ service.name | caseUcfirst }} : Service { public constructor (client: Client) : super(client) { } @@ -23,98 +22,105 @@ class {{ service.name | caseUcfirst }} : Service { /** * {{ method.title }} * -{% if method.description %} -{{ method.description|comment1 }} + * {{ method.description | raw | replace({"\n": "", "\r": ""}) }} * -{% endif %} -{% for parameter in method.parameters.all %} + {%~ for parameter in method.parameters.all %} * @param {{ parameter.name | caseCamel }} {{ parameter.description | raw }} -{% endfor %} - * {% if method.type != "webAuth" %}@return [{{ utils.resultType(sdk.namespace, method) }}]{% endif %} - + {%~ endfor %} + {%~ if method.type != "webAuth" %} + * @return [{{ method | returnType(spec, sdk.namespace | caseDot) | raw }}] + {%~ endif %} */ + {%~ if method.parameters.all | reduce((carry, param) => carry or not param.required) %} @JvmOverloads + {%~ endif %} @Throws({{ spec.title | caseUcfirst }}Exception::class) - suspend fun {{ method.name | caseCamel }}({% if method.type == "webAuth" %}{{ '\n\t\t' }}activity: ComponentActivity{% if method.parameters.all | length > 0 %}, {% endif %}{% endif %}{{ utils.method_parameters(method.parameters, method.consumes) }}{% if method.parameters.all|length > 0 %}{{ '\n\t' }}{% endif %}){% if method.type != "webAuth" %}: {{ utils.resultType(sdk.namespace, method) }}{% endif %} { - val path = "{{ method.path }}"{% for parameter in method.parameters.path %}.replace("{{ '{' ~ parameter.name | caseCamel ~ '}' }}", {{ parameter.name | caseCamel }}){% endfor %} + suspend fun {% if method.responseModel | hasGenericType(spec) %}{{ '' | raw }} {% endif %}{{ method.name | caseCamel }}( + {%~ if method.type == "webAuth" %} + activity: ComponentActivity, + {%~ endif %} + {%~ for parameter in method.parameters.all %} + {{ parameter.name | caseCamel }}: {{ parameter | typeName }}{%~ if not parameter.required %}? = null{% endif %}, + {%~ endfor %} + {%~ if method.responseModel | hasGenericType(spec) %} + nestedType: Class, + {%~ endif %} + {%~ if 'multipart/form-data' in method.consumes %} + onProgress: ((UploadProgress) -> Unit)? = null + {%~ endif %} + ): {{ method | returnType(spec, sdk.namespace | caseDot) | raw }} { + val path = "{{ method.path }}" + {%~ for parameter in method.parameters.path %} + .replace("{{ '{' ~ parameter.name | caseCamel ~ '}' }}", {{ parameter.name | caseCamel }}) + {%~ endfor %} val params = mutableMapOf( -{% for parameter in method.parameters.query | merge(method.parameters.body) %} - "{{ parameter.name }}" to {{ parameter.name | caseCamel }}{% if not loop.last or utils.methodNeedsSecurityParameters(method) %},{% endif %} - -{% endfor %} -{% if utils.methodNeedsSecurityParameters(method) %} -{% for node in method.security %} -{% for key,header in node|keys %} - "{{header|caseLower}}" to client.config["{{header|caseLower}}"]{% if not loop.last %},{% endif %} - -{% endfor %}{% endfor %}{% endif %} + {%~ for parameter in method.parameters.query | merge(method.parameters.body) %} + "{{ parameter.name }}" to {{ parameter.name | caseCamel }}, + {%~ endfor %} ) -{% if method.type == 'webAuth' %} - val query = mutableListOf() - params.forEach { - when (it.value) { - null -> { - return@forEach - } - is List<*> -> { - query.add("${it.key}[]=${it.value.toString()}") - } - else -> { - query.add("${it.key}=${it.value.toString()}") - } - } - } - - val url = Uri.parse("${client.endPoint}${path}?${query.joinToString("&")}") - val callbackUrlScheme = "{{ spec.title | caseLower }}-callback-${client.config["project"]}" - - WebAuthComponent.authenticate(activity, url, callbackUrlScheme) { - if (it.isFailure) { - throw it.exceptionOrNull()!! - } - - val resultUrl = it.getOrNull()!! - val uri = Uri.parse(resultUrl) - val key = uri.getQueryParameter("key") - val secret = uri.getQueryParameter("secret") - if (key == null || secret == null) { - throw {{ spec.title | caseUcfirst }}Exception("Authentication cookie missing!") - } - val cookie = Cookie.Builder() - .name(key) - .value(secret) - .domain(Uri.parse(client.endPoint).host!!) - .httpOnly() - .build() - - client.http.cookieJar.saveFromResponse( - client.endPoint.toHttpUrl(), - listOf(cookie) - ) - } -{% elseif method.type == 'location' %} -{{ include('kotlin/base/requests/location.twig') }} -{% else %} + {%~ if method.type == 'location' %} + {{~ include('kotlin/base/requests/location.twig') }} + {%~ else %} val headers = mutableMapOf( -{{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} + {%~ for key, header in method.headers %} + "{{ key }}" to "{{ header }}", + {%~ endfor %} ) -{% if method.responseModel %} - val converter: (Map) -> {{ utils.resultType(sdk.namespace, method) }} = { -{% if method.responseModel == 'any' %} + {%~ if method.responseModel %} + val converter: (Map) -> {{ method | returnType(spec, sdk.namespace | caseDot) | raw }} = { + {%~ if method.responseModel == 'any' %} it -{% else %} - {{ utils.resultType(sdk.namespace, method) }}.from(map = it) -{% endif %} + {%~ else %} + {{ sdk.namespace | caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) + {%~ endif %} } -{% endif %} -{% if 'multipart/form-data' in method.consumes %} -{{include('kotlin/base/requests/file.twig')}} -{% else %} -{{include('kotlin/base/requests/api.twig')}} -{% endif %} -{% endif %} + {%~ endif %} + {%~ if 'multipart/form-data' in method.consumes %} + {{~ include('kotlin/base/requests/file.twig') }} + {%~ else %} + {{~ include('kotlin/base/requests/api.twig') }} + {%~ endif %} + {%~ endif %} } - -{% endfor %} -} + {%~ if method.responseModel | hasGenericType(spec) %} + + /** + * {{ method.title }} + * + * {{ method.description | raw | replace({"\n": "", "\r": ""}) }} + * + {%~ for parameter in method.parameters.all %} + * @param {{ parameter.name | caseCamel }} {{ parameter.description | raw }} + {%~ endfor %} + * @return [{{ method | returnType(spec, sdk.namespace | caseDot) | raw }}] + */ + {%~ if method.parameters.all | reduce((carry, param) => carry or not param.required) %} + @JvmOverloads + {%~ endif %} + @Throws({{ spec.title | caseUcfirst }}Exception::class) + suspend fun {{ method.name | caseCamel }}( + {%~ for parameter in method.parameters.all %} + {{ parameter.name | caseCamel }}: {{ parameter | typeName }}{%~ if not parameter.required %}? = null{% endif %}, + {%~ endfor %} + {%~ if 'multipart/form-data' in method.consumes %} + onProgress: ((UploadProgress) -> Unit)? = null + {%~ endif %} + ) = {{ method.name | caseCamel }}( + {%~ if method.type == "webAuth" %} + activity, + {%~ endif %} + {%~ for parameter in method.parameters.all %} + {{ parameter.name | caseCamel }}, + {%~ endfor %} + {%~ if method.responseModel | hasGenericType(spec) %} + nestedType = classOf(), + {%~ endif %} + {%~ if 'multipart/form-data' in method.consumes %} + onProgress = onProgress + {%~ endif %} + ) + {%~ endif %} + + {%~ endfor %} +} \ No newline at end of file From 8dd54d6ebda4c1d8c7f57bdd56ff2064275f74ef Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 28 Sep 2022 21:57:37 +1300 Subject: [PATCH 440/555] Add type extensions to simplify getting class of generic type parameters --- src/SDK/Language/Android.php | 5 +++++ src/SDK/Language/Kotlin.php | 6 ++++++ .../java/io/appwrite/extensions/TypeExtensions.kt.twig | 8 ++++++++ .../java/io/appwrite/services/ServiceTemplate.kt.twig | 4 ++-- .../kotlin/io/appwrite/extensions/TypeExtensions.kt.twig | 8 ++++++++ 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 templates/android/library/src/main/java/io/appwrite/extensions/TypeExtensions.kt.twig create mode 100644 templates/kotlin/src/main/kotlin/io/appwrite/extensions/TypeExtensions.kt.twig diff --git a/src/SDK/Language/Android.php b/src/SDK/Language/Android.php index 38a48df9ab..723f9b0b35 100644 --- a/src/SDK/Language/Android.php +++ b/src/SDK/Language/Android.php @@ -136,6 +136,11 @@ public function getFiles() 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/extensions/JsonExtensions.kt', 'template' => '/android/library/src/main/java/io/appwrite/extensions/JsonExtensions.kt.twig', ], + [ + 'scope' => 'default', + 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/extensions/TypeExtensions.kt', + 'template' => '/android/library/src/main/java/io/appwrite/extensions/TypeExtensions.kt.twig', + ], [ 'scope' => 'default', 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/extensions/CollectionExtensions.kt', diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index c566e9cb9a..35f39bdc82 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -402,6 +402,12 @@ public function getFiles() 'template' => '/kotlin/src/main/kotlin/io/appwrite/extensions/JsonExtensions.kt.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/extensions/TypeExtensions.kt', + 'template' => '/kotlin/src/main/kotlin/io/appwrite/extensions/TypeExtensions.kt.twig', + 'minify' => false, + ], [ 'scope' => 'default', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/json/PreciseNumberAdapter.kt', diff --git a/templates/android/library/src/main/java/io/appwrite/extensions/TypeExtensions.kt.twig b/templates/android/library/src/main/java/io/appwrite/extensions/TypeExtensions.kt.twig new file mode 100644 index 0000000000..60ae417882 --- /dev/null +++ b/templates/android/library/src/main/java/io/appwrite/extensions/TypeExtensions.kt.twig @@ -0,0 +1,8 @@ +package {{ sdk.namespace | caseDot }}.extensions + +import kotlin.reflect.KClass +import kotlin.reflect.typeOf + +inline fun classOf(): Class { + return (typeOf().classifier!! as KClass).java +} \ No newline at end of file diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index 5963091213..f5cdcba036 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -156,7 +156,7 @@ class {{ service.name | caseUcfirst }} : Service { headers, params, {%~ if method.responseModel | hasGenericType(spec) %} - responseType = (typeOf<{{ method | returnType(spec, sdk.namespace | caseDot) | raw }}>().classifier!! as KClass<{{ method | returnType(spec, sdk.namespace | caseDot) | raw }}>).java, + responseType = classOf(), {%~ else %} responseType = {{ method | returnType(spec, sdk.namespace | caseDot) | raw }}::class.java, {%~ endif %} @@ -203,7 +203,7 @@ class {{ service.name | caseUcfirst }} : Service { {{ parameter.name | caseCamel }}, {%~ endfor %} {%~ if method.responseModel | hasGenericType(spec) %} - nestedType = (typeOf>().classifier!! as KClass>).java, + nestedType = classOf(), {%~ endif %} {%~ if 'multipart/form-data' in method.consumes %} onProgress = onProgress diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/extensions/TypeExtensions.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/extensions/TypeExtensions.kt.twig new file mode 100644 index 0000000000..60ae417882 --- /dev/null +++ b/templates/kotlin/src/main/kotlin/io/appwrite/extensions/TypeExtensions.kt.twig @@ -0,0 +1,8 @@ +package {{ sdk.namespace | caseDot }}.extensions + +import kotlin.reflect.KClass +import kotlin.reflect.typeOf + +inline fun classOf(): Class { + return (typeOf().classifier!! as KClass).java +} \ No newline at end of file From 754b750521d274b0ea5645141c2ba3a5c3cd5e61 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 28 Sep 2022 22:01:01 +1300 Subject: [PATCH 441/555] Lint --- tests/Base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Base.php b/tests/Base.php index 4ecb609b93..c7eef99240 100644 --- a/tests/Base.php +++ b/tests/Base.php @@ -37,7 +37,7 @@ abstract class Base extends TestCase 'POST:/v1/mock/tests/general/upload:passed', ]; - const EXTENDED_GENERAL_RESPONSES = [ + protected const EXTENDED_GENERAL_RESPONSES = [ 'GET:/v1/mock/tests/general/download:passed', ]; From b0882c1b789b41a73f16671743dc26c89a99fb85 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 29 Sep 2022 01:02:23 +1300 Subject: [PATCH 442/555] Add swift generics support --- .travis.yml | 4 +- example.php | 6 +- src/SDK/Language.php | 14 ++ .../Language/{SwiftClient.php => Apple.php} | 4 +- src/SDK/Language/Swift.php | 94 +++++++++- src/SDK/Language/Web.php | 16 -- .../swift/Sources/Models/Model.swift.twig | 86 ++++----- .../swift/Sources/Services/Service.swift.twig | 169 +++++++++--------- templates/swift/base/params.twig | 41 ++--- .../Example.xcodeproj/project.pbxproj | 4 +- .../UIKitExample.xcodeproj/project.pbxproj | 4 +- ...tClient55Test.php => AppleSwift55Test.php} | 14 +- ...{SwiftServer55Test.php => Swift55Test.php} | 10 +- .../{swift-client => apple}/Tests.swift | 0 .../{swift-server => swift}/Tests.swift | 0 15 files changed, 267 insertions(+), 199 deletions(-) rename src/SDK/Language/{SwiftClient.php => Apple.php} (99%) rename tests/{SwiftClient55Test.php => AppleSwift55Test.php} (59%) rename tests/{SwiftServer55Test.php => Swift55Test.php} (72%) rename tests/languages/{swift-client => apple}/Tests.swift (100%) rename tests/languages/{swift-server => swift}/Tests.swift (100%) diff --git a/.travis.yml b/.travis.yml index 99e74d2508..1913bb1957 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,8 +42,8 @@ env: - SDK=Ruby27 - SDK=Ruby30 - SDK=Ruby31 - - SDK=SwiftClient55 - - SDK=SwiftServer55 + - SDK=AppleSwift55 + - SDK=Swift55 - SDK=WebChromium - SDK=WebNode diff --git a/example.php b/example.php index 4b3fbc9097..8e0c24a209 100644 --- a/example.php +++ b/example.php @@ -15,7 +15,7 @@ use Appwrite\SDK\Language\Deno; use Appwrite\SDK\Language\HTTP; use Appwrite\SDK\Language\Swift; -use Appwrite\SDK\Language\SwiftClient; +use Appwrite\SDK\Language\Apple; use Appwrite\SDK\Language\DotNet; use Appwrite\SDK\Language\Flutter; use Appwrite\SDK\Language\Android; @@ -341,7 +341,7 @@ function getSSLPage($url) { $sdk->generate(__DIR__ . '/examples/swift-server'); // Swift (Client) - $sdk = new SDK(new SwiftClient(), new Swagger2($spec)); + $sdk = new SDK(new Apple(), new Swagger2($spec)); $sdk ->setName('NAME') @@ -362,7 +362,7 @@ function getSSLPage($url) { ]) ; - $sdk->generate(__DIR__ . '/examples/swift-client'); + $sdk->generate(__DIR__ . '/examples/apple'); // DotNet $sdk = new SDK(new DotNet(), new Swagger2($spec)); diff --git a/src/SDK/Language.php b/src/SDK/Language.php index e8f5d23eb8..cd9287ad4e 100644 --- a/src/SDK/Language.php +++ b/src/SDK/Language.php @@ -83,4 +83,18 @@ public function getFilters(): array { return []; } + + protected function toUpperCase(string $value): string + { + return ucfirst($this->helperCamelCase($value)); + } + + protected function helperCamelCase($str): string + { + $str = preg_replace('/[^a-z0-9' . implode("", []) . ']+/i', ' ', $str); + $str = trim($str); + $str = ucwords($str); + $str = str_replace(" ", "", $str); + return lcfirst($str); + } } \ No newline at end of file diff --git a/src/SDK/Language/SwiftClient.php b/src/SDK/Language/Apple.php similarity index 99% rename from src/SDK/Language/SwiftClient.php rename to src/SDK/Language/Apple.php index f54069c910..d4a469080f 100644 --- a/src/SDK/Language/SwiftClient.php +++ b/src/SDK/Language/Apple.php @@ -2,14 +2,14 @@ namespace Appwrite\SDK\Language; -class SwiftClient extends Swift { +class Apple extends Swift { /** * @return string */ public function getName() { - return 'SwiftClient'; + return 'Apple'; } public function getFiles() diff --git a/src/SDK/Language/Swift.php b/src/SDK/Language/Swift.php index b2da289a0e..4ceb0f3c67 100644 --- a/src/SDK/Language/Swift.php +++ b/src/SDK/Language/Swift.php @@ -467,10 +467,100 @@ public function getFilters(): array new TwigFilter('swiftComment', function ($value) { $value = explode("\n", $value); foreach ($value as $key => $line) { - $value[$key] = " /// " . wordwrap($value[$key], 75, "\n /// "); + $value[$key] = " /// " . wordwrap($line, 75, "\n /// "); } return implode("\n", $value); - }, ['is_safe' => ['html']]) + }, ['is_safe' => ['html']]), + new TwigFilter('returnType', function (array $method, array $spec, string $generic = 'T') { + return $this->getReturnType($method, $spec, $generic); + }), + new TwigFilter('modelType', function (array $property, array $spec, string $generic = 'T : Codable') { + return $this->getModelType($property, $spec, $generic); + }), + new TwigFilter('propertyType', function (array $property, array $spec, string $generic = 'T') { + return $this->getPropertyType($property, $spec, $generic); + }), + new TwigFilter('hasGenericType', function (string $model, array $spec) { + return $this->hasGenericType($model, $spec); + }), ]; } + + protected function getReturnType(array $method, array $spec, string $generic): string + { + if ($method['type'] === 'webAuth') { + return 'Bool'; + } + if ($method['type'] === 'location') { + return 'ByteBuffer'; + } + + if (!\array_key_exists('responseModel', $method) + || empty($method['responseModel']) + || $method['responseModel'] === 'any') { + return 'Any'; + } + + $ret = $this->toUpperCase($method['responseModel']); + + if ($this->hasGenericType($method['responseModel'], $spec)) { + $ret .= '<' . $generic . '>'; + } + + return \ucfirst($spec['title']) . 'Models.' . $ret; + } + + protected function getModelType(array $definition, array $spec, string $generic): string + { + if ($this->hasGenericType($definition['name'], $spec)) { + return $this->toUpperCase($definition['name']) . '<' . $generic . '>'; + } + return $this->toUpperCase($definition['name']); + } + + protected function getPropertyType(array $property, array $spec, string $generic): string + { + if (\array_key_exists('sub_schema', $property)) { + $type = $this->toUpperCase($property['sub_schema']); + + if ($this->hasGenericType($property['sub_schema'], $spec)) { + $type .= '<' . $generic . '>'; + } + + if ($property['type'] === 'array') { + $type = '[' . $type . ']'; + } + } else { + $type = $this->getTypeName($property); + } + + if (!$property['required']) { + $type .= '?'; + } + + return $type; + } + + protected function hasGenericType(?string $model, array $spec): string + { + if (empty($model) || $model === 'any') { + return false; + } + + $model = $spec['definitions'][$model]; + + if ($model['additionalProperties']) { + return true; + } + + foreach ($model['properties'] as $property) { + if (!\array_key_exists('sub_schema', $property) || !$property['sub_schema']) { + continue; + } + + return $this->hasGenericType($property['sub_schema'], $spec); + } + + return false; + } } diff --git a/src/SDK/Language/Web.php b/src/SDK/Language/Web.php index 985eac46bd..f6ee17fbe4 100644 --- a/src/SDK/Language/Web.php +++ b/src/SDK/Language/Web.php @@ -301,22 +301,6 @@ public function getReturn(array $method, array $spec): string return ""; } - public function toUpperCase(string $value): string - { - return ucfirst((string)$this->helperCamelCase($value)); - } - - protected function helperCamelCase($str) - { - $str = preg_replace('/[^a-z0-9' . implode("", []) . ']+/i', ' ', $str); - $str = trim($str); - $str = ucwords($str); - $str = str_replace(" ", "", $str); - $str = lcfirst($str); - - return $str; - } - public function getSubSchema(array $property, array $spec): string { if (array_key_exists('sub_schema', $property)) { diff --git a/templates/swift/Sources/Models/Model.swift.twig b/templates/swift/Sources/Models/Model.swift.twig index 4629f0fd16..f98f4f29e4 100644 --- a/templates/swift/Sources/Models/Model.swift.twig +++ b/templates/swift/Sources/Models/Model.swift.twig @@ -1,79 +1,61 @@ -{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}[{{property.sub_schema | caseUcfirst}}]{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}[String : Any]{% else %}{{property | typeName}}{% endif %}{% endif %}{% endmacro %} +import Foundation /// {{ definition.description }} {% if definition.properties | length == 0 and not definition.additionalProperties %} -public class {{ definition.name | caseUcfirst }} {} +public class {{ definition | modelType(spec) | raw }} {} {% else %} -public class {{ definition.name | caseUcfirst }} { +public class {{ definition | modelType(spec) | raw }} { -{% for property in definition.properties %} + {%~ for property in definition.properties %} /// {{ property.description }} - public let {{ property.name | escapeKeyword | removeDollarSign }}: {{_self.sub_schema(property)}}{% if not property.required %}?{% endif %} + public let {{ property.name | escapeKeyword | removeDollarSign }}: {{ property | propertyType(spec) | raw }}{% if not property.required %}?{% endif %} -{% endfor %} -{% if definition.additionalProperties %} - let data: [String: Any] + {%~ endfor %} + {%~ if definition.additionalProperties %} + /// Additional properties + let data: T + {%~ endif %} -{% endif %} init( -{% for property in definition.properties %} - {{ property.name | escapeKeyword | removeDollarSign }}: {{_self.sub_schema(property)}}{% if not property.required %}?{% endif %}{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %} + {%~ for property in definition.properties %} + {{ property.name | escapeKeyword | removeDollarSign }}: {{ property | propertyType(spec) | raw }}{% if not property.required %}?{% endif %}{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %} -{% endfor %} -{% if definition.additionalProperties %} - data: [String: Any] -{% endif %} + {%~ endfor %} + {%~ if definition.additionalProperties %} + data: T + {%~ endif %} ) { -{% for property in definition.properties %} + {%~ for property in definition.properties %} self.{{ property.name | escapeKeyword | removeDollarSign }} = {{ property.name | escapeKeyword | removeDollarSign }} -{% endfor %} -{% if definition.additionalProperties %} + {%~ endfor %} + {%~ if definition.additionalProperties %} self.data = data -{% endif %} - } - - public static func from(map: [String: Any]) -> {{ definition.name | caseUcfirst }} { - return {{ definition.name | caseUcfirst }}( -{% for property in definition.properties %} - {{ property.name | escapeKeyword | removeDollarSign }}: {% if property.sub_schema %}{% if property.type == 'array' %}(map["{{property.name }}"] as! [[String: Any]]).map { {{property.sub_schema | caseUcfirst}}.from(map: $0) }{% else %}{{property.sub_schema | caseUcfirst}}.from(map: map["{{property.name }}"] as! [String: Any]){% endif %}{% else %}map["{{property.name }}"] as{% if property.required %}!{% else %}?{% endif %} {{ _self.sub_schema(property) }}{% endif %}{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %} - -{% endfor %} -{% if definition.additionalProperties %} - data: map -{% endif %} - ) + {%~ endif %} } public func toMap() -> [String: Any] { return [ -{% for property in definition.properties %} + {%~ for property in definition.properties %} "{{ property.name | escapeKeyword }}": {% if property.sub_schema %}{% if property.type == 'array' %}{{property.name | escapeKeyword | removeDollarSign}}.map { $0.toMap() }{% else %}{{property.name | escapeKeyword | removeDollarSign}}.toMap(){% endif %}{% else %}{{property.name | escapeKeyword | removeDollarSign}}{% endif %} as Any{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %} -{% endfor %} -{% if definition.additionalProperties %} - "data": data -{% endif %} + {%~ endfor %} + {%~ if definition.additionalProperties %} + "data": try! JSONEncoder().encode(data) + {%~ endif %} ] } -{% if definition.additionalProperties %} - public func convertTo(fromJson: ([String: Any]) -> T) -> T { - return fromJson(data) - } - {% endif %} - {% for property in definition.properties %} - {% if property.sub_schema %} - {% for def in spec.definitions %} - {% if def.name == property.sub_schema and def.additionalProperties and property.type == 'array' %} + public static func from(map: [String: Any] ) -> {{ definition.name | caseUcfirst }} { + return {{ definition.name | caseUcfirst }}( + {%~ for property in definition.properties %} + {{ property.name | escapeKeyword | removeDollarSign }}: {% if property.sub_schema %}{% if property.type == 'array' %}(map["{{property.name }}"] as! [[String: Any]]).map { {{property.sub_schema | caseUcfirst}}.from(map: $0) }{% else %}{{property.sub_schema | caseUcfirst}}.from(map: map["{{property.name }}"] as! [String: Any]){% endif %}{% else %}map["{{property.name }}"] as{% if property.required %}!{% else %}?{% endif %} {{ property | propertyType(spec) | raw }}{% endif %}{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %} - public func convertTo(fromJson: ([String: Any]) -> T) -> [T] { - {{property.name | removeDollarSign}}.map { d in d.convertTo(fromJson: fromJson) } + {%~ endfor %} + {%~ if definition.additionalProperties %} + data: try! JSONDecoder().decode(T.self, from: JSONSerialization.data(withJSONObject: map, options: [])) + {%~ endif %} + ) } -{% endif %} -{% endfor %} -{% endif %} -{% endfor %} - } {% endif %} \ No newline at end of file diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index 714e1514c7..f04b863550 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -1,110 +1,117 @@ -{% macro resultType(spec, method) %} -{% if method.type == "webAuth" %}Bool{% elseif method.type == "location" %}ByteBuffer{% elseif not method.responseModel or method.responseModel == 'any' %}Any{% else %}{{spec.title | caseUcfirst}}Models.{{method.responseModel | caseUcfirst}}{% endif %} -{% endmacro %} import AsyncHTTPClient import Foundation import NIO import {{spec.title | caseUcfirst}}Models +/// {{ service.description }} open class {{ service.name | caseUcfirst }}: Service { -{% for method in service.methods %} + {%~ for method in service.methods %} /// /// {{ method.title }} /// -{% if method.description %} -{{ method.description | swiftComment }} + {%~ if method.description %} + {{ method.description | swiftComment }} /// -{% endif %} -{% for parameter in method.parameters.all %} + {%~ endif %} + {%~ for parameter in method.parameters.all %} /// @param {{ parameter | typeName | raw}} {{ parameter.name | caseCamel }} -{% endfor %} + {%~ endfor %} /// @throws Exception /// @return array /// -{% if method.type == "webAuth" %} + {%~ if method.type == "webAuth" %} @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -{% endif %} - open func {{ method.name | caseCamel }}( -{% for parameter in method.parameters.all %} + {%~ endif %} + open func {{ method.name | caseCamel }}{% if method.responseModel | hasGenericType(spec) %}{% endif %}( + {%~ for parameter in method.parameters.all %} {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} -{% endfor %} -{% if 'multipart/form-data' in method.consumes %} + {%~ endfor %} + {%~ if 'multipart/form-data' in method.consumes %} onProgress: ((UploadProgress) -> Void)? = nil -{% endif %} - ) async throws -> {{ _self.resultType(spec, method) }} { -{{include('swift/base/params.twig')}} -{% if method.type == 'webAuth' %} -{{include('swift/base/requests/OAuth.twig')}} -{% elseif method.type == 'location' %} -{{include('swift/base/requests/location.twig')}} -{% else %} - {% if 'multipart/form-data' in method.consumes %}var{% else %}let{% endif %} headers: [String: String] = [ -{{ method.headers|map((header, key) => " \"#{key}\": \"#{header}\"")|join(',\n')|raw }} + {%~ endif %} + ) async throws -> {{ method | returnType(spec) | raw }} { + {{~ include('swift/base/params.twig') }} + {%~ if method.type == 'webAuth' %} + {{~ include('swift/base/requests/OAuth.twig') }} + {%~ elseif method.type == 'location' %} + {{~ include('swift/base/requests/location.twig')}} + {%~ else %} + {%~ if method.headers | length <= 0 %} + let headers: [String: String] = [:] + {%~ else %} + {% if 'multipart/form-data' in method.consumes -%} var + {%- else -%} let + {%- endif %} headers: [String: String] = [ + {%~ for key, header in method.headers %} + "{{ key }}": "{{ header }}"{% if not loop.last %},{% endif %} + + {%~ endfor %} ] -{% if method.responseModel %} - let converter: ([String: Any]) -> {{ _self.resultType(spec, method) }} = { dict in -{% if method.responseModel == 'any' %} + {%~ endif %} + {%~ if method.responseModel %} + let converter: ([String: Any]) -> {{ method | returnType(spec) | raw }} = { dict in + {%~ if method.responseModel == 'any' %} return dict -{% else %} + {%~ else %} return {{ spec.title | caseUcfirst}}Models.{{method.responseModel | caseUcfirst}}.from(map: dict) -{% endif %} + {%~ endif %} } -{% endif %} -{% if 'multipart/form-data' in method.consumes %} -{{include('swift/base/requests/file.twig')}} -{% else %} -{{include('swift/base/requests/api.twig')}} -{% endif %} -{% endif %} + {%~ endif %} + {%~ if 'multipart/form-data' in method.consumes %} + {{~ include('swift/base/requests/file.twig') }} + {%~ else %} + {{~ include('swift/base/requests/api.twig') }} + {%~ endif %} + {%~ endif %} } {% endfor %} -{% for method in service.methods %} - /// - /// {{ method.title }} - /// -{% if method.description %} -{{ method.description | swiftComment }} - /// -{% endif %} -{% for parameter in method.parameters.all %} - /// @param {{ parameter | typeName | raw}} {{ parameter.name | caseCamel }} -{% endfor %} - /// @throws Exception - /// @return array - /// - @available(*, deprecated, message: "Use the async overload instead") -{% if method.type == "webAuth" %} - @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) -{% endif %} - open func {{ method.name | caseCamel }}( -{% for parameter in method.parameters.all %} - {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}, -{% endfor %} -{% if 'multipart/form-data' in method.consumes %} - onProgress: ((UploadProgress) -> Void)? = nil, -{% endif %} - completion: ((Result<{{ _self.resultType(spec, method) }}, {{ spec.title | caseUcfirst}}Error>) -> Void)? = nil - ) { - Task { - do { - let result = try await {{ method.name | caseCamel }}( -{% for parameter in method.parameters.all %} - {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} +{#{% for method in service.methods %}#} +{# ///#} +{# /// {{ method.title }}#} +{# ///#} +{#{% if method.description %}#} +{#{{ method.description | swiftComment }}#} +{# ///#} +{#{% endif %}#} +{#{% for parameter in method.parameters.all %}#} +{# /// @param {{ parameter | typeName | raw}} {{ parameter.name | caseCamel }}#} +{#{% endfor %}#} +{# /// @throws Exception#} +{# /// @return array#} +{# ///#} +{# @available(*, deprecated, message: "Use the async overload instead")#} +{#{% if method.type == "webAuth" %}#} +{# @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *)#} +{#{% endif %}#} +{# open func {{ method.name | caseCamel }}(#} +{#{% for parameter in method.parameters.all %}#} +{# {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | raw }}{% if not parameter.required %}? = nil{% endif %},#} +{#{% endfor %}#} +{#{% if 'multipart/form-data' in method.consumes %}#} +{# onProgress: ((UploadProgress) -> Void)? = nil,#} +{#{% endif %}#} +{# completion: ((Result<{{ _self.resultType(spec, method) }}, {{ spec.title | caseUcfirst}}Error>) -> Void)? = nil#} +{# ) {#} +{# Task {#} +{# do {#} +{# let result = try await {{ method.name | caseCamel }}(#} +{#{% for parameter in method.parameters.all %}#} +{# {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %}#} -{% endfor %} -{% if 'multipart/form-data' in method.consumes %} - onProgress: onProgress -{% endif %} - ) - completion?(.success(result)) - } catch { - completion?(.failure(error as! {{ spec.title | caseUcfirst}}Error)) - } - } - } +{#{% endfor %}#} +{#{% if 'multipart/form-data' in method.consumes %}#} +{# onProgress: onProgress#} +{#{% endif %}#} +{# )#} +{# completion?(.success(result))#} +{# } catch {#} +{# completion?(.failure(error as! {{ spec.title | caseUcfirst}}Error))#} +{# }#} +{# }#} +{# }#} -{% endfor %} +{#{% endfor %}#} } diff --git a/templates/swift/base/params.twig b/templates/swift/base/params.twig index 9eeea4c140..dbace25c3c 100644 --- a/templates/swift/base/params.twig +++ b/templates/swift/base/params.twig @@ -1,30 +1,21 @@ -{% macro methodNeedsSecurityParameters(method) %} -{% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} -{% endmacro %} -{% if method.parameters.path %} var{% else %} let{% endif %} path: String = "{{ method.path }}" -{% for parameter in method.parameters.path %} + {% if method.parameters.path -%} var + {%- else -%} let + {%- endif %} path: String = "{{ method.path }}" + {%~ for parameter in method.parameters.path %} path = path.replacingOccurrences( of: "{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}", - with: {% if method.parameters.path %}{{ parameter.name | caseCamel | escapeKeyword }}{% else %}""{% endif %} + with: {{ parameter.name | caseCamel | escapeKeyword }} ) -{% endfor %} -{% if method.parameters.query or method.parameters.body or method.parameters.formData or _self.methodNeedsSecurityParameters(method) %} - {% if 'multipart/form-data' in method.consumes %}var{% else %}let{% endif %} params: [String: Any?] = [ -{% else %} - let params: [String: Any?] = [:] -{% endif %} -{% for parameter in method.parameters.query | merge(method.parameters.body) %} - "{{ parameter.name }}": {{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last or _self.methodNeedsSecurityParameters(method) %},{% endif %} + {%~ endfor %} + {%~ if method.parameters.query | merge(method.parameters.body) | length <= 0 %} + let params: [String: Any] = [:] + {%~ else %} + {% if 'multipart/form-data' in method.consumes -%} var + {%- else -%} let + {%- endif %} params: [String: Any?] = [ + {%~ for parameter in method.parameters.query | merge(method.parameters.body) %} + "{{ parameter.name }}": {{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %},{% endif %} -{% endfor %} -{% if _self.methodNeedsSecurityParameters(method) %} -{% for node in method.security %} -{% for key,header in node|keys %} - "{{header|caseLower}}": client.config["{{header|caseLower}}"]{% if not loop.last %},{% endif %} - -{% endfor %} -{% endfor %} -{% endif %} -{% if method.parameters.query or method.parameters.body or method.parameters.formData or _self.methodNeedsSecurityParameters(method) %} + {%~ endfor %} ] -{% endif %} \ No newline at end of file + {%- endif %} \ No newline at end of file diff --git a/templates/swift/example-swiftui/Example.xcodeproj/project.pbxproj b/templates/swift/example-swiftui/Example.xcodeproj/project.pbxproj index f293df92df..d951b81fa7 100644 --- a/templates/swift/example-swiftui/Example.xcodeproj/project.pbxproj +++ b/templates/swift/example-swiftui/Example.xcodeproj/project.pbxproj @@ -50,7 +50,7 @@ 1D34C2522702E4A000D1DA8D /* ExampleViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleViewModel.swift; sourceTree = ""; }; 1D34C2542702E4B500D1DA8D /* ExampleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleView.swift; sourceTree = ""; }; 1D43900726FC8B2500C71E3E /* ImagePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImagePicker.swift; sourceTree = ""; }; - 1DBB414627E87BDB00ECF86F /* swift-client */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "swift-client"; path = "../../../examples/swift-client"; sourceTree = ""; }; + 1DBB414627E87BDB00ECF86F /* apple */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "apple"; path = "../../../examples/apple"; sourceTree = ""; }; 23DDF5922709A457006EFAFA /* ImagePicker+iOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ImagePicker+iOS.swift"; sourceTree = ""; }; 23DDF5942709A46A006EFAFA /* ImagePicker+macOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ImagePicker+macOS.swift"; sourceTree = ""; }; 23DDF597270AC2DA006EFAFA /* OSImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OSImage.swift; sourceTree = ""; }; @@ -106,7 +106,7 @@ 1DBB414527E87BDB00ECF86F /* Packages */ = { isa = PBXGroup; children = ( - 1DBB414627E87BDB00ECF86F /* swift-client */, + 1DBB414627E87BDB00ECF86F /* apple */, ); name = Packages; sourceTree = ""; diff --git a/templates/swift/example-uikit/UIKitExample.xcodeproj/project.pbxproj b/templates/swift/example-uikit/UIKitExample.xcodeproj/project.pbxproj index 9f5496d050..955f6b28fe 100644 --- a/templates/swift/example-uikit/UIKitExample.xcodeproj/project.pbxproj +++ b/templates/swift/example-uikit/UIKitExample.xcodeproj/project.pbxproj @@ -37,7 +37,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 1D53246626CA414A00D5382C /* swift-client */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "swift-client"; path = "../../../examples/swift-client"; sourceTree = ""; }; + 1D53246626CA414A00D5382C /* apple */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "apple"; path = "../../../examples/apple"; sourceTree = ""; }; 1D8C054626E603A200646CFC /* ImagePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImagePicker.swift; sourceTree = ""; }; 4B1151B0FC3E5D1AD1405D6D /* UIKitExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UIKitExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 4B115317377938CDB4FF518B /* UIKitExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIKitExampleTests.swift; sourceTree = ""; }; @@ -91,7 +91,7 @@ 4B11584FFD11E0EC8AE1D05E = { isa = PBXGroup; children = ( - 1D53246626CA414A00D5382C /* swift-client */, + 1D53246626CA414A00D5382C /* apple */, 4B115EA639EF1F575013EFA6 /* Products */, 4B115E17FC70E956925F85AF /* UIKitExample */, 4B115A1762CECE9495C57394 /* UIKitExampleTests */, diff --git a/tests/SwiftClient55Test.php b/tests/AppleSwift55Test.php similarity index 59% rename from tests/SwiftClient55Test.php rename to tests/AppleSwift55Test.php index b5e1ffe7f6..fb7098198f 100644 --- a/tests/SwiftClient55Test.php +++ b/tests/AppleSwift55Test.php @@ -2,21 +2,21 @@ namespace Tests; -class SwiftClient55Test extends Base +class AppleSwift55Test extends Base { protected string $sdkName = 'swift'; protected string $sdkPlatform = 'client'; - protected string $sdkLanguage = 'swiftclient'; + protected string $sdkLanguage = 'apple'; protected string $version = '0.0.1'; - protected string $language = 'swift-client'; - protected string $class = 'Appwrite\SDK\Language\SwiftClient'; + protected string $language = 'apple'; + protected string $class = 'Appwrite\SDK\Language\Apple'; protected array $build = [ - 'mkdir -p tests/sdks/swift-client/Tests/AppwriteTests', - 'cp tests/languages/swift-client/Tests.swift tests/sdks/swift-client/Tests/AppwriteTests/Tests.swift', + 'mkdir -p tests/sdks/apple/Tests/AppwriteTests', + 'cp tests/languages/apple/Tests.swift tests/sdks/apple/Tests/AppwriteTests/Tests.swift', ]; protected string $command = - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/swift-client swiftarm/swift:5.5.2-focal-multi-arch swift test'; + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/apple swiftarm/swift:5.5.2-focal-multi-arch swift test'; protected array $expectedOutput = [ ...Base::FOO_RESPONSES, diff --git a/tests/SwiftServer55Test.php b/tests/Swift55Test.php similarity index 72% rename from tests/SwiftServer55Test.php rename to tests/Swift55Test.php index 6320d70410..568de657aa 100644 --- a/tests/SwiftServer55Test.php +++ b/tests/Swift55Test.php @@ -2,21 +2,21 @@ namespace Tests; -class SwiftServer55Test extends Base +class Swift55Test extends Base { protected string $sdkName = 'swift'; protected string $sdkPlatform = 'server'; protected string $sdkLanguage = 'swift'; protected string $version = '0.0.1'; - protected string $language = 'swift-server'; + protected string $language = 'swift'; protected string $class = 'Appwrite\SDK\Language\Swift'; protected array $build = [ - 'mkdir -p tests/sdks/swift-server/Tests/AppwriteTests', - 'cp tests/languages/swift-server/Tests.swift tests/sdks/swift-server/Tests/AppwriteTests/Tests.swift', + 'mkdir -p tests/sdks/swift/Tests/AppwriteTests', + 'cp tests/languages/swift/Tests.swift tests/sdks/swift/Tests/AppwriteTests/Tests.swift', ]; protected string $command = - 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/swift-server swiftarm/swift:5.5.2-focal-multi-arch swift test'; + 'docker run --rm -v $(pwd):/app -w /app/tests/sdks/swift swiftarm/swift:5.5.2-focal-multi-arch swift test'; protected array $expectedOutput = [ ...Base::FOO_RESPONSES, diff --git a/tests/languages/swift-client/Tests.swift b/tests/languages/apple/Tests.swift similarity index 100% rename from tests/languages/swift-client/Tests.swift rename to tests/languages/apple/Tests.swift diff --git a/tests/languages/swift-server/Tests.swift b/tests/languages/swift/Tests.swift similarity index 100% rename from tests/languages/swift-server/Tests.swift rename to tests/languages/swift/Tests.swift From e10fa1ff879dbf12fc443a5df4fa3c083bd25a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sat, 1 Oct 2022 17:25:32 +0000 Subject: [PATCH 443/555] CLI: Add support for teams --- templates/cli/lib/commands/deploy.js.twig | 84 ++++++++++++++++++++++- templates/cli/lib/commands/init.js.twig | 25 ++++++- templates/cli/lib/config.js.twig | 39 +++++++++++ templates/cli/lib/questions.js.twig | 27 ++++++++ 4 files changed, 173 insertions(+), 2 deletions(-) diff --git a/templates/cli/lib/commands/deploy.js.twig b/templates/cli/lib/commands/deploy.js.twig index e177498962..f2f9802eeb 100644 --- a/templates/cli/lib/commands/deploy.js.twig +++ b/templates/cli/lib/commands/deploy.js.twig @@ -2,7 +2,7 @@ const inquirer = require("inquirer"); const JSONbig = require("json-bigint")({ storeAsString: false }); const { Command } = require("commander"); const { localConfig } = require("../config"); -const { questionsDeployFunctions, questionsGetEntrypoint, questionsDeployCollections, questionsConfirmDeployCollections } = require("../questions"); +const { questionsDeployTeams, questionsDeployFunctions, questionsGetEntrypoint, questionsDeployCollections, questionsConfirmDeployCollections } = require("../questions"); const { actionRunner, success, log, error, commandDescriptions } = require("../parser"); const { functionsGet, functionsCreate, functionsUpdate, functionsCreateDeployment, functionsUpdateDeployment, functionsListVariables, functionsDeleteVariable, functionsCreateVariable } = require('./functions'); const { @@ -25,6 +25,11 @@ const { databasesListIndexes, databasesDeleteIndex } = require("./databases"); +const { + teamsGet, + teamsUpdate, + teamsCreate +} = require("./teams"); const POOL_DEBOUNCE = 2000; // in milliseconds const POOL_MAX_DEBOUNCES = 30; @@ -593,6 +598,76 @@ const deployCollection = async ({ all, yes } = {}) => { } } +const deployTeam = async ({ all, yes } = {}) => { + let response = {}; + + let teamIds = []; + const configTeams = localConfig.getTeams(); + + if(all) { + if (configTeams.length === 0) { + throw new Error("No teams found in the current directory. Run `appwrite init team` to fetch all your teams."); + } + teamIds.push(...configTeams.map((t) => t.$id)); + } + + if(teamIds.length <= 0) { + let answers = await inquirer.prompt(questionsDeployTeams[0]) + teamIds.push(...answers.teams); + } + + let teams = []; + + for(const teamId of teamIds) { + const idTeams = configTeams.filter((t) => t.$id === teamId); + teams.push(...idTeams); + } + + for (let team of teams) { + log(`Deploying team ${team.name} ( ${team['$id']} )`) + + try { + response = await teamsGet({ + teamId: team['$id'], + parseOutput: false, + }) + log(`Team ${team.name} ( ${team['$id']} ) already exists.`); + + if(!yes) { + answers = await inquirer.prompt(questionsDeployTeams[1]) + if (answers.override !== "YES") { + log(`Received "${answers.override}". Skipping ${team.name} ( ${team['$id']} )`); + continue; + } + } + + log(`Updating team ...`) + + await teamsUpdate({ + teamId: team['$id'], + name: team.name, + parseOutput: false + }); + + success(`Deployed ${team.name} ( ${team['$id']} )`); + } catch (e) { + if (e.code == 404) { + log(`Team ${team.name} does not exist in the project. Creating ... `); + + response = await teamsCreate({ + teamId: team['$id'], + name: team.name, + parseOutput: false + }) + + success(`Deployed ${team.name} ( ${team['$id']} )`); + } else { + throw e; + } + } + } +} + deploy .command("function") .description("Deploy functions in the current directory.") @@ -608,6 +683,13 @@ deploy .option(`--yes`, `Flag to confirm all warnings`) .action(actionRunner(deployCollection)); +deploy + .command("team") + .description("Deploy teams in the current project.") + .option(`--all`, `Flag to deploy all teams`) + .option(`--yes`, `Flag to confirm all warnings`) + .action(actionRunner(deployTeam)); + module.exports = { deploy } \ No newline at end of file diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index 8db8952793..4a790df2e3 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -3,7 +3,7 @@ const path = require("path"); const childProcess = require('child_process'); const { Command } = require("commander"); const inquirer = require("inquirer"); -const { teamsCreate } = require("./teams"); +const { teamsCreate, teamsList } = require("./teams"); const { projectsCreate } = require("./projects"); const { functionsCreate } = require("./functions"); const { databasesListCollections, databasesList } = require("./databases"); @@ -186,6 +186,24 @@ const initCollection = async ({ all, databaseId } = {}) => { success(); } +const initTeam = async () => { + // TODO: Pagination? + let response = await teamsList({ + queries: [ 'limit(100)' ], + parseOutput: false + }) + + let teams = response.teams; + log(`Found ${teams.length} teams`); + + teams.forEach(async team => { + log(`Fetching ${team.name} ...`); + localConfig.addTeam(team); + }); + + success(); +} + init .command("project") .description("Initialise your {{ spec.title|caseUcfirst }} project") @@ -203,6 +221,11 @@ init .option(`--all`, `Flag to initialize all databases`) .action(actionRunner(initCollection)) +init + .command("team") + .description("Initialise your Appwrite teams") + .action(actionRunner(initTeam)) + module.exports = { init, }; diff --git a/templates/cli/lib/config.js.twig b/templates/cli/lib/config.js.twig index 1511997f9d..da4428def9 100644 --- a/templates/cli/lib/config.js.twig +++ b/templates/cli/lib/config.js.twig @@ -166,6 +166,45 @@ class Local extends Config { this.set("collections", collections); } + getTeams() { + if (!this.has("teams")) { + return []; + } + return this.get("teams"); + } + + getTeam($id) { + if (!this.has("teams")) { + return {}; + } + + let teams = this.get("teams"); + for (let i = 0; i < teams.length; i++) { + if (teams[i]['$id'] == $id) { + return teams[i]; + } + } + + return {}; + } + + addTeam(props) { + if (!this.has("teams")) { + this.set("teams", []); + } + + let teams = this.get("teams"); + for (let i = 0; i < teams.length; i++) { + if (teams[i]['$id'] == props['$id']) { + teams[i] = props; + this.set("teams", teams); + return; + } + } + teams.push(props); + this.set("teams", teams); + } + getProject() { if (!this.has("projectId") || !this.has("projectName")) { return {}; diff --git a/templates/cli/lib/questions.js.twig b/templates/cli/lib/questions.js.twig index 1c5f40f08c..4bbe41884b 100644 --- a/templates/cli/lib/questions.js.twig +++ b/templates/cli/lib/questions.js.twig @@ -300,6 +300,32 @@ const questionsGetEntrypoint = [ }, ] +const questionsDeployTeams = [ + { + type: "checkbox", + name: "teams", + message: "Which teams would you like to deploy?", + choices: () => { + let teams = localConfig.getTeams(); + if (teams.length === 0) { + throw new Error("No teams found in the current directory. Run `appwrite init team` to fetch all your teams."); + } + let choices = teams.map((team, idx) => { + return { + name: `${team.name} (${team['$id']})`, + value: team.$id + } + }) + return choices; + } + }, + { + type: "input", + name: "override", + message: 'Are you sure you want to override this team? This can lead to loss of data! Type "YES" to confirm.' + }, +] + module.exports = { questionsInitProject, questionsLogin, @@ -307,5 +333,6 @@ module.exports = { questionsInitCollection, questionsDeployFunctions, questionsDeployCollections, + questionsDeployTeams, questionsGetEntrypoint }; From de228acec05053dd08712b4b61dabe3ba622694e Mon Sep 17 00:00:00 2001 From: Nitesh Sharma Date: Sun, 2 Oct 2022 19:52:33 +0530 Subject: [PATCH 444/555] Improve Pub Points --- templates/flutter/lib/package.dart.twig | 1 - templates/flutter/lib/src/client_browser.dart.twig | 2 +- templates/flutter/lib/src/realtime_browser.dart.twig | 2 +- templates/flutter/pubspec.yaml.twig | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/templates/flutter/lib/package.dart.twig b/templates/flutter/lib/package.dart.twig index 406b3ee1bb..90711b99a9 100644 --- a/templates/flutter/lib/package.dart.twig +++ b/templates/flutter/lib/package.dart.twig @@ -3,7 +3,6 @@ library {{ language.params.packageName }}; import 'dart:async'; import 'dart:typed_data'; import 'src/enums.dart'; -import 'src/client.dart'; import 'src/service.dart'; import 'src/input_file.dart'; import 'models.dart' as models; diff --git a/templates/flutter/lib/src/client_browser.dart.twig b/templates/flutter/lib/src/client_browser.dart.twig index f67f65cb90..be8943bcbf 100644 --- a/templates/flutter/lib/src/client_browser.dart.twig +++ b/templates/flutter/lib/src/client_browser.dart.twig @@ -1,9 +1,9 @@ -import 'dart:html' as html; import 'dart:math'; import 'package:flutter/foundation.dart'; import 'package:flutter_web_auth_2/flutter_web_auth_2.dart'; import 'package:http/http.dart' as http; import 'package:http/browser_client.dart'; +import 'package:universal_html/html.dart' as html; import 'client_mixin.dart'; import 'enums.dart'; import 'exception.dart'; diff --git a/templates/flutter/lib/src/realtime_browser.dart.twig b/templates/flutter/lib/src/realtime_browser.dart.twig index d5599233ee..1567f64f9c 100644 --- a/templates/flutter/lib/src/realtime_browser.dart.twig +++ b/templates/flutter/lib/src/realtime_browser.dart.twig @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'dart:html' as html; import 'dart:async'; +import 'package:universal_html/html.dart' as html; import 'package:web_socket_channel/html.dart'; import 'package:web_socket_channel/web_socket_channel.dart'; import 'realtime_subscription.dart'; diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 8715b932bd..c89bf7f1a7 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -18,7 +18,7 @@ dependencies: package_info_plus: ^1.4.3+1 path_provider: ^2.0.11 web_socket_channel: ^2.2.0 - + universal_html: ^2.0.8 dev_dependencies: flutter_lints: ^2.0.1 From d3f908ad482729eeeb3f372b80193d013583480b Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Sun, 9 Oct 2022 00:16:20 +0200 Subject: [PATCH 445/555] Upgrade device_info_plus --- templates/flutter/pubspec.yaml.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 8715b932bd..da54d01657 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -12,7 +12,7 @@ dependencies: flutter: sdk: flutter cookie_jar: ^3.0.1 - device_info_plus: ^4.1.2 + device_info_plus: ^5.0.5 flutter_web_auth_2: ^1.1.2 http: ^0.13.5 package_info_plus: ^1.4.3+1 From d0efa15202dcd2d06af3fb3381bb6492858b925c Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 9 Oct 2022 01:48:29 +0000 Subject: [PATCH 446/555] flutter dependency update --- templates/flutter/pubspec.yaml.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 8715b932bd..da54d01657 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -12,7 +12,7 @@ dependencies: flutter: sdk: flutter cookie_jar: ^3.0.1 - device_info_plus: ^4.1.2 + device_info_plus: ^5.0.5 flutter_web_auth_2: ^1.1.2 http: ^0.13.5 package_info_plus: ^1.4.3+1 From ac5ec8949f9e64a2878715eb1cc0e36037eb9a99 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 9 Oct 2022 01:48:35 +0000 Subject: [PATCH 447/555] node dependency update --- templates/node/package.json.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/package.json.twig b/templates/node/package.json.twig index a55f3af2f2..314c3ad083 100644 --- a/templates/node/package.json.twig +++ b/templates/node/package.json.twig @@ -12,7 +12,7 @@ }, "devDependencies": {}, "dependencies": { - "axios": "^0.27.2", + "axios": "^1.1.2", "form-data": "^4.0.0" } } \ No newline at end of file From 21913f54d808f82f4ae66d91fc4c2ad9b50733b0 Mon Sep 17 00:00:00 2001 From: wess Date: Mon, 10 Oct 2022 09:27:06 -0400 Subject: [PATCH 448/555] Changes branch name from main to master --- templates/cli/Formula/formula.rb.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cli/Formula/formula.rb.twig b/templates/cli/Formula/formula.rb.twig index d7274f3646..c2c6878d8d 100644 --- a/templates/cli/Formula/formula.rb.twig +++ b/templates/cli/Formula/formula.rb.twig @@ -4,7 +4,7 @@ class {{ spec.title| caseUcfirst }} < Formula desc "CLI is a Node based command-line tool for {{ spec.title| caseUcfirst }} API" homepage "{{ sdk.url }}" license "{{ sdk.license }}" - head "https://github.com/{{ sdk.gitUserName }}/{{ sdk.gitRepoName | caseDash }}.git", branch: "main" + head "https://github.com/{{ sdk.gitUserName }}/{{ sdk.gitRepoName | caseDash }}.git", branch: "master" depends_on "node" From d787644232a4f5df1aad3ce99c15e64b01d57e52 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Mon, 10 Oct 2022 19:32:14 +0200 Subject: [PATCH 449/555] Upgrade device_info_plus --- templates/flutter/pubspec.yaml.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index da54d01657..2f3be84d93 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -12,7 +12,7 @@ dependencies: flutter: sdk: flutter cookie_jar: ^3.0.1 - device_info_plus: ^5.0.5 + device_info_plus: ^6.0.0 flutter_web_auth_2: ^1.1.2 http: ^0.13.5 package_info_plus: ^1.4.3+1 From 06ec1b28ba3be4f29434c623a7320c347e5679f9 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Mon, 10 Oct 2022 19:32:51 +0200 Subject: [PATCH 450/555] Upgrade package_info_plus --- templates/flutter/pubspec.yaml.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 2f3be84d93..36f898a805 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -15,7 +15,7 @@ dependencies: device_info_plus: ^6.0.0 flutter_web_auth_2: ^1.1.2 http: ^0.13.5 - package_info_plus: ^1.4.3+1 + package_info_plus: ^2.0.0 path_provider: ^2.0.11 web_socket_channel: ^2.2.0 From 643e409d172b8011a48ab37448da368868157465 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 13 Oct 2022 13:31:53 +1300 Subject: [PATCH 451/555] Remove explicit graphql header sets --- .../src/main/java/io/appwrite/services/ServiceTemplate.kt.twig | 3 --- templates/dart/base/requests/graphql.twig | 1 - templates/deno/src/services/service.ts.twig | 3 --- templates/flutter/base/requests/graphql.twig | 1 - .../main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig | 3 --- templates/php/base/requests/graphql.twig | 3 --- templates/swift/Sources/Services/Service.swift.twig | 1 - 7 files changed, 15 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index ac85c96a31..4400e975b9 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -114,9 +114,6 @@ class {{ service.name | caseUcfirst }} : Service { {% else %} val headers = mutableMapOf( {{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }}, -{% if method.type == "graphql" %} - "x-sdk-graphql" to true -{% endif %} ) {% if method.responseModel %} val converter: (Map) -> {{ _self.resultType(sdk.namespace, method) }} = { diff --git a/templates/dart/base/requests/graphql.twig b/templates/dart/base/requests/graphql.twig index 9c39b4192c..8eb0e5e6d2 100644 --- a/templates/dart/base/requests/graphql.twig +++ b/templates/dart/base/requests/graphql.twig @@ -6,7 +6,6 @@ final Map headers = { {{ utils.map_headers(method.headers) }}, - "x-sdk-graphql: true, }}; final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); diff --git a/templates/deno/src/services/service.ts.twig b/templates/deno/src/services/service.ts.twig index 4a41da35f7..90090ca99f 100644 --- a/templates/deno/src/services/service.ts.twig +++ b/templates/deno/src/services/service.ts.twig @@ -99,9 +99,6 @@ export class {{ service.name | caseUcfirst }} extends Service { {% for key, header in method.headers %} '{{ key }}': '{{ header }}', {% endfor %} -{% if method.type == 'graphql' %} - 'x-sdk-graphql': 'true', -{% endif %} }; let id: string | undefined = undefined; diff --git a/templates/flutter/base/requests/graphql.twig b/templates/flutter/base/requests/graphql.twig index a023376268..23bc9f6a40 100644 --- a/templates/flutter/base/requests/graphql.twig +++ b/templates/flutter/base/requests/graphql.twig @@ -6,7 +6,6 @@ final Map headers = { {{ utils.map_headers(method.headers) }}, - "x-sdk-graphql: true, }}; final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index da0b97b2a2..b8cdb81bfb 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -98,9 +98,6 @@ class {{ service.name | caseUcfirst }} : Service { {% else %} val headers = mutableMapOf( {{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }}, -{% if method.type == "graphql" %} - "x-sdk-graphql" to true -{% endif %} ) {% if method.responseModel %} val converter: (Map) -> {{ utils.resultType(sdk.namespace, method) }} = { diff --git a/templates/php/base/requests/graphql.twig b/templates/php/base/requests/graphql.twig index 92664e52ec..72aee3648a 100644 --- a/templates/php/base/requests/graphql.twig +++ b/templates/php/base/requests/graphql.twig @@ -5,7 +5,4 @@ {% for key, header in method.headers %} '{{ key }}' => '{{ header }}', {% endfor %} -{% if method.type == 'graphql' %} - 'x-sdk-graphql': 'true', -{% endif %} ], $params); \ No newline at end of file diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index be2b9a59c2..fadf8204d4 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -41,7 +41,6 @@ open class {{ service.name | caseUcfirst }}: Service { {% else %} {% if 'multipart/form-data' in method.consumes %}var{% else %}let{% endif %} headers: [String: String] = [ {{ method.headers|map((header, key) => " \"#{key}\": \"#{header}\"")|join(',\n')|raw }}{% if method.type == "graphql" %}, - "x-sdk-graphql": "true" {% endif %} ] {% if method.responseModel %} From 42a6ec3c565f44eb5353009f754fcb76ff8ecd96 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 13 Oct 2022 13:32:14 +1300 Subject: [PATCH 452/555] Set graphql header if method type is graphql --- src/Spec/Swagger2.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Spec/Swagger2.php b/src/Spec/Swagger2.php index 28123bf80b..c5509582ba 100644 --- a/src/Spec/Swagger2.php +++ b/src/Spec/Swagger2.php @@ -185,6 +185,10 @@ public function getMethods($service) 'responseModel' => $responseModel, ]; + if ($output['type'] == 'graphql') { + $output['headers']['x-sdk-graphql'] = "true"; + } + if (isset($method['consumes']) && is_array($method['consumes'])) { foreach ($method['consumes'] as $consume) { $output['headers']['content-type'] = $consume; From bc3b5a56b9058965cba2e0b9a0240b27578218a2 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 13 Oct 2022 16:01:50 +1300 Subject: [PATCH 453/555] Remove redundant changes --- .../io/appwrite/services/ServiceTemplate.kt.twig | 2 +- templates/dart/base/requests/graphql.twig | 13 ------------- templates/dart/lib/services/service.dart.twig | 4 +--- templates/flutter/base/requests/graphql.twig | 13 ------------- .../io/appwrite/services/ServiceTemplate.kt.twig | 2 +- templates/php/base/requests/graphql.twig | 8 -------- templates/swift/Sources/Services/Service.swift.twig | 5 ++--- 7 files changed, 5 insertions(+), 42 deletions(-) delete mode 100644 templates/dart/base/requests/graphql.twig delete mode 100644 templates/flutter/base/requests/graphql.twig delete mode 100644 templates/php/base/requests/graphql.twig diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index 4400e975b9..69985fffbe 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -113,7 +113,7 @@ class {{ service.name | caseUcfirst }} : Service { ) {% else %} val headers = mutableMapOf( -{{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }}, +{{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} ) {% if method.responseModel %} val converter: (Map) -> {{ _self.resultType(sdk.namespace, method) }} = { diff --git a/templates/dart/base/requests/graphql.twig b/templates/dart/base/requests/graphql.twig deleted file mode 100644 index 8eb0e5e6d2..0000000000 --- a/templates/dart/base/requests/graphql.twig +++ /dev/null @@ -1,13 +0,0 @@ -{% import 'dart/base/utils.twig' as utils %} - final Map params = { - {{ utils.map_parameter(method.parameters.query) }} - {{ utils.map_parameter(method.parameters.body) }} - }; - - final Map headers = { - {{ utils.map_headers(method.headers) }}, - }}; - - final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); - - return res.data; diff --git a/templates/dart/lib/services/service.dart.twig b/templates/dart/lib/services/service.dart.twig index 0ba8f9e0ea..7853a059e9 100644 --- a/templates/dart/lib/services/service.dart.twig +++ b/templates/dart/lib/services/service.dart.twig @@ -27,12 +27,10 @@ class {{ service.name | caseUcfirst }} extends Service { {{ include('dart/base/requests/file.twig') }} {% elseif method.type == 'location' %} {{ include('dart/base/requests/location.twig') }} -{% elseif method.type == 'graphql' %} -{{ include('dart/base/requests/graphql.twig') }} {% else %} {{ include('dart/base/requests/api.twig') }} {% endif %} - }} + } {% endfor %} } \ No newline at end of file diff --git a/templates/flutter/base/requests/graphql.twig b/templates/flutter/base/requests/graphql.twig deleted file mode 100644 index 23bc9f6a40..0000000000 --- a/templates/flutter/base/requests/graphql.twig +++ /dev/null @@ -1,13 +0,0 @@ -{% import 'flutter/base/utils.twig' as utils %} - final Map params = { - {{ utils.map_parameter(method.parameters.query) }} - {{ utils.map_parameter(method.parameters.body) }} - }; - - final Map headers = { - {{ utils.map_headers(method.headers) }}, - }}; - - final res = await client.call(HttpMethod.{{ method.method | caseLower }}, path: path, params: params, headers: headers); - - return res.data; diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index b8cdb81bfb..559444b49c 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -97,7 +97,7 @@ class {{ service.name | caseUcfirst }} : Service { {{ include('kotlin/base/requests/location.twig') }} {% else %} val headers = mutableMapOf( -{{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }}, +{{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} ) {% if method.responseModel %} val converter: (Map) -> {{ utils.resultType(sdk.namespace, method) }} = { diff --git a/templates/php/base/requests/graphql.twig b/templates/php/base/requests/graphql.twig deleted file mode 100644 index 72aee3648a..0000000000 --- a/templates/php/base/requests/graphql.twig +++ /dev/null @@ -1,8 +0,0 @@ - return $this->client->call(Client::METHOD_{{ method.method | caseUpper }}, $path, [ -{% for parameter in method.parameters.header %} - '{{ parameter.name }}' => ${{ parameter.name | caseCamel | escapeKeyword }}, -{% endfor %} -{% for key, header in method.headers %} - '{{ key }}' => '{{ header }}', -{% endfor %} - ], $params); \ No newline at end of file diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index fadf8204d4..b0b8d3b396 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -40,8 +40,7 @@ open class {{ service.name | caseUcfirst }}: Service { {{include('swift/base/requests/location.twig')}} {% else %} {% if 'multipart/form-data' in method.consumes %}var{% else %}let{% endif %} headers: [String: String] = [ -{{ method.headers|map((header, key) => " \"#{key}\": \"#{header}\"")|join(',\n')|raw }}{% if method.type == "graphql" %}, -{% endif %} +{{ method.headers|map((header, key) => " \"#{key}\": \"#{header}\"")|join(',\n')|raw }}{% if method.type == "graphql" %} ] {% if method.responseModel %} let converter: ([String: Any]) -> {{ _self.resultType(spec, method) }} = { dict in @@ -58,7 +57,7 @@ open class {{ service.name | caseUcfirst }}: Service { {{include('swift/base/requests/api.twig')}} {% endif %} {% endif %} - %} + } {% endfor %} From 3a3dc5a6053428c684cca9809c1d16ef379a9519 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 13 Oct 2022 16:03:05 +1300 Subject: [PATCH 454/555] Remove redundant changes --- templates/swift/Sources/Services/Service.swift.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index b0b8d3b396..714e1514c7 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -40,7 +40,7 @@ open class {{ service.name | caseUcfirst }}: Service { {{include('swift/base/requests/location.twig')}} {% else %} {% if 'multipart/form-data' in method.consumes %}var{% else %}let{% endif %} headers: [String: String] = [ -{{ method.headers|map((header, key) => " \"#{key}\": \"#{header}\"")|join(',\n')|raw }}{% if method.type == "graphql" %} +{{ method.headers|map((header, key) => " \"#{key}\": \"#{header}\"")|join(',\n')|raw }} ] {% if method.responseModel %} let converter: ([String: Any]) -> {{ _self.resultType(spec, method) }} = { dict in From 44baaa67b1a907dd0140b2a8bd6b950ae2d1c965 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 14 Oct 2022 15:36:02 +1300 Subject: [PATCH 455/555] Allow any type as response to account for batched array results from graphql --- .../library/src/main/java/io/appwrite/Client.kt.twig | 10 +++++----- .../java/io/appwrite/services/ServiceTemplate.kt.twig | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig index 12892655a1..95da30386e 100644 --- a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig @@ -230,7 +230,7 @@ class Client @JvmOverloads constructor( headers: Map = mapOf(), params: Map = mapOf(), responseType: Class, - converter: ((Map) -> T)? = null + converter: ((Any -> T)? = null ): T { val filteredParams = params.filterValues { it != null } @@ -321,7 +321,7 @@ class Client @JvmOverloads constructor( headers: MutableMap, params: MutableMap, responseType: Class, - converter: ((Map) -> T), + converter: ((Any) -> T), paramName: String, idParamName: String? = null, onProgress: ((UploadProgress) -> Unit)? = null, @@ -444,7 +444,7 @@ class Client @JvmOverloads constructor( private suspend fun awaitResponse( request: Request, responseType: Class, - converter: ((Map) -> T)? = null + converter: ((Any) -> T)? = null ) = suspendCancellableCoroutine { http.newCall(request).enqueue(object : Callback { override fun onFailure(call: Call, e: IOException) { @@ -505,9 +505,9 @@ class Client @JvmOverloads constructor( it.resume(true as T) return } - val map = gson.fromJson>( + val map = gson.fromJson( body, - object : TypeToken>(){}.type + object : TypeToken(){}.type ) it.resume( converter?.invoke(map) ?: map as T diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index 69985fffbe..8402a6ef4f 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -116,11 +116,11 @@ class {{ service.name | caseUcfirst }} : Service { {{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} ) {% if method.responseModel %} - val converter: (Map) -> {{ _self.resultType(sdk.namespace, method) }} = { + val converter: (Any) -> {{ _self.resultType(sdk.namespace, method) }} = { {% if method.responseModel == 'any' %} it {% else %} - {{ _self.resultType(sdk.namespace, method) }}.from(map = it) + {{ _self.resultType(sdk.namespace, method) }}.from(map = it as Map) {% endif %} } {% endif %} From 44439c26074043bf0cd3ecd4a3e51bf4af5d6a52 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 17 Oct 2022 12:23:18 +1300 Subject: [PATCH 456/555] Fix syntax --- .../android/library/src/main/java/io/appwrite/Client.kt.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig index 95da30386e..930b74edd5 100644 --- a/templates/android/library/src/main/java/io/appwrite/Client.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/Client.kt.twig @@ -230,7 +230,7 @@ class Client @JvmOverloads constructor( headers: Map = mapOf(), params: Map = mapOf(), responseType: Class, - converter: ((Any -> T)? = null + converter: ((Any) -> T)? = null ): T { val filteredParams = params.filterValues { it != null } From c4452f4e23d41ab003b021bab17db7ee3e9c34cf Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 17 Oct 2022 13:56:02 +1300 Subject: [PATCH 457/555] Allow any response for Kotlin --- templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig | 6 +++--- .../kotlin/io/appwrite/services/ServiceTemplate.kt.twig | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig index 09c6365289..280c7407e4 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig @@ -189,7 +189,7 @@ class Client @JvmOverloads constructor( headers: Map = mapOf(), params: Map = mapOf(), responseType: Class, - converter: ((Map) -> T)? = null + converter: ((Any) -> T)? = null ): T { val filteredParams = params.filterValues { it != null } @@ -280,7 +280,7 @@ class Client @JvmOverloads constructor( headers: MutableMap, params: MutableMap, responseType: Class, - converter: ((Map) -> T), + converter: ((Any) -> T), paramName: String, idParamName: String? = null, onProgress: ((UploadProgress) -> Unit)? = null, @@ -403,7 +403,7 @@ class Client @JvmOverloads constructor( private suspend fun awaitResponse( request: Request, responseType: Class, - converter: ((Map) -> T)? = null + converter: ((Any) -> T)? = null ) = suspendCancellableCoroutine { http.newCall(request).enqueue(object : Callback { override fun onFailure(call: Call, e: IOException) { diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index 559444b49c..1bc7b3e2d1 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -100,11 +100,11 @@ class {{ service.name | caseUcfirst }} : Service { {{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} ) {% if method.responseModel %} - val converter: (Map) -> {{ utils.resultType(sdk.namespace, method) }} = { + val converter: (Any) -> {{ utils.resultType(sdk.namespace, method) }} = { {% if method.responseModel == 'any' %} it {% else %} - {{ utils.resultType(sdk.namespace, method) }}.from(map = it) + {{ utils.resultType(sdk.namespace, method) }}.from(map = it as Map) {% endif %} } {% endif %} From 2b187bd2ac9b5d3a0bc4fb95f42e64e0daa15700 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 17 Oct 2022 13:58:54 +1300 Subject: [PATCH 458/555] Allow any response for Swift --- templates/swift/Sources/Client.swift.twig | 6 +++--- templates/swift/Sources/Services/Service.swift.twig | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index 8b169eb895..df4e870171 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -232,7 +232,7 @@ open class Client { headers: [String: String] = [:], params: [String: Any?] = [:], sink: ((ByteBuffer) -> Void)? = nil, - converter: (([String: Any]) -> T)? = nil + converter: ((Any) -> T)? = nil ) async throws -> T { let validParams = params.filter { $0.value != nil } @@ -273,7 +273,7 @@ open class Client { private func execute( _ request: HTTPClientRequest, withSink bufferSink: ((ByteBuffer) -> Void)? = nil, - converter: (([String: Any]) -> T)? = nil + converter: ((Any) -> T)? = nil ) async throws -> T { func complete(with response: HTTPClientResponse) async throws -> T { switch response.status.code { @@ -338,7 +338,7 @@ open class Client { params: inout [String: Any?], paramName: String, idParamName: String? = nil, - converter: (([String: Any]) -> T)? = nil, + converter: ((Any) -> T)? = nil, onProgress: ((UploadProgress) -> Void)? = nil ) async throws -> T { let input = params[paramName] as! InputFile diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index 714e1514c7..00c740fc9b 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -43,11 +43,11 @@ open class {{ service.name | caseUcfirst }}: Service { {{ method.headers|map((header, key) => " \"#{key}\": \"#{header}\"")|join(',\n')|raw }} ] {% if method.responseModel %} - let converter: ([String: Any]) -> {{ _self.resultType(spec, method) }} = { dict in + let converter: (Any) -> {{ _self.resultType(spec, method) }} = { response in {% if method.responseModel == 'any' %} - return dict + return response {% else %} - return {{ spec.title | caseUcfirst}}Models.{{method.responseModel | caseUcfirst}}.from(map: dict) + return {{ spec.title | caseUcfirst}}Models.{{method.responseModel | caseUcfirst}}.from(map: response as [String: Any]) {% endif %} } {% endif %} From 01232419c20fb80d741200ae1b1fae2646115b77 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 17 Oct 2022 14:43:03 +1300 Subject: [PATCH 459/555] Disable flutter beta test --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 99e74d2508..4bc9da50a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ env: - SDK=FlutterStable - SDK=Go112 - SDK=Go118 - - SDK=FlutterBeta +# - SDK=FlutterBeta - SDK=KotlinJava8 - SDK=KotlinJava11 - SDK=KotlinJava17 From 3385a348fda6497fdf5c38e64c8f102fda65727c Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 17 Oct 2022 17:32:11 +1300 Subject: [PATCH 460/555] Fix Java docs --- templates/android/docs/java/example.md.twig | 116 +++++++----------- templates/kotlin/base/requests/api.twig | 2 +- templates/kotlin/base/requests/file.twig | 2 +- templates/kotlin/base/requests/location.twig | 2 +- templates/kotlin/base/utils.twig | 5 +- templates/kotlin/docs/java/example.md.twig | 88 ++++++------- .../appwrite/services/ServiceTemplate.kt.twig | 8 +- 7 files changed, 94 insertions(+), 129 deletions(-) diff --git a/templates/android/docs/java/example.md.twig b/templates/android/docs/java/example.md.twig index 7722f903b5..2a7b6bcbbe 100644 --- a/templates/android/docs/java/example.md.twig +++ b/templates/android/docs/java/example.md.twig @@ -1,93 +1,63 @@ -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch +{% import 'kotlin/base/utils.twig' as utils %} import {{ sdk.namespace | caseDot }}.Client {% if method.parameters.all | filter((param) => param.type == 'file') | length > 0 %} import {{ sdk.namespace | caseDot }}.models.InputFile {% endif %} import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} -public class MainActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Client client = new Client(getApplicationContext()) +Client client = Client(context) {% if method.security|length > 0 %} - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint {% for node in method.security %} {% for key,header in node|keys %} - .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}"){% if loop.last %};{% endif %} // {{node[header].description}} -{% endfor %} -{% endfor %} -{% endif %} + .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}"){% if loop.last %};{% endif %} // {{node[header].description}} +{% endfor %}{% endfor %}{% endif %} - {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client); +{{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client); - {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } +{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}new Continuation<{{ utils.resultTypeJava(sdk.namespace, method) }}>() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - }{% if method.type != "webAuth" %} else { - Response response = (Response) o; - json = response.body().string(); - }{% endif %} - - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - });{% endif %} + @Override + public void resumeWith(@NotNull Object o) { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + failure.exception.printStackTrace(); + return; + } + + {{ utils.resultTypeJava(sdk.namespace, method) }} response = ({{ utils.resultTypeJava(sdk.namespace, method) }}) o; + } +});{% endif %} -{% if method.type == "webAuth" %} - this, -{% endif %} {% for parameter in method.parameters.all %} {% if parameter.required %} - {{ parameter | paramExample }}{% if not loop.last %}, {% endif %} + {{ parameter | paramExample }}{% if not loop.last %},{% endif %} {% endif %} {% if loop.last %} - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - }{% if method.type != "webAuth" %} else { - Response response = (Response) o; - json = response.body().string(); - }{% endif %} - - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } + new Continuation<{{ utils.resultTypeJava(sdk.namespace, method) }}>() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + failure.exception.printStackTrace(); + return; } - ); -{% endif %} -{% endfor %} + + {{ utils.resultTypeJava(sdk.namespace, method) }} response = ({{ utils.resultTypeJava(sdk.namespace, method) }}) o; + } } -} \ No newline at end of file +); +{% endif %} +{% endfor %} \ No newline at end of file diff --git a/templates/kotlin/base/requests/api.twig b/templates/kotlin/base/requests/api.twig index 14d89c7306..61870e7406 100644 --- a/templates/kotlin/base/requests/api.twig +++ b/templates/kotlin/base/requests/api.twig @@ -4,7 +4,7 @@ path, headers, params, - responseType = {{ utils.resultType(sdk.namespace, method) }}::class.java, + responseType = {{ utils.resultTypeKt(sdk.namespace, method) }}::class.java, {% if method.responseModel %} converter, {% endif %} diff --git a/templates/kotlin/base/requests/file.twig b/templates/kotlin/base/requests/file.twig index d06aa20ec3..03a73b1a61 100644 --- a/templates/kotlin/base/requests/file.twig +++ b/templates/kotlin/base/requests/file.twig @@ -10,7 +10,7 @@ path, headers, params, - responseType = {{ utils.resultType(sdk.namespace, method) }}::class.java, + responseType = {{ utils.resultTypeKt(sdk.namespace, method) }}::class.java, {% if method.responseModel %} converter, {% endif %} diff --git a/templates/kotlin/base/requests/location.twig b/templates/kotlin/base/requests/location.twig index 5174981af5..e94a46695c 100644 --- a/templates/kotlin/base/requests/location.twig +++ b/templates/kotlin/base/requests/location.twig @@ -3,5 +3,5 @@ "{{ method.method | caseUpper }}", path, params = params, - responseType = {{ utils.resultType(sdk.namespace, method) }}::class.java + responseType = {{ utils.resultTypeKt(sdk.namespace, method) }}::class.java ) \ No newline at end of file diff --git a/templates/kotlin/base/utils.twig b/templates/kotlin/base/utils.twig index 8770b8a947..460fd67129 100644 --- a/templates/kotlin/base/utils.twig +++ b/templates/kotlin/base/utils.twig @@ -5,6 +5,9 @@ {% macro methodNeedsSecurityParameters(method) %} {% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} {% endmacro %} -{% macro resultType(namespace, method) %} +{% macro resultTypeKt(namespace, method) %} {% if method.type == "webAuth" %}Bool{% elseif method.type == "location" %}ByteArray{% elseif not method.responseModel or method.responseModel == 'any' %}Any{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} +{% endmacro %} +{% macro resultTypeJava(namespace, method) %} +{% if method.type == "webAuth" %}boolean{% elseif method.type == "location" %}byte[]{% elseif not method.responseModel or method.responseModel == 'any' %}Object{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} {% endmacro %} \ No newline at end of file diff --git a/templates/kotlin/docs/java/example.md.twig b/templates/kotlin/docs/java/example.md.twig index f91259417f..2a7b6bcbbe 100644 --- a/templates/kotlin/docs/java/example.md.twig +++ b/templates/kotlin/docs/java/example.md.twig @@ -1,71 +1,63 @@ +{% import 'kotlin/base/utils.twig' as utils %} import {{ sdk.namespace | caseDot }}.Client {% if method.parameters.all | filter((param) => param.type == 'file') | length > 0 %} import {{ sdk.namespace | caseDot }}.models.InputFile {% endif %} import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} -public void main() { - Client client = Client(context) +Client client = Client(context) {% if method.security|length > 0 %} - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint {% for node in method.security %} {% for key,header in node|keys %} - .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}"){% if loop.last %};{% endif %} // {{node[header].description}} + .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}"){% if loop.last %};{% endif %} // {{node[header].description}} {% endfor %}{% endfor %}{% endif %} - {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); - {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } +{{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client); - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } +{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}new Continuation<{{ utils.resultTypeJava(sdk.namespace, method) }}>() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resumeWith(@NotNull Object o) { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + failure.exception.printStackTrace(); + return; } - });{% endif %} + + {{ utils.resultTypeJava(sdk.namespace, method) }} response = ({{ utils.resultTypeJava(sdk.namespace, method) }}) o; + } +});{% endif %} {% for parameter in method.parameters.all %} {% if parameter.required %} - {{parameter.name}} = {{ parameter | paramExample }}{% if not loop.last %},{% endif %} + {{ parameter | paramExample }}{% if not loop.last %},{% endif %} {% endif %} {% if loop.last %} - new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } + new Continuation<{{ utils.resultTypeJava(sdk.namespace, method) }}>() { + @NotNull + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } - @Override - public void resumeWith(@NotNull Object o) { - String json = ""; - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Response response = (Response) o; - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } + @Override + public void resumeWith(@NotNull Object o) { + if (o instanceof Result.Failure) { + Result.Failure failure = (Result.Failure) o; + failure.exception.printStackTrace(); + return; } + + {{ utils.resultTypeJava(sdk.namespace, method) }} response = ({{ utils.resultTypeJava(sdk.namespace, method) }}) o; } - ); + } +); {% endif %} -{% endfor %} -} \ No newline at end of file +{% endfor %} \ No newline at end of file diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index 559444b49c..7c3713a161 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -30,12 +30,12 @@ class {{ service.name | caseUcfirst }} : Service { {% for parameter in method.parameters.all %} * @param {{ parameter.name | caseCamel }} {{ parameter.description | raw }} {% endfor %} - * {% if method.type != "webAuth" %}@return [{{ utils.resultType(sdk.namespace, method) }}]{% endif %} + * {% if method.type != "webAuth" %}@return [{{ utils.resultTypeKt(sdk.namespace, method) }}]{% endif %} */ @JvmOverloads @Throws({{ spec.title | caseUcfirst }}Exception::class) - suspend fun {{ method.name | caseCamel }}({% if method.type == "webAuth" %}{{ '\n\t\t' }}activity: ComponentActivity{% if method.parameters.all | length > 0 %}, {% endif %}{% endif %}{{ utils.method_parameters(method.parameters, method.consumes) }}{% if method.parameters.all|length > 0 %}{{ '\n\t' }}{% endif %}){% if method.type != "webAuth" %}: {{ utils.resultType(sdk.namespace, method) }}{% endif %} { + suspend fun {{ method.name | caseCamel }}({% if method.type == "webAuth" %}{{ '\n\t\t' }}activity: ComponentActivity{% if method.parameters.all | length > 0 %}, {% endif %}{% endif %}{{ utils.method_parameters(method.parameters, method.consumes) }}{% if method.parameters.all|length > 0 %}{{ '\n\t' }}{% endif %}){% if method.type != "webAuth" %}: {{ utils.resultTypeKt(sdk.namespace, method) }}{% endif %} { val path = "{{ method.path }}"{% for parameter in method.parameters.path %}.replace("{{ '{' ~ parameter.name | caseCamel ~ '}' }}", {{ parameter.name | caseCamel }}){% endfor %} val params = mutableMapOf( @@ -100,11 +100,11 @@ class {{ service.name | caseUcfirst }} : Service { {{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} ) {% if method.responseModel %} - val converter: (Map) -> {{ utils.resultType(sdk.namespace, method) }} = { + val converter: (Map) -> {{ utils.resultTypeKt(sdk.namespace, method) }} = { {% if method.responseModel == 'any' %} it {% else %} - {{ utils.resultType(sdk.namespace, method) }}.from(map = it) + {{ utils.resultTypeKt(sdk.namespace, method) }}.from(map = it) {% endif %} } {% endif %} From 912c9ce635989efc2e7851629dff9e49c917409e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 17 Oct 2022 17:32:32 +1300 Subject: [PATCH 461/555] Tidy Kotlin docs --- templates/android/docs/kotlin/example.md.twig | 38 +++++-------------- templates/kotlin/docs/kotlin/example.md.twig | 21 +++++----- 2 files changed, 18 insertions(+), 41 deletions(-) diff --git a/templates/android/docs/kotlin/example.md.twig b/templates/android/docs/kotlin/example.md.twig index 131d43bc93..7f550520e3 100644 --- a/templates/android/docs/kotlin/example.md.twig +++ b/templates/android/docs/kotlin/example.md.twig @@ -1,47 +1,27 @@ -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch import {{ sdk.namespace | caseDot }}.Client {% if method.parameters.all | filter((param) => param.type == 'file') | length > 0 %} import {{ sdk.namespace | caseDot }}.models.InputFile {% endif %} import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} -class MainActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - - val client = Client(applicationContext) +val client = Client(context) {% if method.security|length > 0 %} - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint {% for node in method.security %} {% for key,header in node|keys %} - .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}") // {{node[header].description}} -{% endfor %} -{% endfor %} -{% endif %} + .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}") // {{node[header].description}} +{% endfor %}{% endfor %}{% endif %} - val {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client) +val {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client) - GlobalScope.launch { -{% if method.type == 'webAuth' %} {% elseif method.type == 'location' %} val result = {% else %} val response = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}){% endif %} +{% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}val result = {% else %}val response = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}){% endif %} -{% if method.type == "webAuth" %} - activity = this@MainActivity, -{% endif %} {% for parameter in method.parameters.all %} {% if parameter.required %} - {{parameter.name}} = {{ parameter | paramExample }}{% if not loop.last %},{% endif %} + {{parameter.name}} = {{ parameter | paramExample }}{% if not loop.last %},{% endif %} {% endif %} {% if loop.last %} - ) +) {% endif %} -{% endfor %} -{% if method.type == 'webAuth' %}{% elseif method.type == 'location' %} println(result); // Resource URL{% else %} val json = response.body?.string(){% endif %} - - } - } -} \ No newline at end of file +{% endfor %} \ No newline at end of file diff --git a/templates/kotlin/docs/kotlin/example.md.twig b/templates/kotlin/docs/kotlin/example.md.twig index 0d7ecb6ce5..7f550520e3 100644 --- a/templates/kotlin/docs/kotlin/example.md.twig +++ b/templates/kotlin/docs/kotlin/example.md.twig @@ -4,27 +4,24 @@ import {{ sdk.namespace | caseDot }}.models.InputFile {% endif %} import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} -suspend fun main() { - val client = Client(context) +val client = Client(context) {% if method.security|length > 0 %} - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint {% for node in method.security %} {% for key,header in node|keys %} - .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}") // {{node[header].description}} + .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}") // {{node[header].description}} {% endfor %}{% endfor %}{% endif %} - val {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) -{% if method.type == 'webAuth' %} {% elseif method.type == 'location' %} val result = {% else %} val response = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}){% endif %} +val {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client) + +{% if method.type == 'webAuth' %}{% elseif method.type == 'location' %}val result = {% else %}val response = {% endif %}{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}){% endif %} {% for parameter in method.parameters.all %} {% if parameter.required %} - {{parameter.name}} = {{ parameter | paramExample }}{% if not loop.last %},{% endif %} + {{parameter.name}} = {{ parameter | paramExample }}{% if not loop.last %},{% endif %} {% endif %} {% if loop.last %} - ) +) {% endif %} -{% endfor %} -{% if method.type == 'webAuth' %}{% elseif method.type == 'location' %} println(result); // Resource URL{% else %} val json = response.body?.string(){% endif %} - -} \ No newline at end of file +{% endfor %} \ No newline at end of file From 7200cbb8acc9479bf04e8af9f2ce9e6d4653514f Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 17 Oct 2022 17:32:44 +1300 Subject: [PATCH 462/555] Tidy Swift docs --- templates/swift/docs/example.md.twig | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/templates/swift/docs/example.md.twig b/templates/swift/docs/example.md.twig index 25a9e95c7d..429acc3bf3 100644 --- a/templates/swift/docs/example.md.twig +++ b/templates/swift/docs/example.md.twig @@ -1,25 +1,24 @@ import Appwrite -func main() async throws { - let client = Client() +let client = Client() {% if method.security|length > 0 %} - .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint {% for node in method.security %} {% for key,header in node|keys %} - .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}") // {{node[header].description}} + .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}") // {{node[header].description}} {% endfor %} {% endfor %} {% endif %} - let {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) - let {% if method.type == 'webAuth' %}success{% elseif method.type == 'location' %}byteBuffer{% elseif method.responseModel | length == 0 %}result{% else %}{{ method.responseModel | caseCamel | escapeKeyword }}{% endif %} = try await {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => param.required) | length == 0 %}){{ '\n' }}{% endif %} + +let {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}) + +let {% if method.type == 'webAuth' %}success{% elseif method.type == 'location' %}byteBuffer{% elseif method.responseModel | length == 0 %}result{% else %}{{ method.responseModel | caseCamel | escapeKeyword }}{% endif %} = try await {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | filter((param) => param.required) | length == 0 %}){{ '\n' }}{% endif %} {% for parameter in method.parameters.all | filter((parameter) => parameter.required) %} - {{parameter.name}}: {{ parameter | paramExample | escapeKeyword }}{% if not loop.last %},{% endif %} + {{parameter.name}}: {{ parameter | paramExample | escapeKeyword }}{% if not loop.last %},{% endif %} {% if loop.last %} - ) +) {% endif %} -{% endfor %} - print(String(describing: {% if method.type == 'webAuth' %}success{% elseif method.type == 'location' %}byteBuffer{% elseif method.responseModel | length == 0 %}result{% else %}{{ method.responseModel | caseCamel | escapeKeyword }}{% endif %}) -} +{% endfor %} \ No newline at end of file From b6b694186347298d58c26786ab896c4e7dd827eb Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 17 Oct 2022 17:34:24 +1300 Subject: [PATCH 463/555] Disable flutter beta test --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 99e74d2508..4bc9da50a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ env: - SDK=FlutterStable - SDK=Go112 - SDK=Go118 - - SDK=FlutterBeta +# - SDK=FlutterBeta - SDK=KotlinJava8 - SDK=KotlinJava11 - SDK=KotlinJava17 From 71ca0d93761e4b0cff86813931fa455905e67c59 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Tue, 18 Oct 2022 20:07:35 +0200 Subject: [PATCH 464/555] Update pubspec.yaml.twig --- templates/flutter/pubspec.yaml.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 36f898a805..01df5fdffb 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -12,10 +12,10 @@ dependencies: flutter: sdk: flutter cookie_jar: ^3.0.1 - device_info_plus: ^6.0.0 + device_info_plus: ^7.0.0 flutter_web_auth_2: ^1.1.2 http: ^0.13.5 - package_info_plus: ^2.0.0 + package_info_plus: ^3.0.0 path_provider: ^2.0.11 web_socket_channel: ^2.2.0 From cf4938ab1705da8b6a98368e35449107959787a2 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 19 Oct 2022 17:43:03 +1300 Subject: [PATCH 465/555] Fix Kotlin/Java webauth return types --- templates/kotlin/base/utils.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/kotlin/base/utils.twig b/templates/kotlin/base/utils.twig index 460fd67129..e3ff6f05bb 100644 --- a/templates/kotlin/base/utils.twig +++ b/templates/kotlin/base/utils.twig @@ -6,8 +6,8 @@ {% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} {% endmacro %} {% macro resultTypeKt(namespace, method) %} -{% if method.type == "webAuth" %}Bool{% elseif method.type == "location" %}ByteArray{% elseif not method.responseModel or method.responseModel == 'any' %}Any{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} +{% if method.type == "webAuth" %}{% elseif method.type == "location" %}ByteArray{% elseif not method.responseModel or method.responseModel == 'any' %}Any{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} {% endmacro %} {% macro resultTypeJava(namespace, method) %} -{% if method.type == "webAuth" %}boolean{% elseif method.type == "location" %}byte[]{% elseif not method.responseModel or method.responseModel == 'any' %}Object{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} +{% if method.type == "webAuth" %}Void{% elseif method.type == "location" %}byte[]{% elseif not method.responseModel or method.responseModel == 'any' %}Object{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} {% endmacro %} \ No newline at end of file From f0457b3de7265cba4f45e4b01c71dd702a672d77 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 19 Oct 2022 17:47:42 +1300 Subject: [PATCH 466/555] Fix Kotlin/Java doc result line --- templates/android/docs/java/example.md.twig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/android/docs/java/example.md.twig b/templates/android/docs/java/example.md.twig index 2a7b6bcbbe..23d247a0cc 100644 --- a/templates/android/docs/java/example.md.twig +++ b/templates/android/docs/java/example.md.twig @@ -55,8 +55,12 @@ Client client = Client(context) return; } + {%~ if method.type != 'webAuth' %} {{ utils.resultTypeJava(sdk.namespace, method) }} response = ({{ utils.resultTypeJava(sdk.namespace, method) }}) o; - } + {%~ else %} + // Success + {%~ endif %} + }} } ); {% endif %} From cbcbe54ba785b6451e978b8bd50a25f1b1bc32a1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 20 Oct 2022 15:50:49 +1300 Subject: [PATCH 467/555] Add GraphQL lang --- example.php | 11 ++ src/SDK/Language/GraphQL.php | 204 +++++++++++++++++++++++++++++++++++ 2 files changed, 215 insertions(+) create mode 100644 src/SDK/Language/GraphQL.php diff --git a/example.php b/example.php index 4b3fbc9097..01366fb4c4 100644 --- a/example.php +++ b/example.php @@ -2,6 +2,7 @@ include_once 'vendor/autoload.php'; +use Appwrite\SDK\Language\GraphQL; use Appwrite\Spec\Swagger2; use Appwrite\SDK\SDK; use Appwrite\SDK\Language\Web; @@ -457,6 +458,16 @@ function getSSLPage($url) { ]) ; $sdk->generate(__DIR__ . '/examples/kotlin'); + + // GraphQL + $sdk = new SDK(new GraphQL(), new Swagger2($spec)); + + $sdk + ->setName('GraphQL') + ->setDescription('Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Flutter SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to https://appwrite.io/docs') + ->setLogo('https://appwrite.io/v1/images/console.png') + ; + $sdk->generate(__DIR__ . '/examples/graphql'); } catch (Exception $exception) { echo 'Error: ' . $exception->getMessage() . ' on ' . $exception->getFile() . ':' . $exception->getLine() . "\n"; diff --git a/src/SDK/Language/GraphQL.php b/src/SDK/Language/GraphQL.php new file mode 100644 index 0000000000..26d06b48c8 --- /dev/null +++ b/src/SDK/Language/GraphQL.php @@ -0,0 +1,204 @@ +getTypeName($parameter['array']) . ']'; + break; + } + $type = '[String]'; + break; + case self::TYPE_OBJECT: + $type = 'JSON'; + break; + } + + if (empty($type)) { + $type = $parameter['type']; + } + + if ($parameter['required'] ?? false) { + $type .= '!'; + } + + return $type; + } + + /** + * @param array $param + * @return string + */ + public function getParamDefault(array $param): string + { + $type = $param['type'] ?? ''; + $default = $param['default'] ?? ''; + $required = $param['required'] ?? ''; + + if($required) { + return ''; + } + + $output = ''; + + if(empty($default) && $default !== 0 && $default !== false) { + switch ($type) { + case self::TYPE_OBJECT: + $output .= '{}'; + break; + case self::TYPE_NUMBER: + case self::TYPE_INTEGER: + $output .= '0'; + break; + case self::TYPE_BOOLEAN: + $output .= 'false'; + break; + case self::TYPE_ARRAY: + $output .= '[]'; + break; + case self::TYPE_STRING: + $output .= '""'; + break; + } + } + else { + switch ($type) { + case self::TYPE_OBJECT: + case self::TYPE_NUMBER: + case self::TYPE_ARRAY: + case self::TYPE_INTEGER: + $output .= $default; + break; + case self::TYPE_BOOLEAN: + $output .= ($default) ? 'true' : 'false'; + break; + case self::TYPE_STRING: + $output .= '"'.$default .'"'; + break; + } + } + + return $output; + } + + /** + * @param array $param + * @return string + */ + public function getParamExample(array $param): string + { + $type = $param['type'] ?? ''; + $example = $param['example'] ?? ''; + + $output = ''; + + if(empty($example) && $example !== 0 && $example !== false) { + switch ($type) { + case self::TYPE_FILE: + $output .= 'null'; + break; + case self::TYPE_NUMBER: + case self::TYPE_INTEGER: + $output .= '0'; + break; + case self::TYPE_BOOLEAN: + $output .= 'false'; + break; + case self::TYPE_STRING: + $output .= ""; + break; + case self::TYPE_OBJECT: + $output .= '{}'; + break; + case self::TYPE_ARRAY: + $output .= '[]'; + break; + } + } + else { + switch ($type) { + case self::TYPE_FILE: + case self::TYPE_NUMBER: + case self::TYPE_INTEGER: + case self::TYPE_ARRAY: + $output .= $example; + break; + case self::TYPE_STRING: + case self::TYPE_OBJECT: + $output .= '"' . $example . '"'; + break; + case self::TYPE_BOOLEAN: + $output .= ($example) ? 'true' : 'false'; + break; + } + } + + return $output; + } + + /** + * @return array + */ + public function getFiles(): array + { + return [ + [ + 'scope' => 'method', + 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}', + 'template' => '/graphql/docs/example.md.twig', + ], + ]; + } +} + From 07bef0877274d8db3691b84b0439f1be59bdc46e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 20 Oct 2022 15:51:43 +1300 Subject: [PATCH 468/555] Add GraphQL doc template --- templates/graphql/docs/example.md.twig | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 templates/graphql/docs/example.md.twig diff --git a/templates/graphql/docs/example.md.twig b/templates/graphql/docs/example.md.twig new file mode 100644 index 0000000000..65e01c9124 --- /dev/null +++ b/templates/graphql/docs/example.md.twig @@ -0,0 +1,29 @@ +{%~ if method.method == 'get' %} +query { +{%~ else %} +mutation { +{%~ endif %} + {{ service.name | caseCamel }}{{ method.name | caseCamel | caseUcfirst }}{% if method.parameters.all | filter(p => p.required) | length == 0 %} {{ '{' }}{% else %}( + {%~ for parameter in method.parameters.all | filter(p => p.required) %} + {{ parameter.name | caseCamel }}: {{ parameter | paramExample }}{% if not loop.last %},{% endif %} + + {%~ endfor %} + ) {{ '{' }}{%~ endif %} + + {%~ if method.responseModel == 'none' or method.responseModel == '' %} + status + {%~ else %} + {%~ for definition in spec.definitions %} + {%~ if definition.name == method.responseModel %} + {%~ for property in definition.properties | filter(p => p.required) %} + {{ property.name | caseCamel }}{% if not loop.last %},{% endif %} + + {%~ endfor %} + {%~ if definition.additionalProperties %} + data + {%~ endif %} + {%~ endif %} + {%~ endfor %} + {%~ endif %} + } +} \ No newline at end of file From a41d5fef09c384edf788dfb7186108986e6143ad Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 20 Oct 2022 16:14:02 +1300 Subject: [PATCH 469/555] Fix graphql selection sets --- templates/graphql/docs/example.md.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/graphql/docs/example.md.twig b/templates/graphql/docs/example.md.twig index 65e01c9124..d6c63cdbe6 100644 --- a/templates/graphql/docs/example.md.twig +++ b/templates/graphql/docs/example.md.twig @@ -16,7 +16,7 @@ mutation { {%~ for definition in spec.definitions %} {%~ if definition.name == method.responseModel %} {%~ for property in definition.properties | filter(p => p.required) %} - {{ property.name | caseCamel }}{% if not loop.last %},{% endif %} + {{ property.name | caseCamel }} {%~ endfor %} {%~ if definition.additionalProperties %} From 163cbc8b1f5f5c9d6d66f66313d4d278b687bfbd Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 20 Oct 2022 16:34:08 +1300 Subject: [PATCH 470/555] Fix line breaks --- templates/graphql/docs/example.md.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/graphql/docs/example.md.twig b/templates/graphql/docs/example.md.twig index d6c63cdbe6..1bb71597ec 100644 --- a/templates/graphql/docs/example.md.twig +++ b/templates/graphql/docs/example.md.twig @@ -17,7 +17,6 @@ mutation { {%~ if definition.name == method.responseModel %} {%~ for property in definition.properties | filter(p => p.required) %} {{ property.name | caseCamel }} - {%~ endfor %} {%~ if definition.additionalProperties %} data From c00519359c45fc633879d44f1eadc99cf160bcbf Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 20 Oct 2022 17:40:11 +1300 Subject: [PATCH 471/555] Fix example extension --- src/SDK/Language/GraphQL.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SDK/Language/GraphQL.php b/src/SDK/Language/GraphQL.php index 26d06b48c8..f21fcaf89b 100644 --- a/src/SDK/Language/GraphQL.php +++ b/src/SDK/Language/GraphQL.php @@ -195,7 +195,7 @@ public function getFiles(): array return [ [ 'scope' => 'method', - 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}', + 'destination' => 'docs/examples/graphql/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => '/graphql/docs/example.md.twig', ], ]; From d51fe5c537133ad21fca7e676fe9b1d43817b6cb Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 20 Oct 2022 19:50:11 +1300 Subject: [PATCH 472/555] Fix output path --- src/SDK/Language/GraphQL.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SDK/Language/GraphQL.php b/src/SDK/Language/GraphQL.php index f21fcaf89b..bf36bb8462 100644 --- a/src/SDK/Language/GraphQL.php +++ b/src/SDK/Language/GraphQL.php @@ -195,7 +195,7 @@ public function getFiles(): array return [ [ 'scope' => 'method', - 'destination' => 'docs/examples/graphql/{{service.name | caseLower}}/{{method.name | caseDash}}.md', + 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => '/graphql/docs/example.md.twig', ], ]; From 222cb346509db2230859021355b67e2942615f7c Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 20 Oct 2022 09:33:50 +0200 Subject: [PATCH 473/555] Try out bugfix https://github.com/fluttercommunity/plus_plugins/pull/1275 --- templates/flutter/example/pubspec.yaml.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/example/pubspec.yaml.twig b/templates/flutter/example/pubspec.yaml.twig index a1ecb3060b..905caac5d1 100644 --- a/templates/flutter/example/pubspec.yaml.twig +++ b/templates/flutter/example/pubspec.yaml.twig @@ -1,3 +1,3 @@ name: {{ language.params.packageName }}_example environment: - sdk: '>=2.6.0 <3.0.0' \ No newline at end of file + sdk: '>=2.11.0 <3.0.0' From 25c133f30b600ab9717fd9f65607e5093cf1ee27 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 20 Oct 2022 09:47:35 +0200 Subject: [PATCH 474/555] Try out bugfix --- templates/flutter/pubspec.yaml.twig | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 01df5fdffb..1c4951a635 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -12,10 +12,16 @@ dependencies: flutter: sdk: flutter cookie_jar: ^3.0.1 - device_info_plus: ^7.0.0 + device_info_plus: + git: + url: git@github.com:fluttercommunity/plus_plugins.git + path: packages/device_info_plus/device_info_plus flutter_web_auth_2: ^1.1.2 http: ^0.13.5 - package_info_plus: ^3.0.0 + package_info_plus: + git: + url: git@github.com:fluttercommunity/plus_plugins.git + path: packages/package_info_plus/package_info_plus path_provider: ^2.0.11 web_socket_channel: ^2.2.0 From 314efb93f4d09e9a76d89cbdcce36fa676e625a4 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 20 Oct 2022 21:07:49 +1300 Subject: [PATCH 475/555] Fix swift casts --- templates/swift/Sources/Client.swift.twig | 4 ++-- templates/swift/Sources/Services/Service.swift.twig | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index df4e870171..31d95f8c35 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -376,7 +376,7 @@ open class Client { path: path + "/" + (params[idParamName!] as! String), headers: headers, params: [:], - converter: { return $0 } + converter: { return $0 as! [String: Any] } ) let chunksUploaded = map["chunksUploaded"] as! Int offset = min(size, (chunksUploaded * Client.chunkSize)) @@ -397,7 +397,7 @@ open class Client { path: path, headers: headers, params: params, - converter: { return $0 } + converter: { return $0 as! [String: Any] } ) offset += Client.chunkSize diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index 00c740fc9b..ebf5969d25 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -47,7 +47,7 @@ open class {{ service.name | caseUcfirst }}: Service { {% if method.responseModel == 'any' %} return response {% else %} - return {{ spec.title | caseUcfirst}}Models.{{method.responseModel | caseUcfirst}}.from(map: response as [String: Any]) + return {{ spec.title | caseUcfirst}}Models.{{method.responseModel | caseUcfirst}}.from(map: response as! [String: Any]) {% endif %} } {% endif %} From bf16c77733b335ad4800e4387b7ca92a995a1c8d Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:22:32 +0200 Subject: [PATCH 476/555] Revert bugfix --- templates/flutter/example/pubspec.yaml.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/example/pubspec.yaml.twig b/templates/flutter/example/pubspec.yaml.twig index 905caac5d1..7dfb28b029 100644 --- a/templates/flutter/example/pubspec.yaml.twig +++ b/templates/flutter/example/pubspec.yaml.twig @@ -1,3 +1,3 @@ name: {{ language.params.packageName }}_example environment: - sdk: '>=2.11.0 <3.0.0' + sdk: '>=2.6.0 <3.0.0' From ec67f77580eb6b2470c0d502f14f7a4fea8bf7da Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:23:04 +0200 Subject: [PATCH 477/555] Revert whitespace change From 4eba120ff0aeffb6fcfcedf98a9c73816b1e1b7b Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:24:02 +0200 Subject: [PATCH 478/555] Revert whitespace change From 76333fc3a609062fdf0a0137527692544a194489 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:24:54 +0200 Subject: [PATCH 479/555] Revert whitespace change From 8f10acdceb13ad8f9495cf46297dee0b8f1b8761 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:25:45 +0200 Subject: [PATCH 480/555] Remove bugfix, use pub.dev dependencies again --- templates/flutter/pubspec.yaml.twig | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 1c4951a635..36ec60d3d0 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -12,17 +12,10 @@ dependencies: flutter: sdk: flutter cookie_jar: ^3.0.1 - device_info_plus: - git: - url: git@github.com:fluttercommunity/plus_plugins.git - path: packages/device_info_plus/device_info_plus + device_info_plus: ^7.0.1 flutter_web_auth_2: ^1.1.2 http: ^0.13.5 - package_info_plus: - git: - url: git@github.com:fluttercommunity/plus_plugins.git - path: packages/package_info_plus/package_info_plus - path_provider: ^2.0.11 + package_info_plus: ^3.0.1 web_socket_channel: ^2.2.0 From bb43a8b8645baaff59b7cbfdc408c6572809c551 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:26:33 +0200 Subject: [PATCH 481/555] Bring back path_provider --- templates/flutter/pubspec.yaml.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 36ec60d3d0..606284a80a 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -16,6 +16,7 @@ dependencies: flutter_web_auth_2: ^1.1.2 http: ^0.13.5 package_info_plus: ^3.0.1 + path_provider: ^2.0.11 web_socket_channel: ^2.2.0 From 9b3b5b8380cc9e40436b2a992292c65574f1af48 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 12:27:58 +1300 Subject: [PATCH 482/555] Fix close brace --- templates/android/docs/java/example.md.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/android/docs/java/example.md.twig b/templates/android/docs/java/example.md.twig index 23d247a0cc..1809797b5f 100644 --- a/templates/android/docs/java/example.md.twig +++ b/templates/android/docs/java/example.md.twig @@ -60,7 +60,7 @@ Client client = Client(context) {%~ else %} // Success {%~ endif %} - }} + } } ); {% endif %} From 3f122969432f251025ca50199e45c644307d9743 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 12:28:16 +1300 Subject: [PATCH 483/555] Apply to Kotlin --- templates/kotlin/docs/java/example.md.twig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/kotlin/docs/java/example.md.twig b/templates/kotlin/docs/java/example.md.twig index 2a7b6bcbbe..1809797b5f 100644 --- a/templates/kotlin/docs/java/example.md.twig +++ b/templates/kotlin/docs/java/example.md.twig @@ -55,7 +55,11 @@ Client client = Client(context) return; } + {%~ if method.type != 'webAuth' %} {{ utils.resultTypeJava(sdk.namespace, method) }} response = ({{ utils.resultTypeJava(sdk.namespace, method) }}) o; + {%~ else %} + // Success + {%~ endif %} } } ); From 6ca7261082096279119ca1bbe8589b988a3af8c0 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 13:38:57 +1300 Subject: [PATCH 484/555] Allow file exclusion --- src/SDK/SDK.php | 83 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index f1356d3be8..819e54e57f 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -579,6 +579,10 @@ public function generate($target) 'methods' => $methods, ]; + if ($this->exclude($file, $params)) { + continue; + } + $this->render($template, $destination, $block, $params, $minify); } break; @@ -587,6 +591,10 @@ public function generate($target) $params['definition'] = $definition; + if ($this->exclude($file, $params)) { + continue; + } + $this->render($template, $destination, $block, $params, $minify); } break; @@ -606,6 +614,11 @@ public function generate($target) foreach ($methods as $method) { $params['method'] = $method; + + if ($this->exclude($file, $params)) { + continue; + } + $this->render($template, $destination, $block, $params, $minify); } } @@ -614,6 +627,76 @@ public function generate($target) } } + /** + * Determine if a file should be excluded from generation. + * + * Allows for files to be excluded based on: + * - Service name or feature + * - Method name or type + * - Definition name + * + * @param $file + * @param $params + * @return bool + */ + protected function exclude($file, $params): bool + { + $exclude = $file['exclude'] ?? []; + + $services = []; + $features = []; + foreach ($exclude['services'] ?? [] as $service) { + if (isset($service['name'])) { + $services[] = $service['name']; + } + if (isset($service['feature'])) { + $features[] = $service['feature']; + } + } + + $methods = []; + $types = []; + foreach ($exclude['methods'] ?? [] as $method) { + if (isset($method['name'])) { + $methods[] = $method['name']; + } + if (isset($method['type'])) { + $types[] = $method['type']; + } + } + + $definitions = []; + foreach ($exclude['definitions'] ?? [] as $definition) { + if (isset($definition['name'])) { + $definitions[] = $definition['name']; + } + } + + if (\in_array($params['service']['name'] ?? '', $services)) { + return true; + } + + foreach ($features as $feature) { + if ($params['service']['features'][$feature] ?? false) { + return true; + } + } + + if (\in_array($params['method']['name'] ?? '', $methods)) { + return true; + } + + if (\in_array($params['method']['type'] ?? '', $types)) { + return true; + } + + if (\in_array($params['definition']['name'] ?? '', $definitions)) { + return true; + } + + return false; + } + /** * @return bool */ From e409146ec42ac230d6d71bbadfebec7a530d746e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 13:49:26 +1300 Subject: [PATCH 485/555] Exclude webAuth methods from graphql docs --- src/SDK/Language/GraphQL.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SDK/Language/GraphQL.php b/src/SDK/Language/GraphQL.php index bf36bb8462..8e1d9d3b99 100644 --- a/src/SDK/Language/GraphQL.php +++ b/src/SDK/Language/GraphQL.php @@ -156,10 +156,10 @@ public function getParamExample(array $param): string $output .= 'false'; break; case self::TYPE_STRING: - $output .= ""; + $output .= '""'; break; case self::TYPE_OBJECT: - $output .= '{}'; + $output .= '"{}"'; break; case self::TYPE_ARRAY: $output .= '[]'; @@ -197,6 +197,10 @@ public function getFiles(): array 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => '/graphql/docs/example.md.twig', + 'exclude' => [ + 'services' => [['name' => 'graphql']], + 'methods' => [['type' => 'webAuth']], + ], ], ]; } From 32ff71db36063bbe469ebc6a79ed19d76a1d5743 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 20:17:44 +1300 Subject: [PATCH 486/555] Return self instead of class --- src/SDK/Language/CLI.php | 6 +++--- src/SDK/Language/Dart.php | 2 +- src/SDK/Language/JS.php | 4 ++-- src/SDK/Language/PHP.php | 4 ++-- src/SDK/Language/Python.php | 2 +- src/SDK/Language/Ruby.php | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/SDK/Language/CLI.php b/src/SDK/Language/CLI.php index 7b301bb7a0..89f17ad17a 100644 --- a/src/SDK/Language/CLI.php +++ b/src/SDK/Language/CLI.php @@ -18,7 +18,7 @@ class CLI extends Node * @param string $name * @return $this */ - public function setExecutableName(string $name): CLI + public function setExecutableName(string $name): self { $this->setParam('executableName', $name); @@ -29,7 +29,7 @@ public function setExecutableName(string $name): CLI * @param string $logo * @return $this */ - public function setLogo(string $logo): CLI + public function setLogo(string $logo): self { $this->setParam('logo', $logo); @@ -40,7 +40,7 @@ public function setLogo(string $logo): CLI * @param string $logo * @return $this */ - public function setLogoUnescaped(string $logo): CLI + public function setLogoUnescaped(string $logo): self { $this->setParam('logoUnescaped', $logo); diff --git a/src/SDK/Language/Dart.php b/src/SDK/Language/Dart.php index dd7c14b726..16c7040925 100644 --- a/src/SDK/Language/Dart.php +++ b/src/SDK/Language/Dart.php @@ -18,7 +18,7 @@ class Dart extends Language * @param string $name * @return $this */ - public function setPackageName(string $name): Dart + public function setPackageName(string $name): self { $this->setParam('packageName', $name); diff --git a/src/SDK/Language/JS.php b/src/SDK/Language/JS.php index b2408d74bd..3ed496b240 100644 --- a/src/SDK/Language/JS.php +++ b/src/SDK/Language/JS.php @@ -15,7 +15,7 @@ abstract class JS extends Language * @param string $name * @return $this */ - public function setNPMPackage(string $name): JS + public function setNPMPackage(string $name): self { $this->setParam('npmPackage', $name); @@ -26,7 +26,7 @@ public function setNPMPackage(string $name): JS * @param string $name * @return $this */ - public function setBowerPackage(string $name): JS + public function setBowerPackage(string $name): self { $this->setParam('bowerPackage', $name); diff --git a/src/SDK/Language/PHP.php b/src/SDK/Language/PHP.php index 75e45b0803..527ba6f477 100644 --- a/src/SDK/Language/PHP.php +++ b/src/SDK/Language/PHP.php @@ -19,7 +19,7 @@ class PHP extends Language * @param string $name * @return $this */ - public function setComposerVendor(string $name): PHP + public function setComposerVendor(string $name): self { $this->setParam('composerVendor', $name); @@ -30,7 +30,7 @@ public function setComposerVendor(string $name): PHP * @param string $name * @return $this */ - public function setComposerPackage(string $name): PHP + public function setComposerPackage(string $name): self { $this->setParam('composerPackage', $name); diff --git a/src/SDK/Language/Python.php b/src/SDK/Language/Python.php index ce181c4bef..c8d19e639b 100644 --- a/src/SDK/Language/Python.php +++ b/src/SDK/Language/Python.php @@ -15,7 +15,7 @@ class Python extends Language * @param string $name * @return $this */ - public function setPipPackage(string $name): Python + public function setPipPackage(string $name): self { $this->setParam('pipPackage', $name); diff --git a/src/SDK/Language/Ruby.php b/src/SDK/Language/Ruby.php index dc94777826..d05021146a 100644 --- a/src/SDK/Language/Ruby.php +++ b/src/SDK/Language/Ruby.php @@ -15,7 +15,7 @@ class Ruby extends Language * @param string $name * @return $this */ - public function setGemPackage(string $name): Ruby + public function setGemPackage(string $name): self { $this->setParam('gemPackage', $name); From 8fa391f99d318b55da801bf838633aba2e11ff14 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 20:29:09 +1300 Subject: [PATCH 487/555] Remove more redundant minify params --- src/SDK/Language/Deno.php | 12 ------------ src/SDK/Language/Flutter.php | 13 ------------- 2 files changed, 25 deletions(-) diff --git a/src/SDK/Language/Deno.php b/src/SDK/Language/Deno.php index afb4b585af..1fdef0c0da 100644 --- a/src/SDK/Language/Deno.php +++ b/src/SDK/Language/Deno.php @@ -22,13 +22,11 @@ public function getFiles(): array 'scope' => 'default', 'destination' => 'mod.ts', 'template' => 'deno/mod.ts.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'src/client.ts', 'template' => 'deno/src/client.ts.twig', - 'minify' => false, ], [ 'scope' => 'default', @@ -49,61 +47,51 @@ public function getFiles(): array 'scope' => 'default', 'destination' => 'src/query.ts', 'template' => 'deno/src/query.ts.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'src/inputFile.ts', 'template' => 'deno/src/inputFile.ts.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/src/service.ts', 'template' => 'deno/src/service.ts.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/src/models.d.ts', 'template' => 'deno/src/models.d.ts.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/src/exception.ts', 'template' => 'deno/src/exception.ts.twig', - 'minify' => false, ], [ 'scope' => 'service', 'destination' => '/src/services/{{service.name | caseDash}}.ts', 'template' => 'deno/src/services/service.ts.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'README.md', 'template' => 'deno/README.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'CHANGELOG.md', 'template' => 'deno/CHANGELOG.md.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'LICENSE', 'template' => 'deno/LICENSE.twig', - 'minify' => false, ], [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => 'deno/docs/example.md.twig', - 'minify' => false, ], ]; } diff --git a/src/SDK/Language/Flutter.php b/src/SDK/Language/Flutter.php index cda24dc346..1b5dea3792 100644 --- a/src/SDK/Language/Flutter.php +++ b/src/SDK/Language/Flutter.php @@ -29,79 +29,66 @@ public function getFiles(): array 'scope' => 'default', 'destination' => '/lib/src/response.dart', 'template' => 'dart/lib/src/response.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/service.dart', 'template' => 'dart/lib/src/service.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/models/model.dart', 'template' => 'dart/lib/src/models/model_base.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/enums.dart', 'template' => 'dart/lib/src/enums.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/exception.dart', 'template' => 'dart/lib/src/exception.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/src/upload_progress.dart', 'template' => 'dart/lib/src/upload_progress.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/models.dart', 'template' => 'dart/lib/models.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/permission.dart', 'template' => 'dart/lib/permission.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/role.dart', 'template' => 'dart/lib/role.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/id.dart', 'template' => 'dart/lib/id.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => '/lib/query.dart', 'template' => 'dart/lib/query.dart.twig', - 'minify' => false, ], [ 'scope' => 'definition', 'destination' => '/lib/src/models/{{definition.name | caseSnake }}.dart', 'template' => 'dart/lib/src/models/model.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', 'destination' => 'lib/src/input_file.dart', 'template' => 'dart/lib/src/input_file.dart.twig', - 'minify' => false, ], [ 'scope' => 'default', From ac445f1f89df1eaeabf292ad3d4058e867452d63 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 22:29:26 +1300 Subject: [PATCH 488/555] Add coroutine continuation wrapper for easier use from Java --- .../io/appwrite/coroutines/Callback.kt.twig | 18 ++++++++++++++++++ .../io/appwrite/coroutines/Callback.kt.twig | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 templates/android/library/src/main/java/io/appwrite/coroutines/Callback.kt.twig create mode 100644 templates/kotlin/src/main/kotlin/io/appwrite/coroutines/Callback.kt.twig diff --git a/templates/android/library/src/main/java/io/appwrite/coroutines/Callback.kt.twig b/templates/android/library/src/main/java/io/appwrite/coroutines/Callback.kt.twig new file mode 100644 index 0000000000..279be06c39 --- /dev/null +++ b/templates/android/library/src/main/java/io/appwrite/coroutines/Callback.kt.twig @@ -0,0 +1,18 @@ +package {{ sdk.namespace | caseDot }}.coroutines + +import kotlinx.coroutines.Dispatchers +import kotlin.coroutines.Continuation +import kotlin.coroutines.CoroutineContext + +interface Callback { + fun onComplete(result: T?, error: Throwable?) +} + +class CoroutineCallback @JvmOverloads constructor( + private val callback: Callback, + override val context: CoroutineContext = Dispatchers.Default +) : Continuation { + override fun resumeWith(result: Result) { + callback.onComplete(result.getOrNull(), result.exceptionOrNull()) + } +} \ No newline at end of file diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/coroutines/Callback.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/coroutines/Callback.kt.twig new file mode 100644 index 0000000000..279be06c39 --- /dev/null +++ b/templates/kotlin/src/main/kotlin/io/appwrite/coroutines/Callback.kt.twig @@ -0,0 +1,18 @@ +package {{ sdk.namespace | caseDot }}.coroutines + +import kotlinx.coroutines.Dispatchers +import kotlin.coroutines.Continuation +import kotlin.coroutines.CoroutineContext + +interface Callback { + fun onComplete(result: T?, error: Throwable?) +} + +class CoroutineCallback @JvmOverloads constructor( + private val callback: Callback, + override val context: CoroutineContext = Dispatchers.Default +) : Continuation { + override fun resumeWith(result: Result) { + callback.onComplete(result.getOrNull(), result.exceptionOrNull()) + } +} \ No newline at end of file From cdf56913545fe1f5c73576c3b3e1939207265283 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 22:31:21 +1300 Subject: [PATCH 489/555] Remove redundant interop throws --- .../src/main/java/io/appwrite/services/ServiceTemplate.kt.twig | 1 - .../src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig | 1 - 2 files changed, 2 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index 69985fffbe..8e7c6dd4a0 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -45,7 +45,6 @@ class {{ service.name | caseUcfirst }} : Service { */ @JvmOverloads - @Throws({{ spec.title | caseUcfirst }}Exception::class) suspend fun {{ method.name | caseCamel }}({% if method.type == "webAuth" %}{{ '\n\t\t' }}activity: ComponentActivity{% if method.parameters.all | length > 0 %}, {% endif %}{% endif %}{{ _self.method_parameters(method.parameters, method.consumes) }}{% if method.parameters.all|length > 0 %}{{ '\n\t' }}{% endif %}){% if method.type != "webAuth" %}: {{ _self.resultType(sdk.namespace, method) }}{% endif %} { val path = "{{ method.path }}"{% for parameter in method.parameters.path %}.replace("{{ '{' ~ parameter.name | caseCamel ~ '}' }}", {{ parameter.name | caseCamel }}){% endfor %} diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index 559444b49c..2ed93d23aa 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -34,7 +34,6 @@ class {{ service.name | caseUcfirst }} : Service { */ @JvmOverloads - @Throws({{ spec.title | caseUcfirst }}Exception::class) suspend fun {{ method.name | caseCamel }}({% if method.type == "webAuth" %}{{ '\n\t\t' }}activity: ComponentActivity{% if method.parameters.all | length > 0 %}, {% endif %}{% endif %}{{ utils.method_parameters(method.parameters, method.consumes) }}{% if method.parameters.all|length > 0 %}{{ '\n\t' }}{% endif %}){% if method.type != "webAuth" %}: {{ utils.resultType(sdk.namespace, method) }}{% endif %} { val path = "{{ method.path }}"{% for parameter in method.parameters.path %}.replace("{{ '{' ~ parameter.name | caseCamel ~ '}' }}", {{ parameter.name | caseCamel }}){% endfor %} From 0e05be34f28d1ab4c8a01a106d1c908f65c01ac1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 22:31:42 +1300 Subject: [PATCH 490/555] Update examples --- .../example_java/MainActivity.java.twig | 47 +++++-------------- .../ui/accounts/AccountsViewModel.kt.twig | 2 +- 2 files changed, 13 insertions(+), 36 deletions(-) diff --git a/templates/android/example-java/src/main/java/io/appwrite/example_java/MainActivity.java.twig b/templates/android/example-java/src/main/java/io/appwrite/example_java/MainActivity.java.twig index 153c93a3f0..dfc0e7fb06 100644 --- a/templates/android/example-java/src/main/java/io/appwrite/example_java/MainActivity.java.twig +++ b/templates/android/example-java/src/main/java/io/appwrite/example_java/MainActivity.java.twig @@ -1,18 +1,13 @@ package io.appwrite.example_java; -import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; -import org.jetbrains.annotations.NotNull; + +import androidx.appcompat.app.AppCompatActivity; + import {{ sdk.namespace | caseDot }}.Client; -import {{ sdk.namespace | caseDot }}.exceptions.{{ spec.title | caseUcfirst }}Exception; -import {{ sdk.namespace | caseDot }}.extensions.JsonExtensionsKt; -import {{ sdk.namespace | caseDot }}.models.Session; +import {{ sdk.namespace | caseDot }}.coroutines.CoroutineCallback; import {{ sdk.namespace | caseDot }}.services.Account; -import kotlin.Result; -import kotlin.coroutines.Continuation; -import kotlin.coroutines.CoroutineContext; -import kotlin.coroutines.EmptyCoroutineContext; public class MainActivity extends AppCompatActivity { @@ -27,31 +22,13 @@ public class MainActivity extends AppCompatActivity { Account account = new Account(client); - try { - account.createSession("test7@test.com","password", new Continuation() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resumeWith(@NotNull Object o) { - try { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - throw failure.exception; - } else { - Session session = (Session) o; - Log.d("RESPONSE", JsonExtensionsKt.toJson(session)); - } - } catch (Throwable th) { - Log.e("ERROR", th.toString()); - } - } - }); - } catch (AppwriteException e) { - e.printStackTrace(); - } + account.createEmailSession("test7@test.com", "password", new CoroutineCallback<>((session, error) -> { + if (error != null) { + Log.e("Appwrite", error.getMessage()); + return; + } + + Log.d("Appwrite", session.toMap().toString()); + })); } } \ No newline at end of file diff --git a/templates/android/example/src/main/java/io/appwrite/android/ui/accounts/AccountsViewModel.kt.twig b/templates/android/example/src/main/java/io/appwrite/android/ui/accounts/AccountsViewModel.kt.twig index e0657edf1d..530f7e7bb2 100644 --- a/templates/android/example/src/main/java/io/appwrite/android/ui/accounts/AccountsViewModel.kt.twig +++ b/templates/android/example/src/main/java/io/appwrite/android/ui/accounts/AccountsViewModel.kt.twig @@ -29,7 +29,7 @@ class AccountsViewModel : ViewModel() { fun onLogin(email: Editable, password: Editable) { viewModelScope.launch { try { - val session = accountService.createSession(email.toString(), password.toString()) + val session = accountService.createEmailSession(email.toString(), password.toString()) _response.postValue(Event(session.toJson())) } catch (e: {{ spec.title | caseUcfirst }}Exception) { _error.postValue(Event(e)) From 4862cc0233e387ef1957a17d76a8027ace18bd8c Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 22:31:55 +1300 Subject: [PATCH 491/555] Add coroutine callback files --- src/SDK/Language/Android.php | 5 +++++ src/SDK/Language/Kotlin.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/SDK/Language/Android.php b/src/SDK/Language/Android.php index 38a48df9ab..df854f8b9a 100644 --- a/src/SDK/Language/Android.php +++ b/src/SDK/Language/Android.php @@ -191,6 +191,11 @@ public function getFiles() 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/cookies/Extensions.kt', 'template' => '/android/library/src/main/java/io/appwrite/cookies/Extensions.kt.twig', ], + [ + 'scope' => 'default', + 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/coroutines/Callback.kt', + 'template' => '/android/library/src/main/java/io/appwrite/coroutines/Callback.kt.twig', + ], [ 'scope' => 'default', 'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/cookies/stores/InMemoryCookieStore.kt', diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index b8035c2f7b..d31eaf7bf9 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -389,6 +389,11 @@ public function getFiles() 'template' => '/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig', 'minify' => false, ], + [ + 'scope' => 'default', + 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/coroutines/Callback.kt', + 'template' => '/android/library/src/main/java/io/appwrite/coroutines/Callback.kt.twig', + ], [ 'scope' => 'default', 'destination' => '/src/main/kotlin/{{ sdk.namespace | caseSlash }}/exceptions/{{spec.title | caseUcfirst}}Exception.kt', From 05217b8cf56d62a1271aa0ea69ba331fc144b6e1 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 21 Oct 2022 11:34:44 +0200 Subject: [PATCH 492/555] Remove change of whitespace --- templates/flutter/example/pubspec.yaml.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/example/pubspec.yaml.twig b/templates/flutter/example/pubspec.yaml.twig index 7dfb28b029..a1ecb3060b 100644 --- a/templates/flutter/example/pubspec.yaml.twig +++ b/templates/flutter/example/pubspec.yaml.twig @@ -1,3 +1,3 @@ name: {{ language.params.packageName }}_example environment: - sdk: '>=2.6.0 <3.0.0' + sdk: '>=2.6.0 <3.0.0' \ No newline at end of file From edd6c4b4a38279d66a0d36b70bdbcf3cea97e157 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 22:53:56 +1300 Subject: [PATCH 493/555] Update docs examples --- templates/android/docs/java/example.md.twig | 57 ++++++--------------- templates/kotlin/docs/java/example.md.twig | 57 ++++++--------------- 2 files changed, 34 insertions(+), 80 deletions(-) diff --git a/templates/android/docs/java/example.md.twig b/templates/android/docs/java/example.md.twig index 1809797b5f..aa6feb482e 100644 --- a/templates/android/docs/java/example.md.twig +++ b/templates/android/docs/java/example.md.twig @@ -1,11 +1,12 @@ {% import 'kotlin/base/utils.twig' as utils %} -import {{ sdk.namespace | caseDot }}.Client +import {{ sdk.namespace | caseDot }}.Client; +import {{ sdk.namespace | caseDot }}.coroutines.CoroutineCallback; {% if method.parameters.all | filter((param) => param.type == 'file') | length > 0 %} -import {{ sdk.namespace | caseDot }}.models.InputFile +import {{ sdk.namespace | caseDot }}.models.InputFile; {% endif %} -import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} +import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }}; -Client client = Client(context) +Client client = new Client(context) {% if method.security|length > 0 %} .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint {% for node in method.security %} @@ -15,24 +16,14 @@ Client client = Client(context) {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client); -{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}new Continuation<{{ utils.resultTypeJava(sdk.namespace, method) }}>() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; +{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}new CoroutineCallback<>((result, error) -> { + if (error != null) + error.printStackTrace(); + return; } - @Override - public void resumeWith(@NotNull Object o) { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - failure.exception.printStackTrace(); - return; - } - - {{ utils.resultTypeJava(sdk.namespace, method) }} response = ({{ utils.resultTypeJava(sdk.namespace, method) }}) o; - } -});{% endif %} + Log.d("Appwrite", result.toString()); +}));{% endif %} {% for parameter in method.parameters.all %} {% if parameter.required %} @@ -40,28 +31,14 @@ Client client = Client(context) {% endif %} {% if loop.last %} - new Continuation<{{ utils.resultTypeJava(sdk.namespace, method) }}>() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; } - @Override - public void resumeWith(@NotNull Object o) { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - failure.exception.printStackTrace(); - return; - } - - {%~ if method.type != 'webAuth' %} - {{ utils.resultTypeJava(sdk.namespace, method) }} response = ({{ utils.resultTypeJava(sdk.namespace, method) }}) o; - {%~ else %} - // Success - {%~ endif %} - } - } + Log.d("Appwrite", result.toString()); + }) ); {% endif %} {% endfor %} \ No newline at end of file diff --git a/templates/kotlin/docs/java/example.md.twig b/templates/kotlin/docs/java/example.md.twig index 1809797b5f..ff3205cbc5 100644 --- a/templates/kotlin/docs/java/example.md.twig +++ b/templates/kotlin/docs/java/example.md.twig @@ -1,11 +1,12 @@ {% import 'kotlin/base/utils.twig' as utils %} -import {{ sdk.namespace | caseDot }}.Client +import {{ sdk.namespace | caseDot }}.Client; +import {{ sdk.namespace | caseDot }}.coroutines.CoroutineCallback; {% if method.parameters.all | filter((param) => param.type == 'file') | length > 0 %} -import {{ sdk.namespace | caseDot }}.models.InputFile +import {{ sdk.namespace | caseDot }}.models.InputFile; {% endif %} -import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} +import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }}; -Client client = Client(context) +Client client = new Client() {% if method.security|length > 0 %} .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint {% for node in method.security %} @@ -15,24 +16,14 @@ Client client = Client(context) {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = new {{ service.name | caseUcfirst }}(client); -{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}new Continuation<{{ utils.resultTypeJava(sdk.namespace, method) }}>() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; +{{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; } - @Override - public void resumeWith(@NotNull Object o) { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - failure.exception.printStackTrace(); - return; - } - - {{ utils.resultTypeJava(sdk.namespace, method) }} response = ({{ utils.resultTypeJava(sdk.namespace, method) }}) o; - } -});{% endif %} + System.out.println(result); +}));{% endif %} {% for parameter in method.parameters.all %} {% if parameter.required %} @@ -40,28 +31,14 @@ Client client = Client(context) {% endif %} {% if loop.last %} - new Continuation<{{ utils.resultTypeJava(sdk.namespace, method) }}>() { - @NotNull - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; } - @Override - public void resumeWith(@NotNull Object o) { - if (o instanceof Result.Failure) { - Result.Failure failure = (Result.Failure) o; - failure.exception.printStackTrace(); - return; - } - - {%~ if method.type != 'webAuth' %} - {{ utils.resultTypeJava(sdk.namespace, method) }} response = ({{ utils.resultTypeJava(sdk.namespace, method) }}) o; - {%~ else %} - // Success - {%~ endif %} - } - } + System.out.println(result); + }) ); {% endif %} {% endfor %} \ No newline at end of file From 8d6b4a46363981ddf0d95f84e2a30cc28094e1b5 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 23:16:58 +1300 Subject: [PATCH 494/555] Allow encoding/decoding `Any` --- .../Extensions/Codable+JSON.swift.twig | 560 +++++++++++++++++- 1 file changed, 559 insertions(+), 1 deletion(-) diff --git a/templates/swift/Sources/Extensions/Codable+JSON.swift.twig b/templates/swift/Sources/Extensions/Codable+JSON.swift.twig index 523eb83555..d9fcd0477e 100644 --- a/templates/swift/Sources/Extensions/Codable+JSON.swift.twig +++ b/templates/swift/Sources/Extensions/Codable+JSON.swift.twig @@ -3,6 +3,8 @@ import Foundation let jsonEncoder = JSONEncoder() let jsonDecoder = JSONDecoder() +// MARK: - Conversions + extension Encodable { func toJson() throws -> String { return String(data: try jsonEncoder.encode(self), encoding: .utf8)! @@ -24,4 +26,560 @@ extension JsonConvert { let string = try (self as Encodable).toJson() return try string.fromJson(to: model) } -} \ No newline at end of file +} + +// MARK: - Codable + +@frozen public struct AnyCodable: Codable { + public let value: Any + + public init(_ value: T?) { + self.value = value ?? () + } +} + +extension AnyCodable: _AnyEncodable, _AnyDecodable {} + +extension AnyCodable: Equatable { + public static func == (lhs: AnyCodable, rhs: AnyCodable) -> Bool { + switch (lhs.value, rhs.value) { + case is (Void, Void): + return true + case let (lhs as Bool, rhs as Bool): + return lhs == rhs + case let (lhs as Int, rhs as Int): + return lhs == rhs + case let (lhs as Int8, rhs as Int8): + return lhs == rhs + case let (lhs as Int16, rhs as Int16): + return lhs == rhs + case let (lhs as Int32, rhs as Int32): + return lhs == rhs + case let (lhs as Int64, rhs as Int64): + return lhs == rhs + case let (lhs as UInt, rhs as UInt): + return lhs == rhs + case let (lhs as UInt8, rhs as UInt8): + return lhs == rhs + case let (lhs as UInt16, rhs as UInt16): + return lhs == rhs + case let (lhs as UInt32, rhs as UInt32): + return lhs == rhs + case let (lhs as UInt64, rhs as UInt64): + return lhs == rhs + case let (lhs as Float, rhs as Float): + return lhs == rhs + case let (lhs as Double, rhs as Double): + return lhs == rhs + case let (lhs as String, rhs as String): + return lhs == rhs + case let (lhs as [String: AnyCodable], rhs as [String: AnyCodable]): + return lhs == rhs + case let (lhs as [AnyCodable], rhs as [AnyCodable]): + return lhs == rhs + case let (lhs as [String: Any], rhs as [String: Any]): + return NSDictionary(dictionary: lhs) == NSDictionary(dictionary: rhs) + case let (lhs as [Any], rhs as [Any]): + return NSArray(array: lhs) == NSArray(array: rhs) + case is (NSNull, NSNull): + return true + default: + return false + } + } +} + +extension AnyCodable: CustomStringConvertible { + public var description: String { + switch value { + case is Void: + return String(describing: nil as Any?) + case let value as CustomStringConvertible: + return value.description + default: + return String(describing: value) + } + } +} + +extension AnyCodable: CustomDebugStringConvertible { + public var debugDescription: String { + switch value { + case let value as CustomDebugStringConvertible: + return "AnyCodable(\(value.debugDescription))" + default: + return "AnyCodable(\(description))" + } + } +} + +extension AnyCodable: ExpressibleByNilLiteral {} +extension AnyCodable: ExpressibleByBooleanLiteral {} +extension AnyCodable: ExpressibleByIntegerLiteral {} +extension AnyCodable: ExpressibleByFloatLiteral {} +extension AnyCodable: ExpressibleByStringLiteral {} +extension AnyCodable: ExpressibleByArrayLiteral {} +extension AnyCodable: ExpressibleByDictionaryLiteral {} + + +extension AnyCodable: Hashable { + public func hash(into hasher: inout Hasher) { + switch value { + case let value as Bool: + hasher.combine(value) + case let value as Int: + hasher.combine(value) + case let value as Int8: + hasher.combine(value) + case let value as Int16: + hasher.combine(value) + case let value as Int32: + hasher.combine(value) + case let value as Int64: + hasher.combine(value) + case let value as UInt: + hasher.combine(value) + case let value as UInt8: + hasher.combine(value) + case let value as UInt16: + hasher.combine(value) + case let value as UInt32: + hasher.combine(value) + case let value as UInt64: + hasher.combine(value) + case let value as Float: + hasher.combine(value) + case let value as Double: + hasher.combine(value) + case let value as String: + hasher.combine(value) + case let value as [String: AnyCodable]: + hasher.combine(value) + case let value as [AnyCodable]: + hasher.combine(value) + default: + break + } + } +} + +// MARK: - Decodable + +@frozen public struct AnyDecodable: Decodable { + public let value: Any + + public init(_ value: T?) { + self.value = value ?? () + } +} + +@usableFromInline +protocol _AnyDecodable { + var value: Any { get } + init(_ value: T?) +} + +extension AnyDecodable: _AnyDecodable {} + +extension _AnyDecodable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + + if container.decodeNil() { + #if canImport(Foundation) + self.init(NSNull()) + #else + self.init(Optional.none) + #endif + } else if let bool = try? container.decode(Bool.self) { + self.init(bool) + } else if let int = try? container.decode(Int.self) { + self.init(int) + } else if let uint = try? container.decode(UInt.self) { + self.init(uint) + } else if let double = try? container.decode(Double.self) { + self.init(double) + } else if let string = try? container.decode(String.self) { + self.init(string) + } else if let array = try? container.decode([AnyDecodable].self) { + self.init(array.map { $0.value }) + } else if let dictionary = try? container.decode([String: AnyDecodable].self) { + self.init(dictionary.mapValues { $0.value }) + } else { + throw DecodingError.dataCorruptedError(in: container, debugDescription: "AnyDecodable value cannot be decoded") + } + } +} + +extension AnyDecodable: Equatable { + public static func == (lhs: AnyDecodable, rhs: AnyDecodable) -> Bool { + switch (lhs.value, rhs.value) { +#if canImport(Foundation) + case is (NSNull, NSNull), is (Void, Void): + return true +#endif + case let (lhs as Bool, rhs as Bool): + return lhs == rhs + case let (lhs as Int, rhs as Int): + return lhs == rhs + case let (lhs as Int8, rhs as Int8): + return lhs == rhs + case let (lhs as Int16, rhs as Int16): + return lhs == rhs + case let (lhs as Int32, rhs as Int32): + return lhs == rhs + case let (lhs as Int64, rhs as Int64): + return lhs == rhs + case let (lhs as UInt, rhs as UInt): + return lhs == rhs + case let (lhs as UInt8, rhs as UInt8): + return lhs == rhs + case let (lhs as UInt16, rhs as UInt16): + return lhs == rhs + case let (lhs as UInt32, rhs as UInt32): + return lhs == rhs + case let (lhs as UInt64, rhs as UInt64): + return lhs == rhs + case let (lhs as Float, rhs as Float): + return lhs == rhs + case let (lhs as Double, rhs as Double): + return lhs == rhs + case let (lhs as String, rhs as String): + return lhs == rhs + case let (lhs as [String: AnyDecodable], rhs as [String: AnyDecodable]): + return lhs == rhs + case let (lhs as [AnyDecodable], rhs as [AnyDecodable]): + return lhs == rhs + default: + return false + } + } +} + +extension AnyDecodable: CustomStringConvertible { + public var description: String { + switch value { + case is Void: + return String(describing: nil as Any?) + case let value as CustomStringConvertible: + return value.description + default: + return String(describing: value) + } + } +} + +extension AnyDecodable: CustomDebugStringConvertible { + public var debugDescription: String { + switch value { + case let value as CustomDebugStringConvertible: + return "AnyDecodable(\(value.debugDescription))" + default: + return "AnyDecodable(\(description))" + } + } +} + +extension AnyDecodable: Hashable { + public func hash(into hasher: inout Hasher) { + switch value { + case let value as Bool: + hasher.combine(value) + case let value as Int: + hasher.combine(value) + case let value as Int8: + hasher.combine(value) + case let value as Int16: + hasher.combine(value) + case let value as Int32: + hasher.combine(value) + case let value as Int64: + hasher.combine(value) + case let value as UInt: + hasher.combine(value) + case let value as UInt8: + hasher.combine(value) + case let value as UInt16: + hasher.combine(value) + case let value as UInt32: + hasher.combine(value) + case let value as UInt64: + hasher.combine(value) + case let value as Float: + hasher.combine(value) + case let value as Double: + hasher.combine(value) + case let value as String: + hasher.combine(value) + case let value as [String: AnyDecodable]: + hasher.combine(value) + case let value as [AnyDecodable]: + hasher.combine(value) + default: + break + } + } +} + +// MARK: - Encodable + +@frozen public struct AnyEncodable: Encodable { + public let value: Any + + public init(_ value: T?) { + self.value = value ?? () + } +} + +@usableFromInline +protocol _AnyEncodable { + var value: Any { get } + init(_ value: T?) +} + +extension AnyEncodable: _AnyEncodable {} + +// MARK: - Encodable + +extension _AnyEncodable { + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + + switch value { + #if canImport(Foundation) + case is NSNull: + try container.encodeNil() + #endif + case is Void: + try container.encodeNil() + case let bool as Bool: + try container.encode(bool) + case let int as Int: + try container.encode(int) + case let int8 as Int8: + try container.encode(int8) + case let int16 as Int16: + try container.encode(int16) + case let int32 as Int32: + try container.encode(int32) + case let int64 as Int64: + try container.encode(int64) + case let uint as UInt: + try container.encode(uint) + case let uint8 as UInt8: + try container.encode(uint8) + case let uint16 as UInt16: + try container.encode(uint16) + case let uint32 as UInt32: + try container.encode(uint32) + case let uint64 as UInt64: + try container.encode(uint64) + case let float as Float: + try container.encode(float) + case let double as Double: + try container.encode(double) + case let string as String: + try container.encode(string) + #if canImport(Foundation) + case let number as NSNumber: + try encode(nsnumber: number, into: &container) + case let date as Date: + try container.encode(date) + case let url as URL: + try container.encode(url) + #endif + case let array as [Any?]: + try container.encode(array.map { AnyEncodable($0) }) + case let dictionary as [String: Any?]: + try container.encode(dictionary.mapValues { AnyEncodable($0) }) + case let encodable as Encodable: + try encodable.encode(to: encoder) + default: + let context = EncodingError.Context(codingPath: container.codingPath, debugDescription: "AnyEncodable value cannot be encoded") + throw EncodingError.invalidValue(value, context) + } + } + + #if canImport(Foundation) + private func encode(nsnumber: NSNumber, into container: inout SingleValueEncodingContainer) throws { + switch Character(Unicode.Scalar(UInt8(nsnumber.objCType.pointee))) { + case "B": + try container.encode(nsnumber.boolValue) + case "c": + try container.encode(nsnumber.int8Value) + case "s": + try container.encode(nsnumber.int16Value) + case "i", "l": + try container.encode(nsnumber.int32Value) + case "q": + try container.encode(nsnumber.int64Value) + case "C": + try container.encode(nsnumber.uint8Value) + case "S": + try container.encode(nsnumber.uint16Value) + case "I", "L": + try container.encode(nsnumber.uint32Value) + case "Q": + try container.encode(nsnumber.uint64Value) + case "f": + try container.encode(nsnumber.floatValue) + case "d": + try container.encode(nsnumber.doubleValue) + default: + let context = EncodingError.Context(codingPath: container.codingPath, debugDescription: "NSNumber cannot be encoded because its type is not handled") + throw EncodingError.invalidValue(nsnumber, context) + } + } + #endif +} + +extension AnyEncodable: Equatable { + public static func == (lhs: AnyEncodable, rhs: AnyEncodable) -> Bool { + switch (lhs.value, rhs.value) { + case is (Void, Void): + return true + case let (lhs as Bool, rhs as Bool): + return lhs == rhs + case let (lhs as Int, rhs as Int): + return lhs == rhs + case let (lhs as Int8, rhs as Int8): + return lhs == rhs + case let (lhs as Int16, rhs as Int16): + return lhs == rhs + case let (lhs as Int32, rhs as Int32): + return lhs == rhs + case let (lhs as Int64, rhs as Int64): + return lhs == rhs + case let (lhs as UInt, rhs as UInt): + return lhs == rhs + case let (lhs as UInt8, rhs as UInt8): + return lhs == rhs + case let (lhs as UInt16, rhs as UInt16): + return lhs == rhs + case let (lhs as UInt32, rhs as UInt32): + return lhs == rhs + case let (lhs as UInt64, rhs as UInt64): + return lhs == rhs + case let (lhs as Float, rhs as Float): + return lhs == rhs + case let (lhs as Double, rhs as Double): + return lhs == rhs + case let (lhs as String, rhs as String): + return lhs == rhs + case let (lhs as [String: AnyEncodable], rhs as [String: AnyEncodable]): + return lhs == rhs + case let (lhs as [AnyEncodable], rhs as [AnyEncodable]): + return lhs == rhs + default: + return false + } + } +} + +extension AnyEncodable: CustomStringConvertible { + public var description: String { + switch value { + case is Void: + return String(describing: nil as Any?) + case let value as CustomStringConvertible: + return value.description + default: + return String(describing: value) + } + } +} + +extension AnyEncodable: CustomDebugStringConvertible { + public var debugDescription: String { + switch value { + case let value as CustomDebugStringConvertible: + return "AnyEncodable(\(value.debugDescription))" + default: + return "AnyEncodable(\(description))" + } + } +} + +extension AnyEncodable: ExpressibleByNilLiteral {} +extension AnyEncodable: ExpressibleByBooleanLiteral {} +extension AnyEncodable: ExpressibleByIntegerLiteral {} +extension AnyEncodable: ExpressibleByFloatLiteral {} +extension AnyEncodable: ExpressibleByStringLiteral {} +extension AnyEncodable: ExpressibleByStringInterpolation {} +extension AnyEncodable: ExpressibleByArrayLiteral {} +extension AnyEncodable: ExpressibleByDictionaryLiteral {} + +extension _AnyEncodable { + public init(nilLiteral _: ()) { + self.init(nil as Any?) + } + + public init(booleanLiteral value: Bool) { + self.init(value) + } + + public init(integerLiteral value: Int) { + self.init(value) + } + + public init(floatLiteral value: Double) { + self.init(value) + } + + public init(extendedGraphemeClusterLiteral value: String) { + self.init(value) + } + + public init(stringLiteral value: String) { + self.init(value) + } + + public init(arrayLiteral elements: Any...) { + self.init(elements) + } + + public init(dictionaryLiteral elements: (AnyHashable, Any)...) { + self.init([AnyHashable: Any](elements, uniquingKeysWith: { first, _ in first })) + } +} + +extension AnyEncodable: Hashable { + public func hash(into hasher: inout Hasher) { + switch value { + case let value as Bool: + hasher.combine(value) + case let value as Int: + hasher.combine(value) + case let value as Int8: + hasher.combine(value) + case let value as Int16: + hasher.combine(value) + case let value as Int32: + hasher.combine(value) + case let value as Int64: + hasher.combine(value) + case let value as UInt: + hasher.combine(value) + case let value as UInt8: + hasher.combine(value) + case let value as UInt16: + hasher.combine(value) + case let value as UInt32: + hasher.combine(value) + case let value as UInt64: + hasher.combine(value) + case let value as Float: + hasher.combine(value) + case let value as Double: + hasher.combine(value) + case let value as String: + hasher.combine(value) + case let value as [String: AnyEncodable]: + hasher.combine(value) + case let value as [AnyEncodable]: + hasher.combine(value) + default: + break + } + } +} From a0a0c55c91b22d93d30c5489cc03347e53a28723 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 23:18:45 +1300 Subject: [PATCH 495/555] Add default overload for generic service methods --- .../swift/Sources/Models/Model.swift.twig | 2 +- .../swift/Sources/Services/Service.swift.twig | 89 +++++++++---------- templates/swift/base/params.twig | 12 +-- 3 files changed, 47 insertions(+), 56 deletions(-) diff --git a/templates/swift/Sources/Models/Model.swift.twig b/templates/swift/Sources/Models/Model.swift.twig index f98f4f29e4..31029c5e1c 100644 --- a/templates/swift/Sources/Models/Model.swift.twig +++ b/templates/swift/Sources/Models/Model.swift.twig @@ -14,7 +14,7 @@ public class {{ definition | modelType(spec) | raw }} { {%~ endfor %} {%~ if definition.additionalProperties %} /// Additional properties - let data: T + public let data: T {%~ endif %} init( diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index f04b863550..e6e6cf84d9 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -5,12 +5,13 @@ import {{spec.title | caseUcfirst}}Models /// {{ service.description }} open class {{ service.name | caseUcfirst }}: Service { + {%~ for method in service.methods %} /// /// {{ method.title }} /// {%~ if method.description %} - {{ method.description | swiftComment }} + {{~ method.description | swiftComment }} /// {%~ endif %} {%~ for parameter in method.parameters.all %} @@ -49,6 +50,7 @@ open class {{ service.name | caseUcfirst }}: Service { {%~ endfor %} ] {%~ endif %} + {%~ if method.responseModel %} let converter: ([String: Any]) -> {{ method | returnType(spec) | raw }} = { dict in {%~ if method.responseModel == 'any' %} @@ -57,6 +59,7 @@ open class {{ service.name | caseUcfirst }}: Service { return {{ spec.title | caseUcfirst}}Models.{{method.responseModel | caseUcfirst}}.from(map: dict) {%~ endif %} } + {%~ endif %} {%~ if 'multipart/form-data' in method.consumes %} {{~ include('swift/base/requests/file.twig') }} @@ -65,53 +68,45 @@ open class {{ service.name | caseUcfirst }}: Service { {%~ endif %} {%~ endif %} } + {%~ if method.responseModel | hasGenericType(spec) %} -{% endfor %} + /// + /// {{ method.title }} + /// + {%~ if method.description %} + {{~ method.description | swiftComment }} + /// + {%~ endif %} + {%~ for parameter in method.parameters.all %} + /// @param {{ parameter | typeName | raw}} {{ parameter.name | caseCamel }} + {%~ endfor %} + /// @throws Exception + /// @return array + /// + {%~ if method.type == "webAuth" %} + @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) + {%~ endif %} + open func {{ method.name | caseCamel }}( + {%~ for parameter in method.parameters.all %} + {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} -{#{% for method in service.methods %}#} -{# ///#} -{# /// {{ method.title }}#} -{# ///#} -{#{% if method.description %}#} -{#{{ method.description | swiftComment }}#} -{# ///#} -{#{% endif %}#} -{#{% for parameter in method.parameters.all %}#} -{# /// @param {{ parameter | typeName | raw}} {{ parameter.name | caseCamel }}#} -{#{% endfor %}#} -{# /// @throws Exception#} -{# /// @return array#} -{# ///#} -{# @available(*, deprecated, message: "Use the async overload instead")#} -{#{% if method.type == "webAuth" %}#} -{# @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *)#} -{#{% endif %}#} -{# open func {{ method.name | caseCamel }}(#} -{#{% for parameter in method.parameters.all %}#} -{# {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | raw }}{% if not parameter.required %}? = nil{% endif %},#} -{#{% endfor %}#} -{#{% if 'multipart/form-data' in method.consumes %}#} -{# onProgress: ((UploadProgress) -> Void)? = nil,#} -{#{% endif %}#} -{# completion: ((Result<{{ _self.resultType(spec, method) }}, {{ spec.title | caseUcfirst}}Error>) -> Void)? = nil#} -{# ) {#} -{# Task {#} -{# do {#} -{# let result = try await {{ method.name | caseCamel }}(#} -{#{% for parameter in method.parameters.all %}#} -{# {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %}#} + {%~ endfor %} + {%~ if 'multipart/form-data' in method.consumes %} + onProgress: ((UploadProgress) -> Void)? = nil + {%~ endif %} + ) async throws -> {{ method | returnType(spec, '[String: AnyCodable]') | raw }} { + return try await {{ method.name | caseCamel }}( + {%~ for parameter in method.parameters.all %} + {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %},{% endif %} -{#{% endfor %}#} -{#{% if 'multipart/form-data' in method.consumes %}#} -{# onProgress: onProgress#} -{#{% endif %}#} -{# )#} -{# completion?(.success(result))#} -{# } catch {#} -{# completion?(.failure(error as! {{ spec.title | caseUcfirst}}Error))#} -{# }#} -{# }#} -{# }#} + {%~ endfor %} + {%~ if 'multipart/form-data' in method.consumes %} + onProgress: onProgress + {%~ endif %} + ) + } + {%~ endif %} + +{% endfor %} -{#{% endfor %}#} -} +} \ No newline at end of file diff --git a/templates/swift/base/params.twig b/templates/swift/base/params.twig index dbace25c3c..989586db3d 100644 --- a/templates/swift/base/params.twig +++ b/templates/swift/base/params.twig @@ -1,12 +1,8 @@ - {% if method.parameters.path -%} var - {%- else -%} let - {%- endif %} path: String = "{{ method.path }}" + let path: String = "{{ method.path }}" {%~ for parameter in method.parameters.path %} - path = path.replacingOccurrences( - of: "{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}", - with: {{ parameter.name | caseCamel | escapeKeyword }} - ) + .replacingOccurrences(of: "{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}", with: {{ parameter.name | caseCamel | escapeKeyword }}) {%~ endfor %} + {%~ if method.parameters.query | merge(method.parameters.body) | length <= 0 %} let params: [String: Any] = [:] {%~ else %} @@ -18,4 +14,4 @@ {%~ endfor %} ] - {%- endif %} \ No newline at end of file + {%~ endif %} From 593c446508b8bda749b1cb9c2dd51e9f5fe54c62 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 23:28:56 +1300 Subject: [PATCH 496/555] Disable flutter beta test (cherry picked from commit 17fed89f8da7e28c06b917f0e4f1816cf0276dea) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 99e74d2508..4bc9da50a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ env: - SDK=FlutterStable - SDK=Go112 - SDK=Go118 - - SDK=FlutterBeta +# - SDK=FlutterBeta - SDK=KotlinJava8 - SDK=KotlinJava11 - SDK=KotlinJava17 From cff282204c92f78a7d0c6ac7ba55a2ed282a2a8f Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 23:28:56 +1300 Subject: [PATCH 497/555] Disable flutter beta test (cherry picked from commit 17fed89f8da7e28c06b917f0e4f1816cf0276dea) (cherry picked from commit 593c446508b8bda749b1cb9c2dd51e9f5fe54c62) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1913bb1957..d623f15159 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ env: - SDK=FlutterStable - SDK=Go112 - SDK=Go118 - - SDK=FlutterBeta +# - SDK=FlutterBeta - SDK=KotlinJava8 - SDK=KotlinJava11 - SDK=KotlinJava17 From e5555523542da3c1c813b41d675fe3da82d6dc63 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 23:28:56 +1300 Subject: [PATCH 498/555] Disable flutter beta test (cherry picked from commit 17fed89f8da7e28c06b917f0e4f1816cf0276dea) (cherry picked from commit 593c446508b8bda749b1cb9c2dd51e9f5fe54c62) (cherry picked from commit cff282204c92f78a7d0c6ac7ba55a2ed282a2a8f) (cherry picked from commit e156fba4c890333598a202bad545780e273a98f1) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index beb3b3019d..60f3afc037 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ env: - SDK=FlutterStable - SDK=Go112 - SDK=Go118 - - SDK=FlutterBeta +# - SDK=FlutterBeta - SDK=KotlinJava8 - SDK=KotlinJava11 - SDK=KotlinJava17 From 104a6e425981015405467276186ab03e5f8a34b5 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Oct 2022 23:28:56 +1300 Subject: [PATCH 499/555] Disable flutter beta test (cherry picked from commit 17fed89f8da7e28c06b917f0e4f1816cf0276dea) (cherry picked from commit 593c446508b8bda749b1cb9c2dd51e9f5fe54c62) (cherry picked from commit cff282204c92f78a7d0c6ac7ba55a2ed282a2a8f) (cherry picked from commit e156fba4c890333598a202bad545780e273a98f1) (cherry picked from commit e5555523542da3c1c813b41d675fe3da82d6dc63) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 99e74d2508..4bc9da50a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ env: - SDK=FlutterStable - SDK=Go112 - SDK=Go118 - - SDK=FlutterBeta +# - SDK=FlutterBeta - SDK=KotlinJava8 - SDK=KotlinJava11 - SDK=KotlinJava17 From 8e029b12df5afe27b657756b4b34636ab70949cc Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 25 Oct 2022 11:54:18 +1300 Subject: [PATCH 500/555] Lint --- src/SDK/Language/Kotlin.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index e90437965f..afc9498e06 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -443,9 +443,11 @@ protected function getReturnType(array $method, array $spec, string $namespace, return 'ByteArray'; } - if (!\array_key_exists('responseModel', $method) + if ( + !\array_key_exists('responseModel', $method) || empty($method['responseModel']) - || $method['responseModel'] === 'any') { + || $method['responseModel'] === 'any' + ) { return 'Any'; } From ac39bc7bcd144b85d8ae11a7a5785388fc2d392e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 25 Oct 2022 11:54:39 +1300 Subject: [PATCH 501/555] Lint --- src/SDK/Language/Apple.php | 4 ++-- src/SDK/Language/Swift.php | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/SDK/Language/Apple.php b/src/SDK/Language/Apple.php index 3f4a3769e0..7bbffae320 100644 --- a/src/SDK/Language/Apple.php +++ b/src/SDK/Language/Apple.php @@ -2,8 +2,8 @@ namespace Appwrite\SDK\Language; -class Apple extends Swift { - +class Apple extends Swift +{ /** * @return string */ diff --git a/src/SDK/Language/Swift.php b/src/SDK/Language/Swift.php index c30ae0b712..159238d19c 100644 --- a/src/SDK/Language/Swift.php +++ b/src/SDK/Language/Swift.php @@ -458,9 +458,11 @@ protected function getReturnType(array $method, array $spec, string $generic): s return 'ByteBuffer'; } - if (!\array_key_exists('responseModel', $method) + if ( + !\array_key_exists('responseModel', $method) || empty($method['responseModel']) - || $method['responseModel'] === 'any') { + || $method['responseModel'] === 'any' + ) { return 'Any'; } From 492dc72f39f012a8f1cec291deb0ef873b5ceb69 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 25 Oct 2022 12:01:54 +1300 Subject: [PATCH 502/555] Lint --- src/SDK/Language/GraphQL.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/SDK/Language/GraphQL.php b/src/SDK/Language/GraphQL.php index 8e1d9d3b99..0db720576a 100644 --- a/src/SDK/Language/GraphQL.php +++ b/src/SDK/Language/GraphQL.php @@ -4,8 +4,8 @@ use Appwrite\SDK\Language; -class GraphQL extends Language { - +class GraphQL extends Language +{ /** * @return string */ @@ -86,13 +86,13 @@ public function getParamDefault(array $param): string $default = $param['default'] ?? ''; $required = $param['required'] ?? ''; - if($required) { + if ($required) { return ''; } $output = ''; - if(empty($default) && $default !== 0 && $default !== false) { + if (empty($default) && $default !== 0 && $default !== false) { switch ($type) { case self::TYPE_OBJECT: $output .= '{}'; @@ -111,8 +111,7 @@ public function getParamDefault(array $param): string $output .= '""'; break; } - } - else { + } else { switch ($type) { case self::TYPE_OBJECT: case self::TYPE_NUMBER: @@ -124,7 +123,7 @@ public function getParamDefault(array $param): string $output .= ($default) ? 'true' : 'false'; break; case self::TYPE_STRING: - $output .= '"'.$default .'"'; + $output .= '"' . $default . '"'; break; } } @@ -143,7 +142,7 @@ public function getParamExample(array $param): string $output = ''; - if(empty($example) && $example !== 0 && $example !== false) { + if (empty($example) && $example !== 0 && $example !== false) { switch ($type) { case self::TYPE_FILE: $output .= 'null'; @@ -165,8 +164,7 @@ public function getParamExample(array $param): string $output .= '[]'; break; } - } - else { + } else { switch ($type) { case self::TYPE_FILE: case self::TYPE_NUMBER: @@ -205,4 +203,3 @@ public function getFiles(): array ]; } } - From 67c7a998e0582d6840e853f178e7e5669eeb5dd9 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Fri, 14 Oct 2022 16:46:45 +0000 Subject: [PATCH 503/555] Remove specs since they're in the appwrite repo --- specs/swagger-appwrite-0.12.1-console.json | 1 - specs/swagger-appwrite-0.13.0.json | 1 - specs/swagger-appwrite.0.10.0.json | 1 - specs/swagger-appwrite.0.11.0.json | 1 - specs/swagger-appwrite.0.12.0.json | 1 - specs/swagger-appwrite.0.7.0.json | 1 - specs/swagger-appwrite.0.8.0.json | 1 - specs/swagger2-latest-console.json | 1 - 8 files changed, 8 deletions(-) delete mode 100644 specs/swagger-appwrite-0.12.1-console.json delete mode 100644 specs/swagger-appwrite-0.13.0.json delete mode 100644 specs/swagger-appwrite.0.10.0.json delete mode 100644 specs/swagger-appwrite.0.11.0.json delete mode 100644 specs/swagger-appwrite.0.12.0.json delete mode 100644 specs/swagger-appwrite.0.7.0.json delete mode 100644 specs/swagger-appwrite.0.8.0.json delete mode 100644 specs/swagger2-latest-console.json diff --git a/specs/swagger-appwrite-0.12.1-console.json b/specs/swagger-appwrite-0.12.1-console.json deleted file mode 100644 index a56b0ef374..0000000000 --- a/specs/swagger-appwrite-0.12.1-console.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"version":"0.12.1","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":"HOSTNAME","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":46,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete 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":55,"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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":53,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":45,"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:{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":49,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":51,"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":52,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 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":47,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":54,"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":{},"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":58,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":59,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":48,"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 at least 8 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":57,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":44,"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\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":42,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":43,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"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, yammer, 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":"","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":"","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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":50,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"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":56,"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 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":60,"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},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":61,"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 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":63,"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":62,"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":66,"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":64,"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":65,"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":68,"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":67,"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":70,"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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":69,"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":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[COLLECTION_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/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":71,"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 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":75,"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 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]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name","permission"]}}]},"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":76,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databaseListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":85,"cookies":false,"type":"","demo":"database\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databaseCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a boolean attribute.\n","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":84,"cookies":false,"type":"","demo":"database\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databaseCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an email attribute.\n","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":78,"cookies":false,"type":"","demo":"database\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databaseCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":79,"cookies":false,"type":"","demo":"database\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databaseCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":83,"cookies":false,"type":"","demo":"database\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"string","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"string","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databaseCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":82,"cookies":false,"type":"","demo":"database\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databaseCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create IP address attribute.\n","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":80,"cookies":false,"type":"","demo":"database\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databaseCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a string attribute.\n","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":77,"cookies":false,"type":"","demo":"database\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databaseCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a URL attribute.\n","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":81,"cookies":false,"type":"","demo":"database\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databaseGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":86,"cookies":false,"type":"","demo":"database\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databaseDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":87,"cookies":false,"type":"","demo":"database\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","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":93,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"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":92,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","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":94,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"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":96,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":{},"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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":97,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databaseListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the document activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":95,"cookies":false,"type":"","demo":"database\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databaseListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":89,"cookies":false,"type":"","demo":"database\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databaseCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":88,"cookies":false,"type":"","demo":"database\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/database\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databaseGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":90,"cookies":false,"type":"","demo":"database\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databaseDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":91,"cookies":false,"type":"","demo":"database\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/database\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databaseListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":74,"cookies":false,"type":"","demo":"database\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databaseGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getUsage","weight":72,"cookies":false,"type":"","demo":"database\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/database\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databaseGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":73,"cookies":false,"type":"","demo":"database\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_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":186,"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":"Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":185,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[FUNCTION_ID]"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","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":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List the currently active function runtimes.","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active in your project.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":187,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":188,"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 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":190,"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 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](https:\/\/appwrite.io\/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 that will be passed to the function as environment variables.","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":"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":192,"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 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":198,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":197,"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 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":199,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/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":191,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"tag":{"type":"string","description":"Tag 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":194,"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 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":"Maximum number of tags to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the tag used as the starting point for the query, excluding the tag itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":193,"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 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":195,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag 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":196,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag 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":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":189,"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 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":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":105,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":116,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":108,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":107,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":113,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":114,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":111,"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\/usage":{"get":{"summary":"Get Usage Queue","operationId":"healthGetQueueUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueUsage","weight":112,"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":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":110,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":115,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":109,"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":98,"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":102,"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":99,"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":100,"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":101,"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":103,"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":104,"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":119,"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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":118,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[PROJECT_ID]"},"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":["projectId","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":120,"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":122,"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":127,"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 at least 8 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":125,"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":"integer","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":126,"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,magic-url,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":144,"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":143,"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":145,"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":147,"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":146,"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":134,"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":133,"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":135,"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":136,"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":137,"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":124,"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":139,"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":138,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":"[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":140,"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":141,"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":142,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":123,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":121,"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":129,"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":128,"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":130,"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":131,"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":132,"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":149,"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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":148,"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":"fileId","description":"File ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"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](https:\/\/appwrite.io\/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](https:\/\/appwrite.io\/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":150,"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 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":154,"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 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](https:\/\/appwrite.io\/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](https:\/\/appwrite.io\/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":155,"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 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":152,"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 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":151,"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 ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","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":153,"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 ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":156,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":157,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":159,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":158,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":160,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":161,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":162,"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 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":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":164,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":163,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":165,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":166,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). 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":168,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":167,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":170,"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":"Maximum number of users to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":169,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":184,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":171,"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 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":183,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":179,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":174,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":177,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":178,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/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":172,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"usersUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":180,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":173,"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 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":182,"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 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":181,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":175,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateVerification","weight":176,"cookies":false,"type":"","demo":"users\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}}},"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":{"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["sum","collections"]},"indexList":{"description":"Indexes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["sum","indexes"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["sum","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["sum","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["sum","runtimes"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["sum","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["sum","metrics"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$read","$write","name","enabled","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["sum","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"integer","description":"Attribute size.","x-example":128,"format":"int32"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":"primary"},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"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","$read","$write","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"},"execute":{"type":"string","description":"Execution permissions.","x-example":"role:member"},"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"},"runtime":{"type":"string","description":"Function execution runtime.","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","execute","name","dateCreated","dateUpdated","status","runtime","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"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"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"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. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$read","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"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerVkAppid":{"type":"string","description":"VK OAuth app ID.","x-example":"123247283472834787438"},"providerVkSecret":{"type":"string","description":"VK OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYammerAppid":{"type":"string","description":"Yammer OAuth app ID.","x-example":"123247283472834787438"},"providerYammerSecret":{"type":"string","description":"Yammer OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabase":{"type":"boolean","description":"Database service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDiscordAppid","providerDiscordSecret","providerDropboxAppid","providerDropboxSecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerVkAppid","providerVkSecret","providerYahooAppid","providerYahooSecret","providerYammerAppid","providerYammerSecret","providerYandexAppid","providerYandexSecret","providerWordpressAppid","providerWordpressSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabase","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"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"]},"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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"files":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","storage","files"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"functionsExecutions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsFailures":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsCompute":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","functionsExecutions","functionsFailures","functionsCompute"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","functions","documents","collections","users","storage"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file diff --git a/specs/swagger-appwrite-0.13.0.json b/specs/swagger-appwrite-0.13.0.json deleted file mode 100644 index c26280a513..0000000000 --- a/specs/swagger-appwrite-0.13.0.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"version":"0.12.3","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":"HOSTNAME","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":47,"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":37,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete 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":56,"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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":54,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":46,"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:{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":50,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":52,"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":53,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 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":48,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":55,"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":{},"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":60,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":61,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":49,"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":38,"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 at least 8 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":59,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":45,"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\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":43,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":44,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":39,"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, notion, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, yahoo, yammer, yandex, wordpress, stripe.","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":"","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":"","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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":51,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":58,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":57,"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 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":62,"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},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":63,"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 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":65,"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":64,"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":68,"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":66,"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":67,"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":70,"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":69,"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":72,"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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":71,"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":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[COLLECTION_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/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":73,"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 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":77,"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 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]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name","permission"]}}]},"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":78,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databaseListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":87,"cookies":false,"type":"","demo":"database\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databaseCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a boolean attribute.\n","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":86,"cookies":false,"type":"","demo":"database\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databaseCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an email attribute.\n","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":80,"cookies":false,"type":"","demo":"database\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databaseCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":81,"cookies":false,"type":"","demo":"database\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databaseCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":85,"cookies":false,"type":"","demo":"database\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"number","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"number","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databaseCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":84,"cookies":false,"type":"","demo":"database\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databaseCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create IP address attribute.\n","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":82,"cookies":false,"type":"","demo":"database\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databaseCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a string attribute.\n","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":79,"cookies":false,"type":"","demo":"database\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databaseCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a URL attribute.\n","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":83,"cookies":false,"type":"","demo":"database\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databaseGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":88,"cookies":false,"type":"","demo":"database\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databaseDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":89,"cookies":false,"type":"","demo":"database\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","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":95,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"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":94,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","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":96,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"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":98,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":{},"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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":99,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databaseListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the document activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":97,"cookies":false,"type":"","demo":"database\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databaseListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":91,"cookies":false,"type":"","demo":"database\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databaseCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":90,"cookies":false,"type":"","demo":"database\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/database\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databaseGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":92,"cookies":false,"type":"","demo":"database\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databaseDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":93,"cookies":false,"type":"","demo":"database\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/database\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databaseListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":76,"cookies":false,"type":"","demo":"database\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databaseGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getUsage","weight":74,"cookies":false,"type":"","demo":"database\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/database\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databaseGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":75,"cookies":false,"type":"","demo":"database\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_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":193,"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":"Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":192,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[FUNCTION_ID]"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","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":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List the currently active function runtimes.","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active in your project.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":194,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":195,"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 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":197,"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 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](https:\/\/appwrite.io\/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 that will be passed to the function as environment variables.","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":"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":199,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments":{"get":{"summary":"List Deployments","operationId":"functionsListDeployments","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code deployments. You can use the query params to filter your results.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"listDeployments","weight":201,"cookies":false,"type":"","demo":"functions\/list-deployments.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-deployments.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 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":"Maximum number of deployments to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 Deployment","operationId":"functionsCreateDeployment","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"createDeployment","weight":200,"cookies":false,"type":"","demo":"functions\/create-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"entrypoint","description":"Entrypoint File.","required":true,"type":"string","x-example":"[ENTRYPOINT]","in":"formData"},{"name":"code","description":"Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.","required":true,"type":"file","in":"formData"},{"name":"activate","description":"Automatically activate the deployment when it is finished building.","required":true,"type":"boolean","x-example":false,"in":"formData"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}":{"get":{"summary":"Get Deployment","operationId":"functionsGetDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code deployment by its unique ID.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"getDeployment","weight":202,"cookies":false,"type":"","demo":"functions\/get-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"patch":{"summary":"Update Function Deployment","operationId":"functionsUpdateDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateDeployment","weight":198,"cookies":false,"type":"","demo":"functions\/update-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"delete":{"summary":"Delete Deployment","operationId":"functionsDeleteDeployment","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code deployment by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDeployment","weight":203,"cookies":false,"type":"","demo":"functions\/delete-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":207,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":205,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":204,"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 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]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":206,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":196,"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 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":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":107,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":118,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":110,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":109,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":115,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":116,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":113,"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\/usage":{"get":{"summary":"Get Usage Queue","operationId":"healthGetQueueUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueUsage","weight":114,"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":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":112,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":117,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":111,"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":100,"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":104,"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":101,"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":102,"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":103,"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":105,"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":106,"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":121,"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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":120,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[PROJECT_ID]"},"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":["projectId","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":122,"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":124,"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":129,"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 at least 8 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":127,"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":"integer","description":"Set the max number of users allowed in this project. Use 0 for unlimited.","default":null,"x-example":0}},"required":["limit"]}}]}},"\/projects\/{projectId}\/auth\/{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":128,"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,magic-url,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":146,"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":145,"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":147,"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":149,"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":148,"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":136,"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":135,"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":137,"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":138,"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":139,"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":126,"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":141,"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":140,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":"[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":142,"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":143,"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":144,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":125,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":123,"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":131,"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":130,"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":132,"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":133,"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":134,"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\/buckets":{"get":{"summary":"List buckets","operationId":"storageListBuckets","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the storage buckets. You can use the query params to filter your results.","responses":{"200":{"description":"Buckets List","schema":{"$ref":"#\/definitions\/bucketList"}}},"x-appwrite":{"method":"listBuckets","weight":151,"cookies":false,"type":"","demo":"storage\/list-buckets.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"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":"cursor","description":"ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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 bucket","operationId":"storageCreateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new storage bucket.","responses":{"201":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"createBucket","weight":150,"cookies":false,"type":"","demo":"storage\/create-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"bucketId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[BUCKET_ID]"},"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":30000000,"x-example":null},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["bucketId","name","permission"]}}]}},"\/storage\/buckets\/{bucketId}":{"get":{"summary":"Get Bucket","operationId":"storageGetBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"getBucket","weight":152,"cookies":false,"type":"","demo":"storage\/get-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]},"put":{"summary":"Update Bucket","operationId":"storageUpdateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a storage bucket by its unique ID.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"updateBucket","weight":153,"cookies":false,"type":"","demo":"storage\/update-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the `read` and `write` params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"file"},"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":"[\"role:all\"]","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":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":null,"x-example":null},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions","default":[],"x-example":null,"items":{"type":"string"}},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["name","permission"]}}]},"delete":{"summary":"Delete Bucket","operationId":"storageDeleteBucket","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a storage bucket by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteBucket","weight":154,"cookies":false,"type":"","demo":"storage\/delete-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["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":156,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/database#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":155,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"role:all\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/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":157,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":161,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":162,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":159,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":158,"cookies":false,"type":"","demo":"storage\/get-file-preview.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":160,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":163,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":164,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":166,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":165,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":167,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":168,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":169,"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 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":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":171,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":170,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":172,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":173,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). 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":175,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":174,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":177,"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":"Maximum number of users to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":176,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":191,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":178,"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 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":190,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":186,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":181,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":184,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":185,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/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":179,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"usersUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":187,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":180,"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 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":189,"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 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":188,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":182,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateVerification","weight":183,"cookies":false,"type":"","demo":"users\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}}},"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":{"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["sum","documents"]},"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["sum","collections"]},"indexList":{"description":"Indexes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["sum","indexes"]},"userList":{"description":"Users List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["sum","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["sum","files"]},"bucketList":{"description":"Buckets List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"buckets":{"type":"array","description":"List of buckets.","items":{"type":"object","$ref":"#\/definitions\/bucket"},"x-example":""}},"required":["sum","buckets"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["sum","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["sum","runtimes"]},"deploymentList":{"description":"Deployments List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"deployments":{"type":"array","description":"List of deployments.","items":{"type":"object","$ref":"#\/definitions\/deployment"},"x-example":""}},"required":["sum","deployments"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["sum","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["sum","metrics"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$read","$write","name","enabled","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["sum","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"integer","description":"Attribute size.","x-example":128,"format":"int32"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":"primary"},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"integer","description":"Date, the Unix timestamp of when the access token expires.","x-example":1592981250,"format":"int32"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"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"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$read","$write","name","dateCreated","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"bucket":{"description":"Bucket","type":"object","properties":{"$id":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":["role:all"]},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":["user:608f9da25e7e1"]},"permission":{"type":"string","description":"Bucket permission model. Possible values: `bucket` or `file`","x-example":"file"},"dateCreated":{"type":"integer","description":"Bucket creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Bucket update date in Unix timestamp.","x-example":1592981250,"format":"int32"},"name":{"type":"string","description":"Bucket name.","x-example":"Documents"},"enabled":{"type":"boolean","description":"Bucket enabled.","x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size supported.","x-example":100,"format":"int32"},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions.","items":{"type":"string"},"x-example":["jpg","png"]},"encryption":{"type":"boolean","description":"Bucket is encrypted.","x-example":false},"antivirus":{"type":"boolean","description":"Virus scanning is enabled.","x-example":false}},"required":["$id","$read","$write","permission","dateCreated","dateUpdated","name","enabled","maximumFileSize","allowedFileExtensions","encryption","antivirus"]},"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"},"execute":{"type":"array","description":"Execution permissions.","items":{"type":"string"},"x-example":"role:member"},"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"},"runtime":{"type":"string","description":"Function execution runtime.","x-example":"python-3.8"},"deployment":{"type":"string","description":"Function's active deployment 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","execute","name","dateCreated","dateUpdated","status","runtime","deployment","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"deployment":{"description":"Deployment","type":"object","properties":{"$id":{"type":"string","description":"Deployment ID.","x-example":"5e5ea5c16897e"},"resourceId":{"type":"string","description":"Resource ID.","x-example":"5e5ea6g16897e"},"resourceType":{"type":"string","description":"Resource type.","x-example":"functions"},"dateCreated":{"type":"integer","description":"The deployment creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"entrypoint":{"type":"string","description":"The entrypoint file to use to execute the deployment code.","x-example":"enabled"},"size":{"type":"integer","description":"The code size in bytes.","x-example":128,"format":"int32"},"buildId":{"type":"string","description":"The current build ID.","x-example":"5e5ea5c16897e"},"activate":{"type":"boolean","description":"Whether the deployment should be automatically activated.","x-example":true},"status":{"type":"string","description":"The deployment status.","x-example":"enabled"},"buildStdout":{"type":"string","description":"The build stdout.","x-example":"enabled"},"buildStderr":{"type":"string","description":"The build stderr.","x-example":"enabled"}},"required":["$id","resourceId","resourceType","dateCreated","entrypoint","size","buildId","activate","status","buildStdout","buildStderr"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"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"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$read","functionId","dateCreated","trigger","status","statusCode","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"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerNotionAppid":{"type":"string","description":"Notion OAuth app ID.","x-example":"123247283472834787438"},"providerNotionSecret":{"type":"string","description":"Notion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerVkAppid":{"type":"string","description":"VK OAuth app ID.","x-example":"123247283472834787438"},"providerVkSecret":{"type":"string","description":"VK OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYammerAppid":{"type":"string","description":"Yammer OAuth app ID.","x-example":"123247283472834787438"},"providerYammerSecret":{"type":"string","description":"Yammer OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerStripeAppid":{"type":"string","description":"Stripe OAuth app ID.","x-example":"123247283472834787438"},"providerStripeSecret":{"type":"string","description":"Stripe OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabase":{"type":"boolean","description":"Database service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDiscordAppid","providerDiscordSecret","providerDropboxAppid","providerDropboxSecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerNotionAppid","providerNotionSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerVkAppid","providerVkSecret","providerYahooAppid","providerYahooSecret","providerYammerAppid","providerYammerSecret","providerYandexAppid","providerYandexSecret","providerWordpressAppid","providerWordpressSecret","providerStripeAppid","providerStripeSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabase","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"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"]},"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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by files (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"tagsStorage":{"type":"array","description":"Aggregated stats for the occupied storage size by tags (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCount":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCount":{"type":"array","description":"Aggregated stats for total number of buckets.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCreate":{"type":"array","description":"Aggregated stats for buckets created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsRead":{"type":"array","description":"Aggregated stats for buckets read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsUpdate":{"type":"array","description":"Aggregated stats for buckets updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsDelete":{"type":"array","description":"Aggregated stats for buckets deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesStorage","tagsStorage","filesCount","bucketsCount","bucketsCreate","bucketsRead","bucketsUpdate","bucketsDelete","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesStorage":{"type":"array","description":"Aggregated stats for total storage of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesStorage","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"functionsExecutions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsFailures":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsCompute":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","functionsExecutions","functionsFailures","functionsCompute"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","functions","documents","collections","users","storage"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} diff --git a/specs/swagger-appwrite.0.10.0.json b/specs/swagger-appwrite.0.10.0.json deleted file mode 100644 index 75a60484ff..0000000000 --- a/specs/swagger-appwrite.0.10.0.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"version":"0.10.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":43,"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":35,"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","x-class":null},"password":{"type":"string","description":"User password. Must be between 6 to 32 chars.","default":null,"x-example":"password","x-class":null},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]","x-class":null}},"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","x-class":null},"password":{"type":"string","description":"User password. Must be between 6 to 32 chars.","default":null,"x-example":"password","x-class":null}},"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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":42,"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":46,"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]","x-class":null}},"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","x-class":null},"oldPassword":{"type":"string","description":"Old user password. Must be between 6 to 32 chars.","default":"","x-example":"password","x-class":null}},"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":44,"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":"{}","x-class":null}},"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","x-class":null},"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","x-class":null}},"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]","x-class":null},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]","x-class":null},"password":{"type":"string","description":"New password. Must be between 6 to 32 chars.","default":null,"x-example":"password","x-class":null},"passwordAgain":{"type":"string","description":"New password again. Must be between 6 to 32 chars.","default":null,"x-example":"password","x-class":null}},"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":45,"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":36,"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","x-class":null},"password":{"type":"string","description":"User password. Must be between 6 to 32 chars.","default":null,"x-example":"password","x-class":null}},"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":41,"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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":37,"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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":47,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"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","x-class":null}},"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]","x-class":null},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]","x-class":null}},"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]","x-class":null},"read":{"type":"string","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,"x-class":null},"write":{"type":"string","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,"x-class":null}},"required":["name","read","write"]}}]}},"\/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]","x-class":null},"read":{"type":"string","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,"x-class":null},"write":{"type":"string","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,"x-class":null}},"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}\/attributes":{"get":{"summary":"List Attributes","operationId":"databaseListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":78,"cookies":false,"type":"","demo":"database\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"attributes.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databaseCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Attribute","schema":{"$ref":"#\/definitions\/attribute"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":77,"cookies":false,"type":"","demo":"database\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-boolean.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"attributes.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null,"x-class":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false,"x-class":null},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false,"x-class":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false,"x-class":null}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databaseCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Attribute","schema":{"$ref":"#\/definitions\/attribute"}}},"x-appwrite":{"method":"createEmailAttribute","weight":72,"cookies":false,"type":"","demo":"database\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"attributes.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null,"x-class":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false,"x-class":null},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]","x-class":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false,"x-class":null}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databaseCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Attribute","schema":{"$ref":"#\/definitions\/attribute"}}},"x-appwrite":{"method":"createFloatAttribute","weight":76,"cookies":false,"type":"","demo":"database\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-float.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"attributes.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null,"x-class":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false,"x-class":null},"min":{"type":"string","description":"Minimum value to enforce on new documents","default":null,"x-example":null,"x-class":null},"max":{"type":"string","description":"Maximum value to enforce on new documents","default":null,"x-example":null,"x-class":null},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null,"x-class":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false,"x-class":null}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databaseCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Attribute","schema":{"$ref":"#\/definitions\/attribute"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":75,"cookies":false,"type":"","demo":"database\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-integer.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"attributes.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null,"x-class":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false,"x-class":null},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null,"x-class":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null,"x-class":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null,"x-class":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false,"x-class":null}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databaseCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Attribute","schema":{"$ref":"#\/definitions\/attribute"}}},"x-appwrite":{"method":"createIpAttribute","weight":73,"cookies":false,"type":"","demo":"database\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-ip.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"attributes.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null,"x-class":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false,"x-class":null},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]","x-class":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false,"x-class":null}},"required":["attributeId","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databaseCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Attribute","schema":{"$ref":"#\/definitions\/attribute"}}},"x-appwrite":{"method":"createStringAttribute","weight":71,"cookies":false,"type":"","demo":"database\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-string.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"attributes.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null,"x-class":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":null,"x-class":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false,"x-class":null},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]","x-class":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false,"x-class":null}},"required":["attributeId","size","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create IP Address Attribute","operationId":"databaseCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Attribute","schema":{"$ref":"#\/definitions\/attribute"}}},"x-appwrite":{"method":"createUrlAttribute","weight":74,"cookies":false,"type":"","demo":"database\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-url.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"attributes.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"attributeId":{"type":"string","description":"Attribute ID.","default":null,"x-example":null,"x-class":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":null,"x-class":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false,"x-class":null},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]","x-class":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false,"x-class":null}},"required":["attributeId","size","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/{attributeId}":{"get":{"summary":"Get Attribute","operationId":"databaseGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Attribute","schema":{"$ref":"#\/definitions\/attribute"}}},"x-appwrite":{"method":"getAttribute","weight":79,"cookies":false,"type":"","demo":"database\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"attributes.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"attributeId","description":"Attribute ID.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databaseDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":80,"cookies":false,"type":"","demo":"database\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"attributes.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"attributeId","description":"Attribute ID.","required":true,"type":"string","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":86,"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 using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings.","required":false,"x-class":"query","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":"orderAttributes","description":"Array of attributes used to sort results.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"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":85,"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":"{}","x-class":null},"read":{"type":"string","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,"x-class":null},"write":{"type":"string","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,"x-class":null}},"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":87,"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 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":88,"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":"{}","x-class":null},"read":{"type":"string","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,"x-class":null},"write":{"type":"string","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,"x-class":null}},"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":89,"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 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"}]}},"\/database\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databaseListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":82,"cookies":false,"type":"","demo":"database\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"indexes.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databaseCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":81,"cookies":false,"type":"","demo":"database\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"indexes.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection 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":{"id":{"type":"string","description":"Index ID.","default":null,"x-example":null,"x-class":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key","x-class":null},"attributes":{"type":"array","description":"Array of attributes to index.","default":null,"x-example":null,"x-class":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders.","default":[],"x-example":null,"x-class":null,"items":{"type":"string"}}},"required":["id","type","attributes"]}}]}},"\/database\/collections\/{collectionId}\/indexes\/{indexId}":{"get":{"summary":"Get Index","operationId":"databaseGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":83,"cookies":false,"type":"","demo":"database\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"indexes.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"indexId","description":"Index ID.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databaseDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":84,"cookies":false,"type":"","demo":"database\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"indexes.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"indexId","description":"Index ID.","required":true,"type":"string","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":171,"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":170,"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]","x-class":null},"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,"x-class":null,"items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"java-11.0","x-class":null},"vars":{"type":"object","description":"Key-value JSON object.","default":{},"x-example":"{}","x-class":null},"events":{"type":"array","description":"Events list.","default":[],"x-example":null,"x-class":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null,"x-class":null},"timeout":{"type":"integer","description":"Function maximum execution time in seconds.","default":15,"x-example":1,"x-class":null}},"required":["name","execute","runtime"]}}]}},"\/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":172,"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":174,"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]","x-class":null},"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,"x-class":null,"items":{"type":"string"}},"vars":{"type":"object","description":"Key-value JSON object.","default":{},"x-example":"{}","x-class":null},"events":{"type":"array","description":"Events list.","default":[],"x-example":null,"x-class":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null,"x-class":null},"timeout":{"type":"integer","description":"Function maximum execution time in seconds.","default":15,"x-example":1,"x-class":null}},"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":176,"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":182,"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":"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"}]},"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":181,"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]","x-class":null}}}}]}},"\/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":183,"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":175,"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]","x-class":null}},"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":178,"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":177,"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":179,"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":180,"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":173,"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":97,"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":108,"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":100,"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":99,"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":105,"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":106,"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":103,"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\/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":104,"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":102,"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":107,"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":101,"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":90,"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":94,"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":91,"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":92,"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":93,"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":95,"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":96,"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":111,"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":110,"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]","x-class":null},"teamId":{"type":"string","description":"Team unique ID.","default":null,"x-example":"[TEAM_ID]","x-class":null},"description":{"type":"string","description":"Project description. Max length: 256 chars.","default":"","x-example":"[DESCRIPTION]","x-class":null},"logo":{"type":"string","description":"Project logo.","default":"","x-example":"[LOGO]","x-class":null},"url":{"type":"string","description":"Project URL.","default":"","x-example":"https:\/\/example.com","x-class":null},"legalName":{"type":"string","description":"Project legal Name. Max length: 256 chars.","default":"","x-example":"[LEGAL_NAME]","x-class":null},"legalCountry":{"type":"string","description":"Project legal Country. Max length: 256 chars.","default":"","x-example":"[LEGAL_COUNTRY]","x-class":null},"legalState":{"type":"string","description":"Project legal State. Max length: 256 chars.","default":"","x-example":"[LEGAL_STATE]","x-class":null},"legalCity":{"type":"string","description":"Project legal City. Max length: 256 chars.","default":"","x-example":"[LEGAL_CITY]","x-class":null},"legalAddress":{"type":"string","description":"Project legal Address. Max length: 256 chars.","default":"","x-example":"[LEGAL_ADDRESS]","x-class":null},"legalTaxId":{"type":"string","description":"Project legal Tax ID. Max length: 256 chars.","default":"","x-example":"[LEGAL_TAX_ID]","x-class":null}},"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":112,"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":114,"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]","x-class":null},"description":{"type":"string","description":"Project description. Max length: 256 chars.","default":"","x-example":"[DESCRIPTION]","x-class":null},"logo":{"type":"string","description":"Project logo.","default":"","x-example":"[LOGO]","x-class":null},"url":{"type":"string","description":"Project URL.","default":"","x-example":"https:\/\/example.com","x-class":null},"legalName":{"type":"string","description":"Project legal name. Max length: 256 chars.","default":"","x-example":"[LEGAL_NAME]","x-class":null},"legalCountry":{"type":"string","description":"Project legal country. Max length: 256 chars.","default":"","x-example":"[LEGAL_COUNTRY]","x-class":null},"legalState":{"type":"string","description":"Project legal state. Max length: 256 chars.","default":"","x-example":"[LEGAL_STATE]","x-class":null},"legalCity":{"type":"string","description":"Project legal city. Max length: 256 chars.","default":"","x-example":"[LEGAL_CITY]","x-class":null},"legalAddress":{"type":"string","description":"Project legal address. Max length: 256 chars.","default":"","x-example":"[LEGAL_ADDRESS]","x-class":null},"legalTaxId":{"type":"string","description":"Project legal tax ID. Max length: 256 chars.","default":"","x-example":"[LEGAL_TAX_ID]","x-class":null}},"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":119,"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]","x-class":null}},"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":117,"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":"integer","description":"Set the max number of users allowed in this project. Use 0 for unlimited.","default":null,"x-example":null,"x-class":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":118,"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,"x-class":null}},"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":136,"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":135,"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,"x-class":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":137,"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":139,"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":138,"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":126,"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":125,"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]","x-class":null},"scopes":{"type":"array","description":"Key scopes list.","default":null,"x-example":null,"x-class":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":127,"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":128,"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]","x-class":null},"scopes":{"type":"array","description":"Key scopes list","default":null,"x-example":null,"x-class":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":129,"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":116,"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","x-class":null},"appId":{"type":"string","description":"Provider app ID. Max length: 256 chars.","default":"","x-example":"[APP_ID]","x-class":null},"secret":{"type":"string","description":"Provider secret key. Max length: 512 chars.","default":"","x-example":"[SECRET]","x-class":null}},"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":131,"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":130,"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","x-class":null},"name":{"type":"string","description":"Platform name. Max length: 128 chars.","default":null,"x-example":"[NAME]","x-class":null},"key":{"type":"string","description":"Package name for android or bundle ID for iOS. Max length: 256 chars.","default":"","x-example":"[KEY]","x-class":null},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]","x-class":null},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":"[HOSTNAME]","x-class":null}},"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":132,"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":133,"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]","x-class":null},"key":{"type":"string","description":"Package name for android or bundle ID for iOS. Max length: 256 chars.","default":"","x-example":"[KEY]","x-class":null},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]","x-class":null},"hostname":{"type":"string","description":"Platform client URL. Max length: 256 chars.","default":"","x-example":"[HOSTNAME]","x-class":null}},"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":134,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":115,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account","x-class":null},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false,"x-class":null}},"required":["service","status"]}}]}},"\/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":113,"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":121,"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":120,"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]","x-class":null},"events":{"type":"array","description":"Events list.","default":null,"x-example":null,"x-class":null,"items":{"type":"string"}},"url":{"type":"string","description":"Webhook URL.","default":null,"x-example":"https:\/\/example.com","x-class":null},"security":{"type":"boolean","description":"Certificate verification, false for disabled or true for enabled.","default":null,"x-example":false,"x-class":null},"httpUser":{"type":"string","description":"Webhook HTTP user. Max length: 256 chars.","default":"","x-example":"[HTTP_USER]","x-class":null},"httpPass":{"type":"string","description":"Webhook HTTP password. Max length: 256 chars.","default":"","x-example":"[HTTP_PASS]","x-class":null}},"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":122,"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":123,"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]","x-class":null},"events":{"type":"array","description":"Events list.","default":null,"x-example":null,"x-class":null,"items":{"type":"string"}},"url":{"type":"string","description":"Webhook URL.","default":null,"x-example":"https:\/\/example.com","x-class":null},"security":{"type":"boolean","description":"Certificate verification, false for disabled or true for enabled.","default":null,"x-example":false,"x-class":null},"httpUser":{"type":"string","description":"Webhook HTTP user. Max length: 256 chars.","default":"","x-example":"[HTTP_USER]","x-class":null},"httpPass":{"type":"string","description":"Webhook HTTP password. Max length: 256 chars.","default":"","x-example":"[HTTP_PASS]","x-class":null}},"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":124,"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":141,"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":140,"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":142,"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":146,"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,"x-class":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,"x-class":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":147,"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":144,"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":143,"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":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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":145,"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":149,"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":148,"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]","x-class":null},"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,"x-class":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":150,"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":151,"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]","x-class":null}},"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":152,"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":154,"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. If initiated from Client SDK, an email with a link to join the team will be sent to the new member's email address if the member doesn't exist in the project it will be created automatically. If initiated from server side SDKs, new member will automatically be added to the team.\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. While calling from side SDKs the redirect url can be empty string.\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":153,"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","x-class":null},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]","x-class":null},"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,"x-class":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","x-class":null}},"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":155,"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,"x-class":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":157,"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":156,"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]","x-class":null},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]","x-class":null}},"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":159,"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":158,"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","x-class":null},"password":{"type":"string","description":"User password. Must be between 6 to 32 chars.","default":null,"x-example":"password","x-class":null},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]","x-class":null}},"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":160,"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":169,"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":163,"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":161,"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":166,"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":"{}","x-class":null}},"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":162,"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":168,"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":167,"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":164,"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":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`","default":null,"x-example":false,"x-class":null}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateVerification","weight":165,"cookies":false,"type":"","demo":"users\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User Email Verification Status.","default":null,"x-example":false,"x-class":null}},"required":["emailVerification"]}}]}}},"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":{"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"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"type":"object","$ref":"#\/definitions\/attribute"},"x-example":""}},"required":["sum","attributes"]},"indexList":{"description":"Indexes List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["sum","indexes"]},"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"]},"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"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"Collection name.","x-example":""},"attributes":{"type":"array","description":"Collection attributes.","items":{"type":"object","$ref":"#\/definitions\/attribute"},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}},"attributesInQueue":{"type":"array","description":"Collection attributes in creation queue.","items":{"type":"object","$ref":"#\/definitions\/attribute"},"x-example":{}},"indexesInQueue":{"type":"array","description":"Collection indexes in creation queue.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$read","$write","name","attributes","indexes","attributesInQueue","indexesInQueue"]},"attribute":{"description":"Attribute","type":"object","properties":{"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16d55"},"$id":{"type":"string","description":"Attribute ID.","x-example":"60ccf71b98a2d"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"size":{"type":"string","description":"Attribute size.","x-example":128},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"signed":{"type":"boolean","description":"Is attribute signed?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false},"filters":{"type":"array","description":"Attribute filters.","items":{"type":"string"},"x-example":[]}},"required":["$collection","$id","type","size","required","signed","array","filters"]},"index":{"description":"Index","type":"object","properties":{"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16d55"},"$id":{"type":"string","description":"Index ID.","x-example":""},"type":{"type":"string","description":"Index type.","x-example":""},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"lengths":{"type":"array","description":"Index lengths.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["$collection","$id","type","attributes","lengths","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$read","$write"]},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"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","$read","$write","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"},"runtime":{"type":"string","description":"Function execution runtime.","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","runtime","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. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","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":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"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},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabase":{"type":"boolean","description":"Database service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","usersAuthLimit","platforms","webhooks","keys","domains","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","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabase","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"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"]},"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"}} diff --git a/specs/swagger-appwrite.0.11.0.json b/specs/swagger-appwrite.0.11.0.json deleted file mode 100644 index c2b1deee00..0000000000 --- a/specs/swagger-appwrite.0.11.0.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"version":"0.11.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":47,"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":37,"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":56,"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":54,"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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":46,"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:{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":50,"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":52,"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":53,"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":48,"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":55,"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":59,"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":60,"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":49,"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":38,"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":58,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":45,"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\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":43,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":44,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"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"]}}]}},"\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":39,"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":"","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":"","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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":51,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"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":57,"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":61,"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},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":62,"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":64,"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":63,"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":67,"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":65,"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":66,"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":69,"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":68,"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":71,"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":70,"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":72,"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":73,"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":74,"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":76,"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":75,"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":77,"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":78,"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":79,"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":169,"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":168,"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"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"dotnet-5.0"},"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","runtime"]}}]}},"\/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":170,"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":172,"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":174,"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":180,"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":179,"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":181,"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":173,"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":176,"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":175,"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":177,"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":178,"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":171,"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":87,"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":99,"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":90,"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":89,"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":96,"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":97,"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":94,"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":93,"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":95,"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":92,"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":98,"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":91,"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":80,"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":84,"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":81,"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":82,"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":83,"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":85,"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":86,"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":102,"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":101,"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":103,"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":105,"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":109,"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":107,"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":"integer","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":108,"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,magic-url,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":131,"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":130,"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":132,"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":134,"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":133,"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":116,"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":115,"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":117,"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":118,"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":119,"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":106,"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":126,"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":125,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":"[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":127,"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":128,"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":129,"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":121,"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":120,"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":122,"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":123,"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":124,"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":104,"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":111,"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":110,"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":112,"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":113,"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":114,"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":136,"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":135,"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":137,"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":141,"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":142,"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":139,"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":138,"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":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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":140,"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":144,"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":143,"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":145,"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":146,"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":147,"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":150,"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. If initiated from Client SDK, an email with a link to join the team will be sent to the new member's email address if the member doesn't exist in the project it will be created automatically. If initiated from server side SDKs, new member will automatically be added to the team.\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. While calling from side SDKs the redirect url can be empty string.\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":148,"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"},"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"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"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":149,"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":152,"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":151,"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":154,"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":153,"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":155,"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":167,"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}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":163,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/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":158,"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}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":161,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":162,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/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":156,"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":164,"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":157,"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":166,"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":165,"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":159,"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"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateVerification","weight":160,"cookies":false,"type":"","demo":"users\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User Email Verification Status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}}},"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":{"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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"},"runtime":{"type":"string","description":"Function execution runtime.","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","runtime","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"},"$permissions":{"type":"object","description":"Execution permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"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. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"float"}},"required":["$id","$permissions","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":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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},"usersAuthMagicURL":{"type":"boolean","description":"Magic URL 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","usersAuthMagicURL","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"}} diff --git a/specs/swagger-appwrite.0.12.0.json b/specs/swagger-appwrite.0.12.0.json deleted file mode 100644 index 847acfd31a..0000000000 --- a/specs/swagger-appwrite.0.12.0.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"version":"0.12.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":"HOSTNAME","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":46,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete 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":55,"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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":53,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":45,"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:{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":49,"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":[]}],"parameters":[{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/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":51,"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":52,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 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":47,"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":54,"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":{},"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":58,"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":59,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":48,"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 at least 8 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":57,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":44,"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\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":42,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":43,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":null},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"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, yammer, 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":"","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":"","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}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":50,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"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":56,"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 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":60,"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},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":61,"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 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":63,"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":62,"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":66,"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":64,"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":65,"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":68,"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":67,"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":70,"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":"Maximum number of collection to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the collection used as the starting point for the query, excluding the collection itself. Should be used for efficient pagination when working with large sets of data.","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":69,"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":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["collectionId","name","permission","read","write"]}}]}},"\/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":71,"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 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":75,"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 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]"},"permission":{"type":"string","description":"Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"document"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name","permission"]}}]},"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":76,"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 ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databaseListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":85,"cookies":false,"type":"","demo":"database\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databaseCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a boolean attribute.\n","responses":{"201":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":84,"cookies":false,"type":"","demo":"database\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databaseCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an email attribute.\n","responses":{"201":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":78,"cookies":false,"type":"","demo":"database\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databaseCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":79,"cookies":false,"type":"","demo":"database\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databaseCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":83,"cookies":false,"type":"","demo":"database\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"string","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"string","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databaseCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"201":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":82,"cookies":false,"type":"","demo":"database\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databaseCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create IP address attribute.\n","responses":{"201":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":80,"cookies":false,"type":"","demo":"database\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databaseCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new string attribute.\n","responses":{"201":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":77,"cookies":false,"type":"","demo":"database\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databaseCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a URL attribute.\n","responses":{"201":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":81,"cookies":false,"type":"","demo":"database\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/database\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databaseGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":86,"cookies":false,"type":"","demo":"database\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databaseDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":87,"cookies":false,"type":"","demo":"database\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","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":93,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","in":"query"},{"name":"orderAttributes","description":"Array of attributes used to sort results.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"orderTypes","description":"Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"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":92,"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 ID. You can create a new collection with validation rules using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"data":{"type":"object","description":"Document data as JSON object.","default":{},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","items":{"type":"string"}}},"required":["documentId","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":94,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"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":96,"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 ID. You can create a new collection with validation rules using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":{},"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":"[\"role:all\"]","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":97,"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 ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databaseListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the document activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":95,"cookies":false,"type":"","demo":"database\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databaseListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":89,"cookies":false,"type":"","demo":"database\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databaseCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"201":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":88,"cookies":false,"type":"","demo":"database\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/database\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databaseGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":90,"cookies":false,"type":"","demo":"database\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databaseDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":91,"cookies":false,"type":"","demo":"database\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/database\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databaseListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":74,"cookies":false,"type":"","demo":"database\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/database\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databaseGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getUsage","weight":72,"cookies":false,"type":"","demo":"database\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/database\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databaseGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":73,"cookies":false,"type":"","demo":"database\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_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":186,"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":"Maximum number of functions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":185,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"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](https:\/\/appwrite.io\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"vars":{"type":"object","description":"Key-value JSON object that will be passed to the function as environment variables.","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":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List the currently active function runtimes.","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active in your project.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":187,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/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":188,"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 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":190,"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 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](https:\/\/appwrite.io\/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 that will be passed to the function as environment variables.","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":"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":192,"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 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":198,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"limit","description":"Maximum number of executions to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"cursor","description":"ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":197,"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 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":199,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/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":191,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"tag":{"type":"string","description":"Tag 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":194,"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 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":"Maximum number of tags to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the tag used as the starting point for the query, excluding the tag itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":193,"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 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":195,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag 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":196,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag 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":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":189,"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 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":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":105,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":116,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":108,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":107,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":113,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":114,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":111,"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\/usage":{"get":{"summary":"Get Usage Queue","operationId":"healthGetQueueUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueUsage","weight":112,"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":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":110,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":115,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":109,"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":98,"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":102,"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":99,"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":100,"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":101,"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":103,"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":104,"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":119,"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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the project used as the starting point for the query, excluding the project itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":118,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"name":{"type":"string","description":"Project name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"teamId":{"type":"string","description":"Team unique ID.","default":null,"x-example":"[TEAM_ID]"},"description":{"type":"string","description":"Project description. Max length: 256 chars.","default":"","x-example":"[DESCRIPTION]"},"logo":{"type":"string","description":"Project logo.","default":"","x-example":"[LOGO]"},"url":{"type":"string","description":"Project URL.","default":"","x-example":"https:\/\/example.com"},"legalName":{"type":"string","description":"Project legal Name. Max length: 256 chars.","default":"","x-example":"[LEGAL_NAME]"},"legalCountry":{"type":"string","description":"Project legal Country. Max length: 256 chars.","default":"","x-example":"[LEGAL_COUNTRY]"},"legalState":{"type":"string","description":"Project legal State. Max length: 256 chars.","default":"","x-example":"[LEGAL_STATE]"},"legalCity":{"type":"string","description":"Project legal City. Max length: 256 chars.","default":"","x-example":"[LEGAL_CITY]"},"legalAddress":{"type":"string","description":"Project legal Address. Max length: 256 chars.","default":"","x-example":"[LEGAL_ADDRESS]"},"legalTaxId":{"type":"string","description":"Project legal Tax ID. Max length: 256 chars.","default":"","x-example":"[LEGAL_TAX_ID]"}},"required":["projectId","name","teamId"]}}]}},"\/projects\/{projectId}":{"get":{"summary":"Get Project","operationId":"projectsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"get","weight":120,"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":122,"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":127,"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 at least 8 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":125,"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":"integer","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":126,"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,magic-url,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":144,"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":143,"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":145,"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":147,"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":146,"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":134,"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":133,"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":135,"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":136,"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":137,"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":124,"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":139,"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":138,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":"[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":140,"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":141,"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":142,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":123,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":121,"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":129,"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":128,"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":130,"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":131,"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":132,"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":149,"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":"Maximum number of files to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":148,"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":"fileId","description":"File ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"type":"string","in":"formData"},{"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](https:\/\/appwrite.io\/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](https:\/\/appwrite.io\/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":150,"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 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":154,"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 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](https:\/\/appwrite.io\/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](https:\/\/appwrite.io\/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":155,"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 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":152,"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 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":151,"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 ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","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":153,"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 ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":156,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":157,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":159,"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":"Maximum number of teams to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":158,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"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":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":160,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":161,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":162,"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 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":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":164,"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 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":"Maximum number of memberships to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":163,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":165,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":166,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). 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":168,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":167,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":170,"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":"Maximum number of users to return in response. 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. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"cursor","description":"ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"string","x-example":"[CURSOR]","default":"","in":"query"},{"name":"cursorDirection","description":"Direction of the cursor.","required":false,"type":"string","x-example":"after","default":"after","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":169,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":null},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":184,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":171,"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 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":183,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":179,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":174,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"limit","description":"Maximum number of logs to return in response. 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 value to manage pagination. [learn more about pagination](https:\/\/appwrite.io\/docs\/pagination)","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":177,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":178,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/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":172,"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 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":180,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":173,"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 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":182,"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 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":181,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":175,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateVerification","weight":176,"cookies":false,"type":"","demo":"users\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}}},"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":{"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["sum","collections"]},"indexList":{"description":"Indexes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["sum","indexes"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["sum","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["sum","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["sum","runtimes"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["sum","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","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 number of items available on the server.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"sum":{"type":"integer","description":"Total number of items available on the server.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["sum","metrics"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$read":{"type":"array","description":"Collection read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Collection write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"permission":{"type":"string","description":"Collection permission model. Possible values: `document` or `collection`","x-example":"document"},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$read","$write","name","enabled","permission","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["sum","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"string","description":"Attribute size.","x-example":128},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":""},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[]}},"required":["key","type","status","attributes","orders"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$read":{"type":"array","description":"Document read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"Document write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"}},"additionalProperties":true,"required":["$id","$collection","$read","$write"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"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","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"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":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"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"},"$read":{"type":"array","description":"File read permissions.","items":{"type":"string"},"x-example":"role:all"},"$write":{"type":"array","description":"File write permissions.","items":{"type":"string"},"x-example":"user:608f9da25e7e1"},"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","$read","$write","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"},"execute":{"type":"string","description":"Execution permissions.","x-example":"role:member"},"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"},"runtime":{"type":"string","description":"Function execution runtime.","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","execute","name","dateCreated","dateUpdated","status","runtime","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"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"},"$read":{"type":"array","description":"Execution read permissions.","items":{"type":"string"},"x-example":"role:all"},"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. Logs the last 4,000 characters of the execution stdout output.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$read","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"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerVkAppid":{"type":"string","description":"VK OAuth app ID.","x-example":"123247283472834787438"},"providerVkSecret":{"type":"string","description":"VK OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYammerAppid":{"type":"string","description":"Yammer OAuth app ID.","x-example":"123247283472834787438"},"providerYammerSecret":{"type":"string","description":"Yammer OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabase":{"type":"boolean","description":"Database service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDiscordAppid","providerDiscordSecret","providerDropboxAppid","providerDropboxSecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerVkAppid","providerVkSecret","providerYahooAppid","providerYahooSecret","providerYammerAppid","providerYammerSecret","providerYandexAppid","providerYandexSecret","providerWordpressAppid","providerWordpressSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabase","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"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"]},"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":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]},"metric":{"description":"Metric","type":"object","properties":{"value":{"type":"integer","description":"The value of this metric at the timestamp.","x-example":1,"format":"int32"},"timestamp":{"type":"integer","description":"The UNIX timestamp at which this metric was aggregated.","x-example":1592981250,"format":"int32"}},"required":["value","timestamp"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"files":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","storage","files"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"functionsExecutions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsFailures":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functionsCompute":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","functionsExecutions","functionsFailures","functionsCompute"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"functions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","functions","documents","collections","users","storage"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file diff --git a/specs/swagger-appwrite.0.7.0.json b/specs/swagger-appwrite.0.7.0.json deleted file mode 100644 index 16a044116d..0000000000 --- a/specs/swagger-appwrite.0.7.0.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"version":"0.7.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@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"}},"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":42,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}]},"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":35,"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},"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"]}}]},"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":50,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}]}},"\/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.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":48,"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"],"packaging":false},"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"}},"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":45,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}]}},"\/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":46,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"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 the password twice.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":47,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":null,"x-example":"password"}},"required":["password","oldPassword"]}}]}},"\/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":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getPrefs","weight":43,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}]},"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":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updatePrefs","weight":49,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"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.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createRecovery","weight":53,"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"],"packaging":false},"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"},"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":54,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":44,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}]},"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":36,"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},"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"}},"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":52,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}]}},"\/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":37,"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},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, 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":51,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"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). \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":55,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":56,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":58,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"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":57,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, 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":61,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Website URL which you want to fetch the favicon from.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"}]}},"\/avatars\/flags\/{code}":{"get":{"summary":"Get Country Flag","operationId":"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":59,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"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":60,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Image URL which you want to crop.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"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":63,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"query"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"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":62,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"text","description":"Plain text to be converted to QR code image.","required":true,"type":"string","x-example":"[TEXT]","in":"query"},{"name":"size","description":"QR code size. Pass an integer between 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"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":65,"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},"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":64,"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},"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":66,"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},"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":67,"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},"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 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":[],"x-example":null,"items":{"type":"string"}}},"required":["name","read","write"]}}]},"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":68,"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},"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":70,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination. 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":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"createDocument","weight":69,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"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 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"}},"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","read","write"]}}]}},"\/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":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getDocument","weight":71,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"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":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updateDocument","weight":72,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"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 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":["data","read","write"]}}]},"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":73,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"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":156,"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},"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":155,"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},"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":"node-14.5"},"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":157,"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},"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":159,"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},"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":161,"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},"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 teams. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Executions List","schema":{"$ref":"#\/definitions\/executionList"}}},"x-appwrite":{"method":"listExecutions","weight":167,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"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":166,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/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":168,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/tag":{"patch":{"summary":"Update Function Tag","operationId":"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":160,"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},"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":163,"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},"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":162,"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},"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":164,"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},"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":165,"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},"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":158,"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},"security":[{"Project":[],"Key":[]}],"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":81,"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},"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":93,"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},"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":84,"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},"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":83,"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},"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":90,"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},"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":91,"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},"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":88,"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},"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":87,"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},"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":89,"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},"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":86,"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},"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":92,"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},"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":85,"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},"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":74,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}]}},"\/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":78,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}]}},"\/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":75,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}]}},"\/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":76,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}]}},"\/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":77,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}]}},"\/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":79,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}]}},"\/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":80,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}]}},"\/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":96,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Project","operationId":"projectsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"create","weight":95,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":97,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"patch":{"summary":"Update Project","operationId":"projectsUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"update","weight":99,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":101,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"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}\/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":123,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Domain","operationId":"projectsCreateDomain","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"createDomain","weight":122,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":124,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]},"delete":{"summary":"Delete Domain","operationId":"projectsDeleteDomain","consumes":["application\/json"],"produces":[],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDomain","weight":126,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/domains\/{domainId}\/verification":{"patch":{"summary":"Update Domain Verification Status","operationId":"projectsUpdateDomainVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"updateDomainVerification","weight":125,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/keys":{"get":{"summary":"List Keys","operationId":"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":108,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Key","operationId":"projectsCreateKey","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"createKey","weight":107,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":109,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"keyId","description":"Key unique ID.","required":true,"type":"string","x-example":"[KEY_ID]","in":"path"}]},"put":{"summary":"Update Key","operationId":"projectsUpdateKey","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"updateKey","weight":110,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"keyId","description":"Key unique ID.","required":true,"type":"string","x-example":"[KEY_ID]","in":"path"},{"name":"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":111,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"keyId","description":"Key unique ID.","required":true,"type":"string","x-example":"[KEY_ID]","in":"path"}]}},"\/projects\/{projectId}\/oauth2":{"patch":{"summary":"Update Project OAuth2","operationId":"projectsUpdateOAuth2","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateOAuth2","weight":100,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":118,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Platform","operationId":"projectsCreatePlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"createPlatform","weight":117,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":119,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"platformId","description":"Platform unique ID.","required":true,"type":"string","x-example":"[PLATFORM_ID]","in":"path"}]},"put":{"summary":"Update Platform","operationId":"projectsUpdatePlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"updatePlatform","weight":120,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"platformId","description":"Platform unique ID.","required":true,"type":"string","x-example":"[PLATFORM_ID]","in":"path"},{"name":"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":121,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"platformId","description":"Platform unique ID.","required":true,"type":"string","x-example":"[PLATFORM_ID]","in":"path"}]}},"\/projects\/{projectId}\/tasks":{"get":{"summary":"List Tasks","operationId":"projectsListTasks","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Tasks List","schema":{"$ref":"#\/definitions\/taskList"}}},"x-appwrite":{"method":"listTasks","weight":113,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Task","operationId":"projectsCreateTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"createTask","weight":112,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":114,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]},"put":{"summary":"Update Task","operationId":"projectsUpdateTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"updateTask","weight":115,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"},{"name":"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":116,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get Project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":[],"tags":["projects"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getUsage","weight":98,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"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":103,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Webhook","operationId":"projectsCreateWebhook","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"createWebhook","weight":102,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":104,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"webhookId","description":"Webhook unique ID.","required":true,"type":"string","x-example":"[WEBHOOK_ID]","in":"path"}]},"put":{"summary":"Update Webhook","operationId":"projectsUpdateWebhook","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"updateWebhook","weight":105,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"webhookId","description":"Webhook unique ID.","required":true,"type":"string","x-example":"[WEBHOOK_ID]","in":"path"},{"name":"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":106,"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":[],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"webhookId","description":"Webhook unique ID.","required":true,"type":"string","x-example":"[WEBHOOK_ID]","in":"path"}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"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":128,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"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":127,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"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":129,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"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":133,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":134,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"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":131,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"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":130,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"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":132,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":136,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"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":135,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":137,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"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":138,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"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":139,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"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":141,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"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":140,"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":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"],"packaging":false},"security":[{"Project":[],"Key":[]}],"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\/{inviteId}":{"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":143,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"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":142,"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"],"packaging":false},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"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":145,"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},"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":144,"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},"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":146,"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},"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":"usersDeleteUser","consumes":["application\/json"],"produces":[],"tags":["users"],"description":"Delete a user by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteUser","weight":154,"cookies":false,"type":"","demo":"users\/delete-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false},"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":149,"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},"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":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"getPrefs","weight":147,"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},"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":"Any","schema":{"$ref":"#\/definitions\/any"}}},"x-appwrite":{"method":"updatePrefs","weight":151,"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},"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":148,"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},"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":153,"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},"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":152,"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},"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":150,"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},"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":"string","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":{"none":{"description":"None","type":"object"},"any":{"description":"Any","type":"object","additionalProperties":true},"error":{"description":"Error","type":"object","properties":{"message":{"type":"string","description":"Error message.","x-example":"Not found"},"code":{"type":"string","description":"Error code.","x-example":"404"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"}},"required":["message","code","version"]},"errorDev":{"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"},"file":{"type":"string","description":"File path.","x-example":"\/usr\/code\/vendor\/utopia-php\/framework\/src\/App.php"},"line":{"type":"integer","description":"Line number.","x-example":209,"format":"int32"},"trace":{"type":"array","description":"Error trace.","items":{"type":"string"},"x-example":""}},"required":["message","code","version","file","line","trace"]},"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\/any"},"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"]},"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"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"prefs":{"type":"string","description":"User preferences as a key-value object","x-example":{"theme":"pink","timezone":"UTC"}}},"required":["$id","name","registration","status","email","emailVerification","prefs"]},"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"},"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","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"},"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 (Sandbox) OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2PaypalSandboxSecret":{"type":"string","description":"PayPal (Sandbox) 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 Sandbox OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2TradeshiftBoxSecret":{"type":"string","description":"Tradeshift Sandbox 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..."}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","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"]},"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"},"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","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/specs/swagger-appwrite.0.8.0.json b/specs/swagger-appwrite.0.8.0.json deleted file mode 100644 index 3564636303..0000000000 --- a/specs/swagger-appwrite.0.8.0.json +++ /dev/null @@ -1 +0,0 @@ -{"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/specs/swagger2-latest-console.json b/specs/swagger2-latest-console.json deleted file mode 100644 index 21cf7d1930..0000000000 --- a/specs/swagger2-latest-console.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"version":"1.0.0-RC1","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":"HOSTNAME","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":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"get","weight":52,"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":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"create","weight":40,"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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/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, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n","responses":{"200":{"description":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"updateEmail","weight":59,"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 at least 8 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 in that time frame.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":51,"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":100,"rate-time":3600,"rate-key":"url:{url},userId:{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":55,"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":[]}],"parameters":[{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Only supported methods are limit and offset","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/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":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"updateName","weight":57,"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, Team Invites and Magic URL, oldPassword is optional.","responses":{"200":{"description":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"updatePassword","weight":58,"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 at least 8 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Current user password. Must be at least 8 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/phone":{"patch":{"summary":"Update Account Phone","operationId":"accountUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](\/docs\/client\/account#accountCreatePhoneVerification) endpoint to send a confirmation SMS.","responses":{"200":{"description":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"updatePhone","weight":60,"cookies":false,"type":"","demo":"account\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"phone":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null},"password":{"type":"string","description":"User password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["phone","password"]}}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"accountGetPrefs","consumes":["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":53,"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. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"updatePrefs","weight":61,"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":{},"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":66,"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}","ip:{ip}"],"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":"Create Password Recovery (confirmation)","operationId":"accountUpdateRecovery","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/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":67,"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 ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"Repeat new user password. Must be at least 8 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":54,"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":[]}]},"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":65,"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, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail) or create an [OAuth2 session](\/docs\/client\/account#accountCreateOAuth2Session).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":50,"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\/email":{"post":{"summary":"Create Account Session with Email","operationId":"accountCreateEmailSession","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":"createEmailSession","weight":41,"cookies":false,"type":"","demo":"account\/create-email-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email.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 at least 8 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/sessions\/magic-url":{"post":{"summary":"Create Magic URL session","operationId":"accountCreateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT \/account\/sessions\/magic-url](\/docs\/client\/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createMagicURLSession","weight":46,"cookies":false,"type":"","demo":"account\/create-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-magic-url-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"url":{"type":"string","description":"URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":"","x-example":"https:\/\/example.com"}},"required":["userId","email"]}}]},"put":{"summary":"Create Magic URL session (confirmation)","operationId":"accountUpdateMagicURLSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating the session with the Magic URL. 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\/sessions\/magic-url](\/docs\/client\/account#accountCreateMagicURLSession) 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":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateMagicURLSession","weight":47,"cookies":false,"type":"","demo":"account\/update-magic-u-r-l-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-magic-url-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user..\n","responses":{"301":{"description":"No content"}},"x-appwrite":{"method":"createOAuth2Session","weight":42,"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, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoom.","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":"","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":"","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/phone":{"post":{"summary":"Create Phone session","operationId":"accountCreatePhoneSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [PUT \/account\/sessions\/phone](\/docs\/client\/account#accountUpdatePhoneSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneSession","weight":48,"cookies":false,"type":"","demo":"account\/create-phone-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-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":{"userId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"phone":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null}},"required":["userId","phone"]}}]},"put":{"summary":"Create Phone Session (confirmation)","operationId":"accountUpdatePhoneSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete creating a session with SMS. Use the **userId** from the [createPhoneSession](\/docs\/client\/account#accountCreatePhoneSession) endpoint and the **secret** received via SMS to successfully update and confirm the phone session.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updatePhoneSession","weight":49,"cookies":false,"type":"","demo":"account\/update-phone-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/sessions\/{sessionId}":{"get":{"summary":"Get Session By ID","operationId":"accountGetSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"getSession","weight":56,"cookies":false,"type":"","demo":"account\/get-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to get the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"patch":{"summary":"Update Session (Refresh Tokens)","operationId":"accountUpdateSession","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to \"refresh\" the access token.","responses":{"200":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"updateSession","weight":64,"cookies":false,"type":"","demo":"account\/update-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session ID. Use the string 'current' to update the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]},"delete":{"summary":"Delete 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 Session ID argument, only the unique session ID provided is deleted.\n","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":63,"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 ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/status":{"patch":{"summary":"Update Account Status","operationId":"accountUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.","responses":{"200":{"description":"Account","schema":{"$ref":"#\/definitions\/account"}}},"x-appwrite":{"method":"updateStatus","weight":62,"cookies":false,"type":"","demo":"account\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/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#accountUpdateEmailVerification). 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":68,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"url":{"type":"string","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","default":null,"x-example":"https:\/\/example.com"}},"required":["url"]}}]},"put":{"summary":"Create Email Verification (confirmation)","operationId":"accountUpdateVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updateVerification","weight":69,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/account\/verification\/phone":{"post":{"summary":"Create Phone Verification","operationId":"accountCreatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](\/docs\/client\/account#accountUpdatePhone) endpoint. Learn more about how to [complete the verification process](\/docs\/client\/account#accountUpdatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.","responses":{"201":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"createPhoneVerification","weight":70,"cookies":false,"type":"","demo":"account\/create-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{userId}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]},"put":{"summary":"Create Phone Verification (confirmation)","operationId":"accountUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.","responses":{"200":{"description":"Token","schema":{"$ref":"#\/definitions\/token"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":71,"cookies":false,"type":"","demo":"account\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid verification token.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"avatarsGetBrowser","consumes":["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 [GET \/account\/sessions](\/docs\/client\/account#accountGetSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":73,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":72,"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":76,"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. Country codes follow the [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":74,"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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":75,"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. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":78,"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":"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.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":77,"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 1 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":1,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/databases":{"get":{"summary":"List Databases","operationId":"databasesList","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.","responses":{"200":{"description":"Databases List","schema":{"$ref":"#\/definitions\/databaseList"}}},"x-appwrite":{"method":"list","weight":80,"cookies":false,"type":"","demo":"databases\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Database","operationId":"databasesCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a new Database.\n","responses":{"201":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"create","weight":79,"cookies":false,"type":"","demo":"databases\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"databaseId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DATABASE_ID]","x-global":true},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["databaseId","name"]}}]}},"\/databases\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databasesGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageDatabases","schema":{"$ref":"#\/definitions\/usageDatabases"}}},"x-appwrite":{"method":"getUsage","weight":113,"cookies":false,"type":"","demo":"databases\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"`Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/databases\/{databaseId}":{"get":{"summary":"Get Database","operationId":"databasesGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.","responses":{"200":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"get","weight":81,"cookies":false,"type":"","demo":"databases\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]},"put":{"summary":"Update Database","operationId":"databasesUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Update a database by its unique ID.","responses":{"200":{"description":"Database","schema":{"$ref":"#\/definitions\/database"}}},"x-appwrite":{"method":"update","weight":83,"cookies":false,"type":"","demo":"databases\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_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]"}},"required":["name"]}}]},"delete":{"summary":"Delete Database","operationId":"databasesDelete","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":84,"cookies":false,"type":"","demo":"databases\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections":{"get":{"summary":"List Collections","operationId":"databasesListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":86,"cookies":false,"type":"","demo":"databases\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Collection","operationId":"databasesCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":85,"cookies":false,"type":"","demo":"databases\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"collectionId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[COLLECTION_ID]"},"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permissions":{"type":"array","description":"An array of permissions strings. By default no user is granted with any permissions. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}},"documentSecurity":{"type":"boolean","description":"Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](\/docs\/permissions).","default":false,"x-example":false}},"required":["collectionId","name"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databasesGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"getCollection","weight":87,"cookies":false,"type":"","demo":"databases\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databasesUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Update a collection by its unique ID.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":89,"cookies":false,"type":"","demo":"databases\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"permissions":{"type":"array","description":"An array of permission strings. By default the current permission are inherited. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}},"documentSecurity":{"type":"boolean","description":"Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](\/docs\/permissions).","default":false,"x-example":false},"enabled":{"type":"boolean","description":"Is collection enabled?","default":true,"x-example":false}},"required":["name"]}}]},"delete":{"summary":"Delete Collection","operationId":"databasesDeleteCollection","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteCollection","weight":90,"cookies":false,"type":"","demo":"databases\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes":{"get":{"summary":"List Attributes","operationId":"databasesListAttributes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Attributes List","schema":{"$ref":"#\/definitions\/attributeList"}}},"x-appwrite":{"method":"listAttributes","weight":100,"cookies":false,"type":"","demo":"databases\/list-attributes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean":{"post":{"summary":"Create Boolean Attribute","operationId":"databasesCreateBooleanAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a boolean attribute.\n","responses":{"202":{"description":"AttributeBoolean","schema":{"$ref":"#\/definitions\/attributeBoolean"}}},"x-appwrite":{"method":"createBooleanAttribute","weight":98,"cookies":false,"type":"","demo":"databases\/create-boolean-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":false},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime":{"post":{"summary":"Create DateTime Attribute","operationId":"databasesCreateDatetimeAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"202":{"description":"AttributeDatetime","schema":{"$ref":"#\/definitions\/attributeDatetime"}}},"x-appwrite":{"method":"createDatetimeAttribute","weight":99,"cookies":false,"type":"","demo":"databases\/create-datetime-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for the attribute in ISO 8601 format. Cannot be set when attribute is required.","default":null,"x-example":"2020-10-15T06:38:00.000+00:00"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email":{"post":{"summary":"Create Email Attribute","operationId":"databasesCreateEmailAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create an email attribute.\n","responses":{"202":{"description":"AttributeEmail","schema":{"$ref":"#\/definitions\/attributeEmail"}}},"x-appwrite":{"method":"createEmailAttribute","weight":92,"cookies":false,"type":"","demo":"databases\/create-email-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"email@example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum":{"post":{"summary":"Create Enum Attribute","operationId":"databasesCreateEnumAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"202":{"description":"AttributeEnum","schema":{"$ref":"#\/definitions\/attributeEnum"}}},"x-appwrite":{"method":"createEnumAttribute","weight":93,"cookies":false,"type":"","demo":"databases\/create-enum-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"elements":{"type":"array","description":"Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 4096 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","elements","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float":{"post":{"summary":"Create Float Attribute","operationId":"databasesCreateFloatAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a float attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"202":{"description":"AttributeFloat","schema":{"$ref":"#\/definitions\/attributeFloat"}}},"x-appwrite":{"method":"createFloatAttribute","weight":97,"cookies":false,"type":"","demo":"databases\/create-float-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"number","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"number","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer":{"post":{"summary":"Create Integer Attribute","operationId":"databasesCreateIntegerAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create an integer attribute. Optionally, minimum and maximum values can be provided.\n","responses":{"202":{"description":"AttributeInteger","schema":{"$ref":"#\/definitions\/attributeInteger"}}},"x-appwrite":{"method":"createIntegerAttribute","weight":96,"cookies":false,"type":"","demo":"databases\/create-integer-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"min":{"type":"integer","description":"Minimum value to enforce on new documents","default":null,"x-example":null},"max":{"type":"integer","description":"Maximum value to enforce on new documents","default":null,"x-example":null},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip":{"post":{"summary":"Create IP Address Attribute","operationId":"databasesCreateIpAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create IP address attribute.\n","responses":{"202":{"description":"AttributeIP","schema":{"$ref":"#\/definitions\/attributeIp"}}},"x-appwrite":{"method":"createIpAttribute","weight":94,"cookies":false,"type":"","demo":"databases\/create-ip-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":null},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string":{"post":{"summary":"Create String Attribute","operationId":"databasesCreateStringAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a string attribute.\n","responses":{"202":{"description":"AttributeString","schema":{"$ref":"#\/definitions\/attributeString"}}},"x-appwrite":{"method":"createStringAttribute","weight":91,"cookies":false,"type":"","demo":"databases\/create-string-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"size":{"type":"integer","description":"Attribute size for text attributes, in number of characters.","default":null,"x-example":1},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"[DEFAULT]"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","size","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url":{"post":{"summary":"Create URL Attribute","operationId":"databasesCreateUrlAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a URL attribute.\n","responses":{"202":{"description":"AttributeURL","schema":{"$ref":"#\/definitions\/attributeUrl"}}},"x-appwrite":{"method":"createUrlAttribute","weight":95,"cookies":false,"type":"","demo":"databases\/create-url-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","default":null,"x-example":null},"required":{"type":"boolean","description":"Is attribute required?","default":null,"x-example":false},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","default":null,"x-example":"https:\/\/example.com"},"array":{"type":"boolean","description":"Is attribute an array?","default":false,"x-example":false}},"required":["key","required"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}":{"get":{"summary":"Get Attribute","operationId":"databasesGetAttribute","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"AttributeDatetime, or AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeDatetime, or AttributeString","schema":{"x-oneOf":[{"$ref":"#\/definitions\/attributeDatetime"},{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeDatetime"},{"$ref":"#\/definitions\/attributeString"}]}}},"x-appwrite":{"method":"getAttribute","weight":101,"cookies":false,"type":"","demo":"databases\/get-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Attribute","operationId":"databasesDeleteAttribute","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteAttribute","weight":102,"cookies":false,"type":"","demo":"databases\/delete-attribute.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Attribute Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databasesListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a list of all the user's documents in a given collection. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of documents belonging to the provided collectionId. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":108,"cookies":false,"type":"","demo":"databases\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]},"post":{"summary":"Create Document","operationId":"databasesCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":107,"cookies":false,"type":"","demo":"databases\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md","rate-limit":120,"rate-time":60,"rate-key":"ip:{ip},method:{method},url:{url},userId:{userId}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[DOCUMENT_ID]"},"data":{"type":"object","description":"Document data as JSON object.","default":{},"x-example":"{}"},"permissions":{"type":"array","description":"An array of permissions strings. By default the current user is granted with all permissions. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}}},"required":["documentId","data"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databasesGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get a document by its unique ID. This endpoint response returns a JSON object with the document data.","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"getDocument","weight":109,"cookies":false,"type":"","demo":"databases\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databasesUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.","responses":{"200":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"updateDocument","weight":111,"cookies":false,"type":"","demo":"databases\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md","rate-limit":120,"rate-time":60,"rate-key":"ip:{ip},method:{method},url:{url},userId:{userId}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object. Include only attribute and value pairs to be updated.","default":[],"x-example":"{}"},"permissions":{"type":"array","description":"An array of permissions strings. By default the current permissions are inherited. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete Document","operationId":"databasesDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"Delete a document by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":112,"cookies":false,"type":"","demo":"databases\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md","rate-limit":60,"rate-time":60,"rate-key":"ip:{ip},method:{method},url:{url},userId:{userId}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/logs":{"get":{"summary":"List Document Logs","operationId":"databasesListDocumentLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get the document activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listDocumentLogs","weight":110,"cookies":false,"type":"","demo":"databases\/list-document-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Only supported methods are limit and offset","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes":{"get":{"summary":"List Indexes","operationId":"databasesListIndexes","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Indexes List","schema":{"$ref":"#\/definitions\/indexList"}}},"x-appwrite":{"method":"listIndexes","weight":104,"cookies":false,"type":"","demo":"databases\/list-indexes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"post":{"summary":"Create Index","operationId":"databasesCreateIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"202":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"createIndex","weight":103,"cookies":false,"type":"","demo":"databases\/create-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Index Key.","default":null,"x-example":null},"type":{"type":"string","description":"Index type.","default":null,"x-example":"key"},"attributes":{"type":"array","description":"Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"orders":{"type":"array","description":"Array of index orders. Maximum of 100 orders are allowed.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["key","type","attributes"]}}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}":{"get":{"summary":"Get Index","operationId":"databasesGetIndex","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"Index","schema":{"$ref":"#\/definitions\/index"}}},"x-appwrite":{"method":"getIndex","weight":105,"cookies":false,"type":"","demo":"databases\/get-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]},"delete":{"summary":"Delete Index","operationId":"databasesDeleteIndex","consumes":["application\/json"],"produces":[],"tags":["databases"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteIndex","weight":106,"cookies":false,"type":"","demo":"databases\/delete-index.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"key","description":"Index Key.","required":true,"type":"string","in":"path"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/logs":{"get":{"summary":"List Collection Logs","operationId":"databasesListCollectionLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get the collection activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listCollectionLogs","weight":88,"cookies":false,"type":"","demo":"databases\/list-collection-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Only supported methods are limit and offset","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/databases\/{databaseId}\/collections\/{collectionId}\/usage":{"get":{"summary":"Get usage stats for a collection","operationId":"databasesGetCollectionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageCollection","schema":{"$ref":"#\/definitions\/usageCollection"}}},"x-appwrite":{"method":"getCollectionUsage","weight":115,"cookies":false,"type":"","demo":"databases\/get-collection-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"collectionId","description":"Collection ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/databases\/{databaseId}\/logs":{"get":{"summary":"List Database Logs","operationId":"databasesListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"Get the database activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":82,"cookies":false,"type":"","demo":"databases\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"databases.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Only supported methods are limit and offset","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/databases\/{databaseId}\/usage":{"get":{"summary":"Get usage stats for the database","operationId":"databasesGetDatabaseUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["databases"],"description":"","responses":{"200":{"description":"UsageDatabase","schema":{"$ref":"#\/definitions\/usageDatabase"}}},"x-appwrite":{"method":"getDatabaseUsage","weight":114,"cookies":false,"type":"","demo":"databases\/get-database-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"databaseId","description":"Database ID.","required":true,"x-global":true,"type":"string","x-example":"[DATABASE_ID]","in":"path"},{"name":"range","description":"`Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/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":221,"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":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, status, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Function","operationId":"functionsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function. You can pass a list of [permissions](\/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":220,"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":{"functionId":{"type":"string","description":"Function ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[FUNCTION_ID]"},"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 roles. By default no user is granted with any execute permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 64 characters long.","default":null,"x-example":"[\"any\"]","items":{"type":"string"}},"runtime":{"type":"string","description":"Execution runtime.","default":null,"x-example":"node-14.5"},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Function maximum execution time in seconds.","default":15,"x-example":1}},"required":["functionId","name","execute","runtime"]}}]}},"\/functions\/runtimes":{"get":{"summary":"List runtimes","operationId":"functionsListRuntimes","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all runtimes that are currently active on your instance.","responses":{"200":{"description":"Runtimes List","schema":{"$ref":"#\/definitions\/runtimeList"}}},"x-appwrite":{"method":"listRuntimes","weight":222,"cookies":false,"type":"","demo":"functions\/list-runtimes.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-runtimes.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":[]}]}},"\/functions\/usage":{"get":{"summary":"Get Functions Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getUsage","weight":225,"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":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/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":223,"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 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":226,"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 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 roles. By default no user is granted with any execute permissions. [learn more about permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 64 characters long.","default":null,"x-example":"[\"any\"]","items":{"type":"string"}},"events":{"type":"array","description":"Events list. Maximum of 100 events are allowed.","default":[],"x-example":null,"items":{"type":"string"}},"schedule":{"type":"string","description":"Schedule CRON syntax.","default":"","x-example":null},"timeout":{"type":"integer","description":"Maximum execution time in seconds.","default":15,"x-example":1}},"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":228,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments":{"get":{"summary":"List Deployments","operationId":"functionsListDeployments","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code deployments. You can use the query params to filter your results.","responses":{"200":{"description":"Deployments List","schema":{"$ref":"#\/definitions\/deploymentList"}}},"x-appwrite":{"method":"listDeployments","weight":230,"cookies":false,"type":"","demo":"functions\/list-deployments.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-deployments.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: entrypoint, size, buildId, activate","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Deployment","operationId":"functionsCreateDeployment","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"202":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"createDeployment","weight":229,"cookies":false,"type":"","demo":"functions\/create-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"entrypoint","description":"Entrypoint File.","required":true,"type":"string","x-example":"[ENTRYPOINT]","in":"formData"},{"name":"code","description":"Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.","required":true,"type":"file","in":"formData"},{"name":"activate","description":"Automatically activate the deployment when it is finished building.","required":true,"type":"boolean","x-example":false,"in":"formData"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}":{"get":{"summary":"Get Deployment","operationId":"functionsGetDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code deployment by its unique ID.","responses":{"200":{"description":"Deployment","schema":{"$ref":"#\/definitions\/deployment"}}},"x-appwrite":{"method":"getDeployment","weight":231,"cookies":false,"type":"","demo":"functions\/get-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"patch":{"summary":"Update Function Deployment","operationId":"functionsUpdateDeployment","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateDeployment","weight":227,"cookies":false,"type":"","demo":"functions\/update-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]},"delete":{"summary":"Delete Deployment","operationId":"functionsDeleteDeployment","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code deployment by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDeployment","weight":232,"cookies":false,"type":"","demo":"functions\/delete-deployment.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-deployment.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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/deployments\/{deploymentId}\/builds\/{buildId}":{"post":{"summary":"Retry Build","operationId":"functionsRetryBuild","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"retryBuild","weight":236,"cookies":false,"type":"","demo":"functions\/retry-build.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/retry-build.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"deploymentId","description":"Deployment ID.","required":true,"type":"string","x-example":"[DEPLOYMENT_ID]","in":"path"},{"name":"buildId","description":"Build unique ID.","required":true,"type":"string","x-example":"[BUILD_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":234,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, statusCode, time","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create 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":233,"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":"ip:{ip},userId:{userId}","scope":"execution.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"string","description":"String of custom data to send to function.","default":"","x-example":"[DATA]"},"async":{"type":"boolean","description":"Execute code asynchronously. Default value is true.","default":true,"x-example":false}}}}]}},"\/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":235,"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 ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetFunctionUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"","responses":{"200":{"description":"UsageFunctions","schema":{"$ref":"#\/definitions\/usageFunctions"}}},"x-appwrite":{"method":"getFunctionUsage","weight":224,"cookies":false,"type":"","demo":"functions\/get-function-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 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"}]}},"\/functions\/{functionId}\/variables":{"get":{"summary":"List Variables","operationId":"functionsListVariables","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all variables of a specific function.","responses":{"200":{"description":"Variables List","schema":{"$ref":"#\/definitions\/variableList"}}},"x-appwrite":{"method":"listVariables","weight":238,"cookies":false,"type":"","demo":"functions\/list-variables.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-variables.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":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Variable","operationId":"functionsCreateVariable","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function variable. These variables can be accessed within function in the `env` object under the request variable.","responses":{"201":{"description":"Variable","schema":{"$ref":"#\/definitions\/variable"}}},"x-appwrite":{"method":"createVariable","weight":237,"cookies":false,"type":"","demo":"functions\/create-variable.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-variable.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":{"key":{"type":"string","description":"Variable key. Max length: 255 chars.","default":null,"x-example":"[KEY]"},"value":{"type":"string","description":"Variable value. Max length: 8192 chars.","default":null,"x-example":"[VALUE]"}},"required":["key","value"]}}]}},"\/functions\/{functionId}\/variables\/{variableId}":{"get":{"summary":"Get Variable","operationId":"functionsGetVariable","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a variable by its unique ID.","responses":{"200":{"description":"Variable","schema":{"$ref":"#\/definitions\/variable"}}},"x-appwrite":{"method":"getVariable","weight":239,"cookies":false,"type":"","demo":"functions\/get-variable.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-variable.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":"variableId","description":"Variable unique ID.","required":true,"type":"string","x-example":"[VARIABLE_ID]","in":"path"}]},"put":{"summary":"Update Variable","operationId":"functionsUpdateVariable","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update variable by its unique ID.","responses":{"200":{"description":"Variable","schema":{"$ref":"#\/definitions\/variable"}}},"x-appwrite":{"method":"updateVariable","weight":240,"cookies":false,"type":"","demo":"functions\/update-variable.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-variable.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":"variableId","description":"Variable unique ID.","required":true,"type":"string","x-example":"[VARIABLE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"key":{"type":"string","description":"Variable key. Max length: 255 chars.","default":null,"x-example":"[KEY]"},"value":{"type":"string","description":"Variable value. Max length: 8192 chars.","default":null,"x-example":"[VALUE]"}},"required":["key"]}}]},"delete":{"summary":"Delete Variable","operationId":"functionsDeleteVariable","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a variable by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteVariable","weight":241,"cookies":false,"type":"","demo":"functions\/delete-variable.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-variable.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":"variableId","description":"Variable unique ID.","required":true,"type":"string","x-example":"[VARIABLE_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"healthGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"get","weight":123,"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 Antivirus","operationId":"healthGetAntivirus","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite Antivirus server is up and connection is successful.","responses":{"200":{"description":"Health Antivirus","schema":{"$ref":"#\/definitions\/healthAntivirus"}}},"x-appwrite":{"method":"getAntivirus","weight":133,"cookies":false,"type":"","demo":"health\/get-antivirus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getCache","weight":126,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getDB","weight":125,"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 Certificates Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueCertificates","weight":130,"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":["application\/json"],"tags":["health"],"description":"","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueFunctions","weight":131,"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":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueLogs","weight":129,"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\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"200":{"description":"Health Queue","schema":{"$ref":"#\/definitions\/healthQueue"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":128,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"200":{"description":"Health Status","schema":{"$ref":"#\/definitions\/healthStatus"}}},"x-appwrite":{"method":"getStorageLocal","weight":132,"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":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","responses":{"200":{"description":"Health Time","schema":{"$ref":"#\/definitions\/healthTime"}}},"x-appwrite":{"method":"getTime","weight":127,"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":116,"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":120,"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":117,"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":118,"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":119,"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":121,"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":122,"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":136,"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":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create 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":135,"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":{"projectId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[PROJECT_ID]"},"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":["projectId","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":137,"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":139,"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":144,"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 at least 8 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":142,"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":"integer","description":"Set the max number of users allowed in this project. Use 0 for unlimited.","default":null,"x-example":0}},"required":["limit"]}}]}},"\/projects\/{projectId}\/auth\/{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":143,"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,magic-url,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":162,"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":161,"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":163,"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":165,"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":164,"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":152,"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":151,"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. Maximum of 100 scopes are allowed.","default":null,"x-example":null,"items":{"type":"string"}},"expire":{"type":"string","description":"Expiration time in ISO 8601 format. Use null for unlimited expiration.","default":null,"x-example":"2020-10-15T06:38:00.000+00:00"}},"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":153,"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":154,"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. Maximum of 100 events are allowed.","default":null,"x-example":null,"items":{"type":"string"}},"expire":{"type":"string","description":"Expiration time in ISO 8601 format. Use null for unlimited expiration.","default":null,"x-example":"2020-10-15T06:38:00.000+00:00"}},"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":155,"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":141,"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":157,"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":156,"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 or macOS. Max length: 256 chars.","default":"","x-example":"[KEY]"},"store":{"type":"string","description":"App store or Google Play store ID. Max length: 256 chars.","default":"","x-example":"[STORE]"},"hostname":{"type":"string","description":"Platform client hostname. Max length: 256 chars.","default":"","x-example":null}},"required":["type","name"]}}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"projectsGetPlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"getPlatform","weight":158,"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":159,"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":null}},"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":160,"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}\/service":{"patch":{"summary":"Update service status","operationId":"projectsUpdateServiceStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateServiceStatus","weight":140,"cookies":false,"type":"","demo":"projects\/update-service-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":"payload","in":"body","schema":{"type":"object","properties":{"service":{"type":"string","description":"Service name.","default":null,"x-example":"account"},"status":{"type":"boolean","description":"Service status.","default":null,"x-example":false}},"required":["service","status"]}}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get usage stats for a project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"UsageProject","schema":{"$ref":"#\/definitions\/usageProject"}}},"x-appwrite":{"method":"getUsage","weight":138,"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":146,"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":145,"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. Maximum of 100 events are allowed.","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":147,"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":148,"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. Maximum of 100 events are allowed.","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":150,"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"}]}},"\/projects\/{projectId}\/webhooks\/{webhookId}\/signature":{"patch":{"summary":"Update Webhook Signature Key","operationId":"projectsUpdateWebhookSignature","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"updateWebhookSignature","weight":149,"cookies":false,"type":"","demo":"projects\/update-webhook-signature.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\/buckets":{"get":{"summary":"List buckets","operationId":"storageListBuckets","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the storage buckets. You can use the query params to filter your results.","responses":{"200":{"description":"Buckets List","schema":{"$ref":"#\/definitions\/bucketList"}}},"x-appwrite":{"method":"listBuckets","weight":167,"cookies":false,"type":"","demo":"storage\/list-buckets.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create bucket","operationId":"storageCreateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new storage bucket.","responses":{"201":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"createBucket","weight":166,"cookies":false,"type":"","demo":"storage\/create-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"bucketId":{"type":"string","description":"Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[BUCKET_ID]"},"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permissions":{"type":"array","description":"An array of permission strings. By default no user is granted with any permissions. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}},"fileSecurity":{"type":"boolean","description":"Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](\/docs\/permissions).","default":false,"x-example":false},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":30000000,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"compression":{"type":"string","description":"Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled","default":"none","x-example":"none"},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["bucketId","name"]}}]}},"\/storage\/buckets\/{bucketId}":{"get":{"summary":"Get Bucket","operationId":"storageGetBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"getBucket","weight":168,"cookies":false,"type":"","demo":"storage\/get-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]},"put":{"summary":"Update Bucket","operationId":"storageUpdateBucket","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a storage bucket by its unique ID.","responses":{"200":{"description":"Bucket","schema":{"$ref":"#\/definitions\/bucket"}}},"x-appwrite":{"method":"updateBucket","weight":169,"cookies":false,"type":"","demo":"storage\/update-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Bucket name","default":null,"x-example":"[NAME]"},"permissions":{"type":"array","description":"An array of permission strings. By default the current permissions are inherited. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}},"fileSecurity":{"type":"boolean","description":"Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](\/docs\/permissions).","default":false,"x-example":false},"enabled":{"type":"boolean","description":"Is bucket enabled?","default":true,"x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs\/environment-variables#storage)","default":null,"x-example":1},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.","default":[],"x-example":null,"items":{"type":"string"}},"compression":{"type":"string","description":"Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled","default":"none","x-example":"none"},"encryption":{"type":"boolean","description":"Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled","default":true,"x-example":false},"antivirus":{"type":"boolean","description":"Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled","default":true,"x-example":false}},"required":["name"]}}]},"delete":{"summary":"Delete Bucket","operationId":"storageDeleteBucket","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a storage bucket by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteBucket","weight":170,"cookies":false,"type":"","demo":"storage\/delete-bucket.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"buckets.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"bucketId","description":"Bucket unique ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["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":172,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":171,"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":60,"rate-time":60,"rate-key":"ip:{ip},method:{method},url:{url},userId:{userId}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","required":true,"x-upload-id":true,"type":"string","x-example":"[FILE_ID]","in":"formData"},{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"permissions","description":"An array of permission strings. By default the current user is granted with all permissions. [Learn more about permissions](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"x-example":"[\"read(\"any\")\"]","in":"formData"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["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":173,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"storageUpdateFile","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Update a file by its unique ID. Only users with write permissions have access to update this resource.","responses":{"200":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"updateFile","weight":177,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":60,"rate-time":60,"rate-key":"ip:{ip},method:{method},url:{url},userId:{userId}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"permissions":{"type":"array","description":"An array of permission string. By default the current permissions are inherited. [Learn more about permissions](\/docs\/permissions).","default":null,"x-example":"[\"read(\"any\")\"]","items":{"type":"string"}}}}}]},"delete":{"summary":"Delete File","operationId":"storageDeleteFile","consumes":["application\/json"],"produces":[],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteFile","weight":178,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":60,"rate-time":60,"rate-key":"ip:{ip},method:{method},url:{url},userId:{userId}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["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":175,"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":"bucketId","description":"Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/buckets\/{bucketId}\/files\/{fileId}\/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. Preview is supported only for image files smaller than 10MB.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":174,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"gravity","description":"Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right","required":false,"type":"string","x-example":"center","default":"center","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 -360 and 360.","required":false,"type":"integer","format":"int32","x-example":-360,"default":0,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/buckets\/{bucketId}\/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":176,"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":"bucketId","description":"Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](\/docs\/server\/storage#createBucket).","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"fileId","description":"File ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/usage":{"get":{"summary":"Get usage stats for storage","operationId":"storageGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"StorageUsage","schema":{"$ref":"#\/definitions\/usageStorage"}}},"x-appwrite":{"method":"getUsage","weight":179,"cookies":false,"type":"","demo":"storage\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/storage\/{bucketId}\/usage":{"get":{"summary":"Get usage stats for a storage bucket","operationId":"storageGetBucketUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"","responses":{"200":{"description":"UsageBuckets","schema":{"$ref":"#\/definitions\/usageBuckets"}}},"x-appwrite":{"method":"getBucketUsage","weight":180,"cookies":false,"type":"","demo":"storage\/get-bucket-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"bucketId","description":"Bucket ID.","required":true,"type":"string","x-example":"[BUCKET_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\r\n\r\nIn admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":182,"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":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Team","operationId":"teamsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":181,"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":{"teamId":{"type":"string","description":"Team ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[TEAM_ID]"},"name":{"type":"string","description":"Team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"roles":{"type":"array","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["teamId","name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":183,"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 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 using its ID. Only members with the owner role can update the team.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":184,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"New team name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Team","operationId":"teamsDelete","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"Delete a team using its ID. Only team members with the owner role can delete the team.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":185,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/logs":{"get":{"summary":"List Team Logs","operationId":"teamsListLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get the team activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"listLogs","weight":192,"cookies":false,"type":"","demo":"teams\/list-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Only supported methods are limit and offset","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":187,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.\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 to avoid a [Redirect Attack](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 adding your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":186,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"Email of the new team member.","default":null,"x-example":"email@example.com"},"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). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"URL to redirect the user back to your app from the invitation email. 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"},"name":{"type":"string","description":"Name of the new team member. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"get":{"summary":"Get Team Membership","operationId":"teamsGetMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team member by the membership unique id. All team members have read access for this resource.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMembership","weight":188,"cookies":false,"type":"","demo":"teams\/get-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]},"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](\/docs\/permissions).","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":189,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"roles":{"type":"array","description":"An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["roles"]}}]},"delete":{"summary":"Delete Team Membership","operationId":"teamsDeleteMembership","consumes":["application\/json"],"produces":[],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteMembership","weight":191,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{membershipId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"teamsUpdateMembershipStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":190,"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 ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"membershipId","description":"Membership ID.","required":true,"type":"string","x-example":"[MEMBERSHIP_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/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":201,"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":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create User","operationId":"usersCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"create","weight":193,"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":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"phone":{"type":"string","description":"Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.","default":null,"x-example":null},"password":{"type":"string","description":"Plain text user password. Must be at least 8 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId"]}}]}},"\/users\/argon2":{"post":{"summary":"Create User with Argon2 Password","operationId":"usersCreateArgon2User","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [Argon2](https:\/\/en.wikipedia.org\/wiki\/Argon2) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createArgon2User","weight":196,"cookies":false,"type":"","demo":"users\/create-argon2user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using Argon2.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/bcrypt":{"post":{"summary":"Create User with Bcrypt Password","operationId":"usersCreateBcryptUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [Bcrypt](https:\/\/en.wikipedia.org\/wiki\/Bcrypt) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createBcryptUser","weight":194,"cookies":false,"type":"","demo":"users\/create-bcrypt-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using Bcrypt.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/md5":{"post":{"summary":"Create User with MD5 Password","operationId":"usersCreateMD5User","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [MD5](https:\/\/en.wikipedia.org\/wiki\/MD5) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createMD5User","weight":195,"cookies":false,"type":"","demo":"users\/create-m-d5user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using MD5.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/phpass":{"post":{"summary":"Create User with PHPass Password","operationId":"usersCreatePHPassUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [PHPass](https:\/\/www.openwall.com\/phpass\/) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createPHPassUser","weight":198,"cookies":false,"type":"","demo":"users\/create-p-h-pass-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using PHPass.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/scrypt":{"post":{"summary":"Create User with Scrypt Password","operationId":"usersCreateScryptUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [Scrypt](https:\/\/github.com\/Tarsnap\/scrypt) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createScryptUser","weight":199,"cookies":false,"type":"","demo":"users\/create-scrypt-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using Scrypt.","default":null,"x-example":"password"},"passwordSalt":{"type":"string","description":"Optional salt used to hash password.","default":null,"x-example":"[PASSWORD_SALT]"},"passwordCpu":{"type":"integer","description":"Optional CPU cost used to hash password.","default":null,"x-example":null},"passwordMemory":{"type":"integer","description":"Optional memory cost used to hash password.","default":null,"x-example":null},"passwordParallel":{"type":"integer","description":"Optional parallelization cost used to hash password.","default":null,"x-example":null},"passwordLength":{"type":"integer","description":"Optional hash length used to hash password.","default":null,"x-example":null},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password","passwordSalt","passwordCpu","passwordMemory","passwordParallel","passwordLength"]}}]}},"\/users\/scrypt-modified":{"post":{"summary":"Create User with Scrypt Modified Password","operationId":"usersCreateScryptModifiedUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [Scrypt Modified](https:\/\/gist.github.com\/Meldiron\/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createScryptModifiedUser","weight":200,"cookies":false,"type":"","demo":"users\/create-scrypt-modified-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using Scrypt Modified.","default":null,"x-example":"password"},"passwordSalt":{"type":"string","description":"Salt used to hash password.","default":null,"x-example":"[PASSWORD_SALT]"},"passwordSaltSeparator":{"type":"string","description":"Salt separator used to hash password.","default":null,"x-example":"[PASSWORD_SALT_SEPARATOR]"},"passwordSignerKey":{"type":"string","description":"Signer key used to hash password.","default":null,"x-example":"[PASSWORD_SIGNER_KEY]"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password","passwordSalt","passwordSaltSeparator","passwordSignerKey"]}}]}},"\/users\/sha":{"post":{"summary":"Create User with SHA Password","operationId":"usersCreateSHAUser","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Create a new user. Password provided must be hashed with the [SHA](https:\/\/en.wikipedia.org\/wiki\/Secure_Hash_Algorithm) algorithm. Use the [POST \/users](\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"createSHAUser","weight":197,"cookies":false,"type":"","demo":"users\/create-s-h-a-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID. Choose your own unique ID or pass the string \"unique()\" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.","default":null,"x-example":"[USER_ID]"},"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password hashed using SHA.","default":null,"x-example":"password"},"passwordVersion":{"type":"string","description":"Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512\/224', 'sha512\/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'","default":"","x-example":"sha1"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["userId","email","password"]}}]}},"\/users\/usage":{"get":{"summary":"Get usage stats for the users API","operationId":"usersGetUsage","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"","responses":{"200":{"description":"UsageUsers","schema":{"$ref":"#\/definitions\/usageUsers"}}},"x-appwrite":{"method":"getUsage","weight":219,"cookies":false,"type":"","demo":"users\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"},{"name":"provider","description":"Provider Name.","required":false,"type":"string","x-example":"email","default":"","in":"query"}]}},"\/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":202,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"usersDelete","consumes":["application\/json"],"produces":[],"tags":["users"],"description":"Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](\/docs\/server\/users#usersUpdateStatus) endpoint instead.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":218,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/email":{"patch":{"summary":"Update Email","operationId":"usersUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":212,"cookies":false,"type":"","demo":"users\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"}},"required":["email"]}}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":206,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"queries","description":"Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Only supported methods are limit and offset","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/users\/{userId}\/memberships":{"get":{"summary":"Get User Memberships","operationId":"usersGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get the user membership list by its unique ID.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":205,"cookies":false,"type":"","demo":"users\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-memberships.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/name":{"patch":{"summary":"Update Name","operationId":"usersUpdateName","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user name by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateName","weight":210,"cookies":false,"type":"","demo":"users\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"User name. Max length: 128 chars.","default":null,"x-example":"[NAME]"}},"required":["name"]}}]}},"\/users\/{userId}\/password":{"patch":{"summary":"Update Password","operationId":"usersUpdatePassword","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user password by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":211,"cookies":false,"type":"","demo":"users\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be at least 8 chars.","default":null,"x-example":"password"}},"required":["password"]}}]}},"\/users\/{userId}\/phone":{"patch":{"summary":"Update Phone","operationId":"usersUpdatePhone","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhone","weight":213,"cookies":false,"type":"","demo":"users\/update-phone.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"number":{"type":"string","description":"User phone number.","default":null,"x-example":null}},"required":["number"]}}]}},"\/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":203,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"usersUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":215,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":{},"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"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":204,"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 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":217,"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 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":216,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"Session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":207,"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 ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"boolean","description":"User Status. To activate the user pass `true` and to block the user pass `false`.","default":null,"x-example":false}},"required":["status"]}}]}},"\/users\/{userId}\/verification":{"patch":{"summary":"Update Email Verification","operationId":"usersUpdateEmailVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user email verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmailVerification","weight":214,"cookies":false,"type":"","demo":"users\/update-email-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"emailVerification":{"type":"boolean","description":"User email verification status.","default":null,"x-example":false}},"required":["emailVerification"]}}]}},"\/users\/{userId}\/verification\/phone":{"patch":{"summary":"Update Phone Verification","operationId":"usersUpdatePhoneVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user phone verification status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePhoneVerification","weight":209,"cookies":false,"type":"","demo":"users\/update-phone-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"phoneVerification":{"type":"boolean","description":"User phone verification status.","default":null,"x-example":false}},"required":["phoneVerification"]}}]}}},"tags":[{"name":"account","description":"The Account service allows you to authenticate and manage a user account.","x-globalAttributes":[]},{"name":"avatars","description":"The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.","x-globalAttributes":[]},{"name":"databases","description":"The Databases service allows you to create structured collections of documents, query and filter lists of documents","x-globalAttributes":["databaseId"]},{"name":"locale","description":"The Locale service allows you to customize your app based on your users' location.","x-globalAttributes":[]},{"name":"health","description":"The Health service allows you to both validate and monitor your Appwrite server's health.","x-globalAttributes":[]},{"name":"projects","description":"The Project service allows you to manage all the projects in your Appwrite server.","x-globalAttributes":[]},{"name":"storage","description":"The Storage service allows you to manage your project files.","x-globalAttributes":[]},{"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","x-globalAttributes":[]},{"name":"users","description":"The Users service allows you to manage your project users.","x-globalAttributes":[]},{"name":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions.","x-globalAttributes":[]}],"definitions":{"documentList":{"description":"Documents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of documents documents that matched your query.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["total","documents"]},"collectionList":{"description":"Collections List","type":"object","properties":{"total":{"type":"integer","description":"Total number of collections documents that matched your query.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["total","collections"]},"databaseList":{"description":"Databases List","type":"object","properties":{"total":{"type":"integer","description":"Total number of databases documents that matched your query.","x-example":5,"format":"int32"},"databases":{"type":"array","description":"List of databases.","items":{"type":"object","$ref":"#\/definitions\/database"},"x-example":""}},"required":["total","databases"]},"indexList":{"description":"Indexes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of indexes documents that matched your query.","x-example":5,"format":"int32"},"indexes":{"type":"array","description":"List of indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":""}},"required":["total","indexes"]},"userList":{"description":"Users List","type":"object","properties":{"total":{"type":"integer","description":"Total number of users documents that matched your query.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["total","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of sessions documents that matched your query.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["total","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"total":{"type":"integer","description":"Total number of logs documents that matched your query.","x-example":5,"format":"int32"},"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["total","logs"]},"fileList":{"description":"Files List","type":"object","properties":{"total":{"type":"integer","description":"Total number of files documents that matched your query.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["total","files"]},"bucketList":{"description":"Buckets List","type":"object","properties":{"total":{"type":"integer","description":"Total number of buckets documents that matched your query.","x-example":5,"format":"int32"},"buckets":{"type":"array","description":"List of buckets.","items":{"type":"object","$ref":"#\/definitions\/bucket"},"x-example":""}},"required":["total","buckets"]},"teamList":{"description":"Teams List","type":"object","properties":{"total":{"type":"integer","description":"Total number of teams documents that matched your query.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["total","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"total":{"type":"integer","description":"Total number of memberships documents that matched your query.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["total","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of functions documents that matched your query.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["total","functions"]},"runtimeList":{"description":"Runtimes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of runtimes documents that matched your query.","x-example":5,"format":"int32"},"runtimes":{"type":"array","description":"List of runtimes.","items":{"type":"object","$ref":"#\/definitions\/runtime"},"x-example":""}},"required":["total","runtimes"]},"deploymentList":{"description":"Deployments List","type":"object","properties":{"total":{"type":"integer","description":"Total number of deployments documents that matched your query.","x-example":5,"format":"int32"},"deployments":{"type":"array","description":"List of deployments.","items":{"type":"object","$ref":"#\/definitions\/deployment"},"x-example":""}},"required":["total","deployments"]},"executionList":{"description":"Executions List","type":"object","properties":{"total":{"type":"integer","description":"Total number of executions documents that matched your query.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["total","executions"]},"projectList":{"description":"Projects List","type":"object","properties":{"total":{"type":"integer","description":"Total number of projects documents that matched your query.","x-example":5,"format":"int32"},"projects":{"type":"array","description":"List of projects.","items":{"type":"object","$ref":"#\/definitions\/project"},"x-example":""}},"required":["total","projects"]},"webhookList":{"description":"Webhooks List","type":"object","properties":{"total":{"type":"integer","description":"Total number of webhooks documents that matched your query.","x-example":5,"format":"int32"},"webhooks":{"type":"array","description":"List of webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"},"x-example":""}},"required":["total","webhooks"]},"keyList":{"description":"API Keys List","type":"object","properties":{"total":{"type":"integer","description":"Total number of keys documents that matched your query.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["total","keys"]},"platformList":{"description":"Platforms List","type":"object","properties":{"total":{"type":"integer","description":"Total number of platforms documents that matched your query.","x-example":5,"format":"int32"},"platforms":{"type":"array","description":"List of platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"},"x-example":""}},"required":["total","platforms"]},"domainList":{"description":"Domains List","type":"object","properties":{"total":{"type":"integer","description":"Total number of domains documents that matched your query.","x-example":5,"format":"int32"},"domains":{"type":"array","description":"List of domains.","items":{"type":"object","$ref":"#\/definitions\/domain"},"x-example":""}},"required":["total","domains"]},"countryList":{"description":"Countries List","type":"object","properties":{"total":{"type":"integer","description":"Total number of countries documents that matched your query.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["total","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"total":{"type":"integer","description":"Total number of continents documents that matched your query.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["total","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"total":{"type":"integer","description":"Total number of languages documents that matched your query.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["total","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"total":{"type":"integer","description":"Total number of currencies documents that matched your query.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["total","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"total":{"type":"integer","description":"Total number of phones documents that matched your query.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["total","phones"]},"metricList":{"description":"Metric List","type":"object","properties":{"total":{"type":"integer","description":"Total number of metrics documents that matched your query.","x-example":5,"format":"int32"},"metrics":{"type":"array","description":"List of metrics.","items":{"type":"object","$ref":"#\/definitions\/metric"},"x-example":""}},"required":["total","metrics"]},"variableList":{"description":"Variables List","type":"object","properties":{"total":{"type":"integer","description":"Total number of variables documents that matched your query.","x-example":5,"format":"int32"},"variables":{"type":"array","description":"List of variables.","items":{"type":"object","$ref":"#\/definitions\/variable"},"x-example":""}},"required":["total","variables"]},"database":{"description":"Database","type":"object","properties":{"$id":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Database name.","x-example":"My Database"},"$createdAt":{"type":"string","description":"Database creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Database update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"}},"required":["$id","name","$createdAt","$updatedAt"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Collection creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Collection update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$permissions":{"type":"array","description":"Collection permissions. [Learn more about permissions](\/docs\/permissions).","items":{"type":"string"},"x-example":["read(\"any\")"]},"databaseId":{"type":"string","description":"Database ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Collection name.","x-example":"My Collection"},"enabled":{"type":"boolean","description":"Collection enabled.","x-example":false},"documentSecurity":{"type":"boolean","description":"Whether document-level permissions are enabled. [Learn more about permissions](\/docs\/permissions).","x-example":true},"attributes":{"type":"array","description":"Collection attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeDatetime"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":{}},"indexes":{"type":"array","description":"Collection indexes.","items":{"type":"object","$ref":"#\/definitions\/index"},"x-example":{}}},"required":["$id","$createdAt","$updatedAt","$permissions","databaseId","name","enabled","documentSecurity","attributes","indexes"]},"attributeList":{"description":"Attributes List","type":"object","properties":{"total":{"type":"integer","description":"Total number of attributes in the given collection.","x-example":5,"format":"int32"},"attributes":{"type":"array","description":"List of attributes.","items":{"x-anyOf":[{"$ref":"#\/definitions\/attributeBoolean"},{"$ref":"#\/definitions\/attributeInteger"},{"$ref":"#\/definitions\/attributeFloat"},{"$ref":"#\/definitions\/attributeEmail"},{"$ref":"#\/definitions\/attributeEnum"},{"$ref":"#\/definitions\/attributeUrl"},{"$ref":"#\/definitions\/attributeIp"},{"$ref":"#\/definitions\/attributeDatetime"},{"$ref":"#\/definitions\/attributeString"}]},"x-example":""}},"required":["total","attributes"]},"attributeString":{"description":"AttributeString","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"fullName"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"size":{"type":"integer","description":"Attribute size.","x-example":128,"format":"int32"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default","x-nullable":true}},"required":["key","type","status","required","size"]},"attributeInteger":{"description":"AttributeInteger","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"count"},"type":{"type":"string","description":"Attribute type.","x-example":"integer"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"integer","description":"Minimum value to enforce for new documents.","x-example":1,"format":"int32","x-nullable":true},"max":{"type":"integer","description":"Maximum value to enforce for new documents.","x-example":10,"format":"int32","x-nullable":true},"default":{"type":"integer","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":10,"format":"int32","x-nullable":true}},"required":["key","type","status","required"]},"attributeFloat":{"description":"AttributeFloat","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"percentageCompleted"},"type":{"type":"string","description":"Attribute type.","x-example":"double"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"min":{"type":"number","description":"Minimum value to enforce for new documents.","x-example":1.5,"format":"double","x-nullable":true},"max":{"type":"number","description":"Maximum value to enforce for new documents.","x-example":10.5,"format":"double","x-nullable":true},"default":{"type":"number","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":2.5,"format":"double","x-nullable":true}},"required":["key","type","status","required"]},"attributeBoolean":{"description":"AttributeBoolean","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"isEnabled"},"type":{"type":"string","description":"Attribute type.","x-example":"boolean"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"default":{"type":"boolean","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":false,"x-nullable":true}},"required":["key","type","status","required"]},"attributeEmail":{"description":"AttributeEmail","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"userEmail"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"email"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"default@example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeEnum":{"description":"AttributeEnum","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"status"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"elements":{"type":"array","description":"Array of elements in enumerated type.","items":{"type":"string"},"x-example":"element"},"format":{"type":"string","description":"String format.","x-example":"enum"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"element","x-nullable":true}},"required":["key","type","status","required","elements","format"]},"attributeIp":{"description":"AttributeIP","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"ipAddress"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"ip"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"192.0.2.0","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeUrl":{"description":"AttributeURL","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"githubUrl"},"type":{"type":"string","description":"Attribute type.","x-example":"string"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"String format.","x-example":"url"},"default":{"type":"string","description":"Default value for attribute when not provided. Cannot be set when attribute is required.","x-example":"http:\/\/example.com","x-nullable":true}},"required":["key","type","status","required","format"]},"attributeDatetime":{"description":"AttributeDatetime","type":"object","properties":{"key":{"type":"string","description":"Attribute Key.","x-example":"birthDay"},"type":{"type":"string","description":"Attribute type.","x-example":"2020-10-15T06:38:00.000+00:00"},"status":{"type":"string","description":"Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"required":{"type":"boolean","description":"Is attribute required?","x-example":true},"array":{"type":"boolean","description":"Is attribute an array?","x-example":false,"x-nullable":true},"format":{"type":"string","description":"ISO 8601 format.","x-example":"datetime"},"default":{"type":"string","description":"Default value for attribute when not provided. Only null is optional","x-example":"2020-10-15T06:38:00.000+00:00","x-nullable":true}},"required":["key","type","status","required","format"]},"index":{"description":"Index","type":"object","properties":{"key":{"type":"string","description":"Index Key.","x-example":"index1"},"type":{"type":"string","description":"Index type.","x-example":"primary"},"status":{"type":"string","description":"Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`","x-example":"available"},"attributes":{"type":"array","description":"Index attributes.","items":{"type":"string"},"x-example":[]},"orders":{"type":"array","description":"Index orders.","items":{"type":"string"},"x-example":[],"x-nullable":true}},"required":["key","type","status","attributes"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$createdAt":{"type":"string","description":"Document creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Document update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$permissions":{"type":"array","description":"Document permissions. [Learn more about permissions](\/docs\/permissions).","items":{"type":"string"},"x-example":["read(\"any\")"]}},"additionalProperties":true,"required":["$id","$collection","$createdAt","$updatedAt","$permissions"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"userId":{"type":"string","description":"User ID.","x-example":"610fc2f985ee0"},"userEmail":{"type":"string","description":"User Email.","x-example":"john@appwrite.io"},"userName":{"type":"string","description":"User Name.","x-example":"John Doe"},"mode":{"type":"string","description":"API mode when event triggered.","x-example":"admin"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"string","description":"Log creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["event","userId","userEmail","userName","mode","ip","time","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName"]},"user":{"description":"User","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"User creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"User update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"password":{"type":"string","description":"Hashed user password.","x-example":"$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE"},"hash":{"type":"string","description":"Password hashing algorithm.","x-example":"argon2"},"hashOptions":{"type":"object","description":"Password hashing algorithm configuration.","x-example":{},"items":{"x-oneOf":[{"$ref":"#\/definitions\/algoArgon2"},{"$ref":"#\/definitions\/algoScrypt"},{"$ref":"#\/definitions\/algoScryptModified"},{"$ref":"#\/definitions\/algoBcrypt"},{"$ref":"#\/definitions\/algoPhpass"},{"$ref":"#\/definitions\/algoSha"},{"$ref":"#\/definitions\/algoMd5"}]}},"registration":{"type":"string","description":"User registration date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"status":{"type":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"passwordUpdate":{"type":"string","description":"Password update time in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"phone":{"type":"string","description":"User phone number in E.164 format.","x-example":"+4930901820"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"phoneVerification":{"type":"boolean","description":"Phone verification status.","x-example":true},"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","$createdAt","$updatedAt","name","password","hash","hashOptions","registration","status","passwordUpdate","email","phone","emailVerification","phoneVerification","prefs"]},"algoMd5":{"description":"AlgoMD5","type":"object"},"algoSha":{"description":"AlgoSHA","type":"object"},"algoPhpass":{"description":"AlgoPHPass","type":"object"},"algoBcrypt":{"description":"AlgoBcrypt","type":"object"},"algoScrypt":{"description":"AlgoScrypt","type":"object","properties":{"costCpu":{"type":"integer","description":"CPU complexity of computed hash.","x-example":8,"format":"int32"},"costMemory":{"type":"integer","description":"Memory complexity of computed hash.","x-example":14,"format":"int32"},"costParallel":{"type":"integer","description":"Parallelization of computed hash.","x-example":1,"format":"int32"},"length":{"type":"integer","description":"Length used to compute hash.","x-example":1,"format":"int32"}},"required":["costCpu","costMemory","costParallel","length"]},"algoScryptModified":{"description":"AlgoScryptModified","type":"object","properties":{"salt":{"type":"string","description":"Salt used to compute hash.","x-example":"UxLMreBr6tYyjQ=="},"saltSeparator":{"type":"string","description":"Separator used to compute hash.","x-example":"Bw=="},"signerKey":{"type":"string","description":"Key used to compute hash.","x-example":"XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ=="}},"required":["salt","saltSeparator","signerKey"]},"algoArgon2":{"description":"AlgoArgon2","type":"object","properties":{"memoryCost":{"type":"integer","description":"Memory used to compute hash.","x-example":65536,"format":"int32"},"timeCost":{"type":"integer","description":"Amount of time consumed to compute hash","x-example":4,"format":"int32"},"threads":{"type":"integer","description":"Number of threads used to compute hash.","x-example":3,"format":"int32"}},"required":["memoryCost","timeCost","threads"]},"account":{"description":"Account","type":"object","properties":{"$id":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"User creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"User update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"string","description":"User registration date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"status":{"type":"boolean","description":"User status. Pass `true` for enabled and `false` for disabled.","x-example":true},"passwordUpdate":{"type":"string","description":"Password update time in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"phone":{"type":"string","description":"User phone number in E.164 format.","x-example":"+4930901820"},"emailVerification":{"type":"boolean","description":"Email verification status.","x-example":true},"phoneVerification":{"type":"boolean","description":"Phone verification status.","x-example":true},"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","$createdAt","$updatedAt","name","registration","status","passwordUpdate","email","phone","emailVerification","phoneVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Session creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"userId":{"type":"string","description":"User ID.","x-example":"5e5bb8c16897e"},"expire":{"type":"string","description":"Session expiration date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"provider":{"type":"string","description":"Session Provider.","x-example":"email"},"providerUid":{"type":"string","description":"Session Provider User ID.","x-example":"user@example.com"},"providerAccessToken":{"type":"string","description":"Session Provider Access Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"providerAccessTokenExpiry":{"type":"string","description":"The date of when the access token expires in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"providerRefreshToken":{"type":"string","description":"Session Provider Refresh Token.","x-example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"ip":{"type":"string","description":"IP in use when the session was created.","x-example":"127.0.0.1"},"osCode":{"type":"string","description":"Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).","x-example":"Mac"},"osName":{"type":"string","description":"Operating system name.","x-example":"Mac"},"osVersion":{"type":"string","description":"Operating system version.","x-example":"Mac"},"clientType":{"type":"string","description":"Client type.","x-example":"browser"},"clientCode":{"type":"string","description":"Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).","x-example":"CM"},"clientName":{"type":"string","description":"Client name.","x-example":"Chrome Mobile iOS"},"clientVersion":{"type":"string","description":"Client version.","x-example":"84.0"},"clientEngine":{"type":"string","description":"Client engine name.","x-example":"WebKit"},"clientEngineVersion":{"type":"string","description":"Client engine name.","x-example":"605.1.15"},"deviceName":{"type":"string","description":"Device name.","x-example":"smartphone"},"deviceBrand":{"type":"string","description":"Device brand name.","x-example":"Google"},"deviceModel":{"type":"string","description":"Device model name.","x-example":"Nexus 5"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"},"current":{"type":"boolean","description":"Returns true if this the current user session.","x-example":true}},"required":["$id","$createdAt","userId","expire","provider","providerUid","providerAccessToken","providerAccessTokenExpiry","providerRefreshToken","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"},"$createdAt":{"type":"string","description":"Token creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c168bb8"},"secret":{"type":"string","description":"Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.","x-example":""},"expire":{"type":"string","description":"Token expiration date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"}},"required":["$id","$createdAt","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"},"bucketId":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"File creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"File update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$permissions":{"type":"array","description":"File permissions. [Learn more about permissions](\/docs\/permissions).","items":{"type":"string"},"x-example":["read(\"any\")"]},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"signature":{"type":"string","description":"File MD5 signature.","x-example":"5d529fd02b544198ae075bd57c1762bb"},"mimeType":{"type":"string","description":"File mime type.","x-example":"image\/png"},"sizeOriginal":{"type":"integer","description":"File original size in bytes.","x-example":17890,"format":"int32"},"chunksTotal":{"type":"integer","description":"Total number of chunks available","x-example":17890,"format":"int32"},"chunksUploaded":{"type":"integer","description":"Total number of chunks uploaded","x-example":17890,"format":"int32"}},"required":["$id","bucketId","$createdAt","$updatedAt","$permissions","name","signature","mimeType","sizeOriginal","chunksTotal","chunksUploaded"]},"bucket":{"description":"Bucket","type":"object","properties":{"$id":{"type":"string","description":"Bucket ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Bucket creation time in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Bucket update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$permissions":{"type":"array","description":"Bucket permissions. [Learn more about permissions](\/docs\/permissions).","items":{"type":"string"},"x-example":["read(\"any\")"]},"fileSecurity":{"type":"string","description":"Whether file-level security is enabled. [Learn more about permissions](\/docs\/permissions).","x-example":true},"name":{"type":"string","description":"Bucket name.","x-example":"Documents"},"enabled":{"type":"boolean","description":"Bucket enabled.","x-example":false},"maximumFileSize":{"type":"integer","description":"Maximum file size supported.","x-example":100,"format":"int32"},"allowedFileExtensions":{"type":"array","description":"Allowed file extensions.","items":{"type":"string"},"x-example":["jpg","png"]},"compression":{"type":"string","description":"Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).","x-example":"gzip"},"encryption":{"type":"boolean","description":"Bucket is encrypted.","x-example":false},"antivirus":{"type":"boolean","description":"Virus scanning is enabled.","x-example":false}},"required":["$id","$createdAt","$updatedAt","$permissions","fileSecurity","name","enabled","maximumFileSize","allowedFileExtensions","compression","encryption","antivirus"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Team creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Team update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"total":{"type":"integer","description":"Total number of team members.","x-example":7,"format":"int32"}},"required":["$id","$createdAt","$updatedAt","name","total"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Membership creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Membership update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"userName":{"type":"string","description":"User name.","x-example":"John Doe"},"userEmail":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"teamName":{"type":"string","description":"Team name.","x-example":"VIP"},"invited":{"type":"string","description":"Date, the user has been invited to join the team in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"joined":{"type":"string","description":"Date, the user has accepted the invitation to join the team in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"},"x-example":"admin"}},"required":["$id","$createdAt","$updatedAt","userId","userName","userEmail","teamId","teamName","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Function creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Function update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"execute":{"type":"array","description":"Execution permissions.","items":{"type":"string"},"x-example":"users"},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"status":{"type":"string","description":"Function status. Possible values: `disabled`, `enabled`","x-example":"enabled"},"runtime":{"type":"string","description":"Function execution runtime.","x-example":"python-3.8"},"deployment":{"type":"string","description":"Function's active deployment ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"array","description":"Function variables.","items":{"type":"object","$ref":"#\/definitions\/variable"},"x-example":[]},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"},"x-example":"account.create"},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"string","description":"Function's next scheduled execution time in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"schedulePrevious":{"type":"string","description":"Function's previous scheduled execution time in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","$createdAt","$updatedAt","execute","name","status","runtime","deployment","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"runtime":{"description":"Runtime","type":"object","properties":{"$id":{"type":"string","description":"Runtime ID.","x-example":"python-3.8"},"name":{"type":"string","description":"Runtime Name.","x-example":"Python"},"version":{"type":"string","description":"Runtime version.","x-example":"3.8"},"base":{"type":"string","description":"Base Docker image used to build the runtime.","x-example":"python:3.8-alpine"},"image":{"type":"string","description":"Image name of Docker Hub.","x-example":"appwrite\\\/runtime-for-python:3.8"},"logo":{"type":"string","description":"Name of the logo image.","x-example":"python.png"},"supports":{"type":"array","description":"List of supported architectures.","items":{"type":"string"},"x-example":"amd64"}},"required":["$id","name","version","base","image","logo","supports"]},"deployment":{"description":"Deployment","type":"object","properties":{"$id":{"type":"string","description":"Deployment ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Deployment creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Deployment update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"resourceId":{"type":"string","description":"Resource ID.","x-example":"5e5ea6g16897e"},"resourceType":{"type":"string","description":"Resource type.","x-example":"functions"},"entrypoint":{"type":"string","description":"The entrypoint file to use to execute the deployment code.","x-example":"enabled"},"size":{"type":"integer","description":"The code size in bytes.","x-example":128,"format":"int32"},"buildId":{"type":"string","description":"The current build ID.","x-example":"5e5ea5c16897e"},"activate":{"type":"boolean","description":"Whether the deployment should be automatically activated.","x-example":true},"status":{"type":"string","description":"The deployment status. Possible values are \"processing\", \"building\", \"pending\", \"ready\", and \"failed\".","x-example":"ready"},"buildStdout":{"type":"string","description":"The build stdout.","x-example":"enabled"},"buildStderr":{"type":"string","description":"The build stderr.","x-example":"enabled"}},"required":["$id","$createdAt","$updatedAt","resourceId","resourceType","entrypoint","size","buildId","activate","status","buildStdout","buildStderr"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Execution creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Execution upate date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$permissions":{"type":"array","description":"Execution roles.","items":{"type":"string"},"x-example":["any"]},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"trigger":{"type":"string","description":"The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.","x-example":"http"},"status":{"type":"string","description":"The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.","x-example":"processing"},"statusCode":{"type":"integer","description":"The script status code.","x-example":0,"format":"int32"},"response":{"type":"string","description":"The script response output string. Logs the last 4,000 characters of the execution response output.","x-example":""},"stdout":{"type":"string","description":"The script stdout output string. Logs the last 4,000 characters of the execution stdout output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string. Logs the last 4,000 characters of the execution stderr output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"double"}},"required":["$id","$createdAt","$updatedAt","$permissions","functionId","trigger","status","statusCode","response","stdout","stderr","time"]},"project":{"description":"Project","type":"object","properties":{"$id":{"type":"string","description":"Project ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Project creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Project update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"Project name.","x-example":"New Project"},"description":{"type":"string","description":"Project description.","x-example":"This is a new project."},"teamId":{"type":"string","description":"Project team ID.","x-example":"1592981250"},"logo":{"type":"string","description":"Project logo file ID.","x-example":"5f5c451b403cb"},"url":{"type":"string","description":"Project website URL.","x-example":"5f5c451b403cb"},"legalName":{"type":"string","description":"Company legal name.","x-example":"Company LTD."},"legalCountry":{"type":"string","description":"Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format.","x-example":"US"},"legalState":{"type":"string","description":"State name.","x-example":"New York"},"legalCity":{"type":"string","description":"City name.","x-example":"New York City."},"legalAddress":{"type":"string","description":"Company Address.","x-example":"620 Eighth Avenue, New York, NY 10018"},"legalTaxId":{"type":"string","description":"Company Tax ID.","x-example":"131102020"},"authLimit":{"type":"integer","description":"Max users allowed. 0 is unlimited.","x-example":100,"format":"int32"},"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":{}},"providerAmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"providerAmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"providerAppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAuth0Appid":{"type":"string","description":"Auth0 OAuth app ID.","x-example":"123247283472834787438"},"providerAuth0Secret":{"type":"string","description":"Auth0 OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAuthentikAppid":{"type":"string","description":"Authentik OAuth app ID.","x-example":"123247283472834787438"},"providerAuthentikSecret":{"type":"string","description":"Authentik OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerAutodeskAppid":{"type":"string","description":"Autodesk OAuth app ID.","x-example":"123247283472834787438"},"providerAutodeskSecret":{"type":"string","description":"Autodesk OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"providerBitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"providerBitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerBoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"providerBoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDailymotionAppid":{"type":"string","description":"Dailymotion OAuth app ID.","x-example":"123247283472834787438"},"providerDailymotionSecret":{"type":"string","description":"Dailymotion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"providerDiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDisqusAppid":{"type":"string","description":"Disqus OAuth app ID.","x-example":"123247283472834787438"},"providerDisqusSecret":{"type":"string","description":"Disqus OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerDropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"providerDropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerEtsyAppid":{"type":"string","description":"Etsy OAuth app ID.","x-example":"123247283472834787438"},"providerEtsySecret":{"type":"string","description":"Etsy OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerFacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"providerFacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"providerGithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"providerGitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerGoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"providerGoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerLinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"providerLinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"providerMicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerNotionAppid":{"type":"string","description":"Notion OAuth app ID.","x-example":"123247283472834787438"},"providerNotionSecret":{"type":"string","description":"Notion OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerOktaAppid":{"type":"string","description":"Okta OAuth app ID.","x-example":"123247283472834787438"},"providerOktaSecret":{"type":"string","description":"Okta OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"providerPaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerPodioAppid":{"type":"string","description":"Podio OAuth app ID.","x-example":"123247283472834787438"},"providerPodioSecret":{"type":"string","description":"Podio OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"providerSalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"providerSlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerSpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"providerSpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerStripeAppid":{"type":"string","description":"Stripe OAuth app ID.","x-example":"123247283472834787438"},"providerStripeSecret":{"type":"string","description":"Stripe OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"providerTradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerTwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"providerTwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerWordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"providerWordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"providerYahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYammerAppid":{"type":"string","description":"Yammer OAuth app ID.","x-example":"123247283472834787438"},"providerYammerSecret":{"type":"string","description":"Yammer OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerYandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"providerYandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerZoomAppid":{"type":"string","description":"Zoom OAuth app ID.","x-example":"123247283472834787438"},"providerZoomSecret":{"type":"string","description":"Zoom OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"providerMockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"providerMockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"authEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"authUsersAuthMagicURL":{"type":"boolean","description":"Magic URL auth method status","x-example":true},"authAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"authInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"authJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"authPhone":{"type":"boolean","description":"Phone auth method status","x-example":true},"serviceStatusForAccount":{"type":"boolean","description":"Account service status","x-example":true},"serviceStatusForAvatars":{"type":"boolean","description":"Avatars service status","x-example":true},"serviceStatusForDatabases":{"type":"boolean","description":"Databases service status","x-example":true},"serviceStatusForLocale":{"type":"boolean","description":"Locale service status","x-example":true},"serviceStatusForHealth":{"type":"boolean","description":"Health service status","x-example":true},"serviceStatusForStorage":{"type":"boolean","description":"Storage service status","x-example":true},"serviceStatusForTeams":{"type":"boolean","description":"Teams service status","x-example":true},"serviceStatusForUsers":{"type":"boolean","description":"Users service status","x-example":true},"serviceStatusForFunctions":{"type":"boolean","description":"Functions service status","x-example":true}},"required":["$id","$createdAt","$updatedAt","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","authLimit","platforms","webhooks","keys","domains","providerAmazonAppid","providerAmazonSecret","providerAppleAppid","providerAppleSecret","providerAuth0Appid","providerAuth0Secret","providerAuthentikAppid","providerAuthentikSecret","providerAutodeskAppid","providerAutodeskSecret","providerBitbucketAppid","providerBitbucketSecret","providerBitlyAppid","providerBitlySecret","providerBoxAppid","providerBoxSecret","providerDailymotionAppid","providerDailymotionSecret","providerDiscordAppid","providerDiscordSecret","providerDisqusAppid","providerDisqusSecret","providerDropboxAppid","providerDropboxSecret","providerEtsyAppid","providerEtsySecret","providerFacebookAppid","providerFacebookSecret","providerGithubAppid","providerGithubSecret","providerGitlabAppid","providerGitlabSecret","providerGoogleAppid","providerGoogleSecret","providerLinkedinAppid","providerLinkedinSecret","providerMicrosoftAppid","providerMicrosoftSecret","providerNotionAppid","providerNotionSecret","providerOktaAppid","providerOktaSecret","providerPaypalAppid","providerPaypalSecret","providerPaypalSandboxAppid","providerPaypalSandboxSecret","providerPodioAppid","providerPodioSecret","providerSalesforceAppid","providerSalesforceSecret","providerSlackAppid","providerSlackSecret","providerSpotifyAppid","providerSpotifySecret","providerStripeAppid","providerStripeSecret","providerTradeshiftAppid","providerTradeshiftSecret","providerTradeshiftBoxAppid","providerTradeshiftBoxSecret","providerTwitchAppid","providerTwitchSecret","providerWordpressAppid","providerWordpressSecret","providerYahooAppid","providerYahooSecret","providerYammerAppid","providerYammerSecret","providerYandexAppid","providerYandexSecret","providerZoomAppid","providerZoomSecret","providerMockAppid","providerMockSecret","authEmailPassword","authUsersAuthMagicURL","authAnonymous","authInvites","authJWT","authPhone","serviceStatusForAccount","serviceStatusForAvatars","serviceStatusForDatabases","serviceStatusForLocale","serviceStatusForHealth","serviceStatusForStorage","serviceStatusForTeams","serviceStatusForUsers","serviceStatusForFunctions"]},"webhook":{"description":"Webhook","type":"object","properties":{"$id":{"type":"string","description":"Webhook ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Webhook creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Webhook update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"Webhook name.","x-example":"My Webhook"},"url":{"type":"string","description":"Webhook URL endpoint.","x-example":"https:\/\/example.com\/webhook"},"events":{"type":"array","description":"Webhook trigger events.","items":{"type":"string"},"x-example":"database.collections.update"},"security":{"type":"boolean","description":"Indicated if SSL \/ TLS Certificate verification is enabled.","x-example":true},"httpUser":{"type":"string","description":"HTTP basic authentication username.","x-example":"username"},"httpPass":{"type":"string","description":"HTTP basic authentication password.","x-example":"password"},"signatureKey":{"type":"string","description":"Signature key which can be used to validated incoming","x-example":"ad3d581ca230e2b7059c545e5a"}},"required":["$id","$createdAt","$updatedAt","name","url","events","security","httpUser","httpPass","signatureKey"]},"key":{"description":"Key","type":"object","properties":{"$id":{"type":"string","description":"Key ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Key creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Key update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"Key name.","x-example":"My API Key"},"expire":{"type":"string","description":"Key expiration date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"scopes":{"type":"array","description":"Allowed permission scopes.","items":{"type":"string"},"x-example":"users.read"},"secret":{"type":"string","description":"Secret key.","x-example":"919c2d18fb5d4...a2ae413da83346ad2"},"accessedAt":{"type":"string","description":"Most recent access date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"sdks":{"type":"array","description":"List of SDK user agents that used this key.","items":{"type":"string"},"x-example":"appwrite:flutter"}},"required":["$id","$createdAt","$updatedAt","name","expire","scopes","secret","accessedAt","sdks"]},"domain":{"description":"Domain","type":"object","properties":{"$id":{"type":"string","description":"Domain ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Domain creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Domain update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"domain":{"type":"string","description":"Domain name.","x-example":"appwrite.company.com"},"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","$createdAt","$updatedAt","domain","registerable","tld","verification","certificateId"]},"platform":{"description":"Platform","type":"object","properties":{"$id":{"type":"string","description":"Platform ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Platform creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Platform update date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"name":{"type":"string","description":"Platform name.","x-example":"My Web App"},"type":{"type":"string","description":"Platform type. Possible values are: web, flutter-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","$createdAt","$updatedAt","name","type","key","store","hostname","httpUser","httpPass"]},"variable":{"description":"Variable","type":"object","properties":{"$id":{"type":"string","description":"Variable ID.","x-example":"5e5ea5c16897e"},"$createdAt":{"type":"string","description":"Variable creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"$updatedAt":{"type":"string","description":"Variable creation date in ISO 8601 format.","x-example":"2020-10-15T06:38:00.000+00:00"},"key":{"type":"string","description":"Variable key.","x-example":"API_KEY"},"value":{"type":"string","description":"Variable value.","x-example":"myPa$$word1"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"}},"required":["$id","$createdAt","$updatedAt","key","value","functionId"]},"country":{"description":"Country","type":"object","properties":{"name":{"type":"string","description":"Country name.","x-example":"United States"},"code":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"}},"required":["name","code"]},"continent":{"description":"Continent","type":"object","properties":{"name":{"type":"string","description":"Continent name.","x-example":"Europe"},"code":{"type":"string","description":"Continent two letter code.","x-example":"EU"}},"required":["name","code"]},"language":{"description":"Language","type":"object","properties":{"name":{"type":"string","description":"Language name.","x-example":"Italian"},"code":{"type":"string","description":"Language two-character ISO 639-1 codes.","x-example":"it"},"nativeName":{"type":"string","description":"Language native name.","x-example":"Italiano"}},"required":["name","code","nativeName"]},"currency":{"description":"Currency","type":"object","properties":{"symbol":{"type":"string","description":"Currency symbol.","x-example":"$"},"name":{"type":"string","description":"Currency name.","x-example":"US dollar"},"symbolNative":{"type":"string","description":"Currency native symbol.","x-example":"$"},"decimalDigits":{"type":"integer","description":"Number of decimal digits.","x-example":2,"format":"int32"},"rounding":{"type":"number","description":"Currency digit rounding.","x-example":0,"format":"double"},"code":{"type":"string","description":"Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.","x-example":"USD"},"namePlural":{"type":"string","description":"Currency plural name","x-example":"US dollars"}},"required":["symbol","name","symbolNative","decimalDigits","rounding","code","namePlural"]},"phone":{"description":"Phone","type":"object","properties":{"code":{"type":"string","description":"Phone code.","x-example":"+1"},"countryCode":{"type":"string","description":"Country two-character ISO 3166-1 alpha code.","x-example":"US"},"countryName":{"type":"string","description":"Country name.","x-example":"United States"}},"required":["code","countryCode","countryName"]},"healthAntivirus":{"description":"Health Antivirus","type":"object","properties":{"version":{"type":"string","description":"Antivirus version.","x-example":"1.0.0"},"status":{"type":"string","description":"Antivirus status. Possible values can are: `disabled`, `offline`, `online`","x-example":"online"}},"required":["version","status"]},"healthQueue":{"description":"Health Queue","type":"object","properties":{"size":{"type":"integer","description":"Amount of actions in the queue.","x-example":8,"format":"int32"}},"required":["size"]},"healthStatus":{"description":"Health Status","type":"object","properties":{"ping":{"type":"integer","description":"Duration in milliseconds how long the health check took.","x-example":128,"format":"int32"},"status":{"type":"string","description":"Service status. Possible values can are: `pass`, `fail`","x-example":"pass"}},"required":["ping","status"]},"healthTime":{"description":"Health Time","type":"object","properties":{"remoteTime":{"type":"integer","description":"Current unix timestamp on trustful remote server.","x-example":1639490751,"format":"int32"},"localTime":{"type":"integer","description":"Current unix timestamp of local server where Appwrite runs.","x-example":1639490844,"format":"int32"},"diff":{"type":"integer","description":"Difference of unix remote and local timestamps in milliseconds.","x-example":93,"format":"int32"}},"required":["remoteTime","localTime","diff"]},"metric":{"description":"Metric","type":"object","properties":{"value":{"type":"integer","description":"The value of this metric at the timestamp.","x-example":1,"format":"int32"},"date":{"type":"integer","description":"The UNIX timestamp at which this metric was aggregated.","x-example":1592981250,"format":"int32"}},"required":["value","date"]},"usageDatabases":{"description":"UsageDatabases","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"databasesCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"databasesDelete":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","databasesCount","documentsCount","collectionsCount","databasesCreate","databasesRead","databasesUpdate","databasesDelete","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageDatabase":{"description":"UsageDatabase","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCount":{"type":"array","description":"Aggregated stats for total number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsCreate":{"type":"array","description":"Aggregated stats for collections created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsRead":{"type":"array","description":"Aggregated stats for collections read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsUpdate":{"type":"array","description":"Aggregated stats for collections updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collectionsDelete":{"type":"array","description":"Aggregated stats for collections delete.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","collectionsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete","collectionsCreate","collectionsRead","collectionsUpdate","collectionsDelete"]},"usageCollection":{"description":"UsageCollection","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"documentsCount":{"type":"array","description":"Aggregated stats for total number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsCreate":{"type":"array","description":"Aggregated stats for documents created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsRead":{"type":"array","description":"Aggregated stats for documents read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsUpdate":{"type":"array","description":"Aggregated stats for documents updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documentsDelete":{"type":"array","description":"Aggregated stats for documents deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","documentsCount","documentsCreate","documentsRead","documentsUpdate","documentsDelete"]},"usageUsers":{"description":"UsageUsers","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"usersCount":{"type":"array","description":"Aggregated stats for total number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersCreate":{"type":"array","description":"Aggregated stats for users created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersRead":{"type":"array","description":"Aggregated stats for users read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersUpdate":{"type":"array","description":"Aggregated stats for users updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"usersDelete":{"type":"array","description":"Aggregated stats for users deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsCreate":{"type":"array","description":"Aggregated stats for sessions created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsProviderCreate":{"type":"array","description":"Aggregated stats for sessions created for a provider ( email, anonymous or oauth2 ).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"sessionsDelete":{"type":"array","description":"Aggregated stats for sessions deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","usersCount","usersCreate","usersRead","usersUpdate","usersDelete","sessionsCreate","sessionsProviderCreate","sessionsDelete"]},"usageStorage":{"description":"StorageUsage","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCount":{"type":"array","description":"Aggregated stats for total number of files.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCount":{"type":"array","description":"Aggregated stats for total number of buckets.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsCreate":{"type":"array","description":"Aggregated stats for buckets created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsRead":{"type":"array","description":"Aggregated stats for buckets read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsUpdate":{"type":"array","description":"Aggregated stats for buckets updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"bucketsDelete":{"type":"array","description":"Aggregated stats for buckets deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","storage","filesCount","bucketsCount","bucketsCreate","bucketsRead","bucketsUpdate","bucketsDelete","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageBuckets":{"description":"UsageBuckets","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"filesCount":{"type":"array","description":"Aggregated stats for total number of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesStorage":{"type":"array","description":"Aggregated stats for total storage of files in this bucket.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesCreate":{"type":"array","description":"Aggregated stats for files created.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesRead":{"type":"array","description":"Aggregated stats for files read.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesUpdate":{"type":"array","description":"Aggregated stats for files updated.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"filesDelete":{"type":"array","description":"Aggregated stats for files deleted.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","filesCount","filesStorage","filesCreate","filesRead","filesUpdate","filesDelete"]},"usageFunctions":{"description":"UsageFunctions","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"executionsTotal":{"type":"array","description":"Aggregated stats for number of function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"executionsFailure":{"type":"array","description":"Aggregated stats for function execution failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"executionsSuccess":{"type":"array","description":"Aggregated stats for function execution successes.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"executionsTime":{"type":"array","description":"Aggregated stats for function execution duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"buildsTotal":{"type":"array","description":"Aggregated stats for number of function builds.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"buildsFailure":{"type":"array","description":"Aggregated stats for function build failures.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"buildsSuccess":{"type":"array","description":"Aggregated stats for function build successes.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"buildsTime":{"type":"array","description":"Aggregated stats for function build duration.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","executionsTotal","executionsFailure","executionsSuccess","executionsTime","buildsTotal","buildsFailure","buildsSuccess","buildsTime"]},"usageProject":{"description":"UsageProject","type":"object","properties":{"range":{"type":"string","description":"The time range of the usage stats.","x-example":"30d"},"requests":{"type":"array","description":"Aggregated stats for number of requests.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"network":{"type":"array","description":"Aggregated stats for consumed bandwidth.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"executions":{"type":"array","description":"Aggregated stats for function executions.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"documents":{"type":"array","description":"Aggregated stats for number of documents.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"collections":{"type":"array","description":"Aggregated stats for number of collections.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"users":{"type":"array","description":"Aggregated stats for number of users.","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}},"storage":{"type":"array","description":"Aggregated stats for the occupied storage size (in bytes).","items":{"type":"object","$ref":"#\/definitions\/metricList"},"x-example":{}}},"required":["range","requests","network","executions","documents","collections","users","storage"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file From b3f272a1d9a10da7b1681ec0a092e57a3f898528 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Fri, 14 Oct 2022 16:52:11 +0000 Subject: [PATCH 504/555] Update example.php to fetch specs from appwrite repo --- example.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/example.php b/example.php index 4b3fbc9097..3ad70cc27f 100644 --- a/example.php +++ b/example.php @@ -35,11 +35,12 @@ function getSSLPage($url) { return $result; } - //$spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1'); - // $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1'); // Enable only with Appwrite local server running on port 80 - // $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1&platform=console'); // Enable only with Appwrite local server running on port 80 - // $spec = file_get_contents('https://appwrite.io/specs/swagger2?platform=client'); - $spec = file_get_contents('./specs/swagger2-latest-console.json'); + // Leave the platform you want uncommented + $platform = 'client'; + // $platform = 'console'; + // $platform = 'server'; + + $spec = getSSLPage("https://raw.githubusercontent.com/appwrite/appwrite/master/app/config/specs/swagger2-latest-${platform}.json"); if(empty($spec)) { throw new Exception('Failed to fetch spec from Appwrite server'); From 0df8d70716279798220b174a735a4ac23cfa4edf Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 26 Oct 2022 11:10:03 +1300 Subject: [PATCH 505/555] Fix multipart/form-data HTTP example --- templates/http/docs/example.md.twig | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/templates/http/docs/example.md.twig b/templates/http/docs/example.md.twig index 594be49b7c..2dda289477 100644 --- a/templates/http/docs/example.md.twig +++ b/templates/http/docs/example.md.twig @@ -1,20 +1,20 @@ +{% set boundary = random() %} {{ method.method | caseUpper }} {{spec.basePath}}{{ method.path }} HTTP/1.1 -Host: {{spec.host}} +Host: {{ spec.host }} {% for key, header in method.headers %} -{{ key }}: {{ header }} +{{ key }}: {{ header }}{% if header == 'multipart/form-data' %}; boundary="{{boundary}}"{% endif ~%} {% endfor %} {% for key,header in spec.global.defaultHeaders %} -{{key}}: {{header}} +{{ key }}: {{ header }} {% endfor %} {% for header in spec.global.headers %} {% if header.key != 'Mode' and header.key != 'Locale' %} -{{header.name}}: {% for node in method.security %}{% for key,x in node|keys %}{% if x == header.key %}{{node[x]['x-appwrite']['demo']}}{% endif %}{% endfor %}{% endfor %} - +{{ header.name }}: {% for node in method.security %}{% for key,x in node|keys %}{% if x == header.key %}{{node[x]['x-appwrite']['demo']}}{% endif %}{% endfor %}{% endfor ~%} {% endif %} {% endfor %} - {% for key, header in method.headers %} {% if header == 'application/json' %} + {% if method.parameters.body %} { {% for parameter in method.parameters.body %} @@ -25,9 +25,8 @@ Host: {{spec.host}} {% endif %} {% endif %} {% if header == 'multipart/form-data' %} -{% set boundary = random() %} -boundary={{boundary}} Content-Length: *Length of your entity body in bytes* + {% for parameter in method.parameters.body %} --{{boundary}} Content-Disposition: form-data; name="{{parameter.name}}{% if parameter.type == "array" %}[]{% endif %}" From adc9961ab0dac9f1ab38f15323b059322311680d Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 26 Oct 2022 11:10:21 +1300 Subject: [PATCH 506/555] Fix forced string parameters --- templates/http/docs/example.md.twig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/http/docs/example.md.twig b/templates/http/docs/example.md.twig index 2dda289477..66ad5d9c2c 100644 --- a/templates/http/docs/example.md.twig +++ b/templates/http/docs/example.md.twig @@ -18,8 +18,7 @@ Host: {{ spec.host }} {% if method.parameters.body %} { {% for parameter in method.parameters.body %} - "{{ parameter.name }}": "{{ parameter | paramExample }}"{% if not loop.last %},{% endif %} - + "{{ parameter.name }}": {{ parameter | paramExample }}{% if not loop.last %},{% endif ~%} {% endfor %} } {% endif %} From d65d0a7de9b2c8a34abab09250e813c0c760a672 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 26 Oct 2022 11:11:24 +1300 Subject: [PATCH 507/555] Fix inconsistent header casing --- src/SDK/SDK.php | 3 +++ templates/http/docs/example.md.twig | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SDK/SDK.php b/src/SDK/SDK.php index 9017130df4..ba5a177dd5 100644 --- a/src/SDK/SDK.php +++ b/src/SDK/SDK.php @@ -103,6 +103,9 @@ public function __construct(Language $language, Spec $spec) $this->twig->addFilter(new TwigFilter('caseUcfirst', function ($value) { return ucfirst($this->helperCamelCase($value)); })); + $this->twig->addFilter(new TwigFilter('caseUcwords', function ($value) { + return ucwords($value, " -_"); + })); $this->twig->addFilter(new TwigFilter('caseLcfirst', function ($value) { return lcfirst((string)$value); })); diff --git a/templates/http/docs/example.md.twig b/templates/http/docs/example.md.twig index 66ad5d9c2c..16c33dc8e2 100644 --- a/templates/http/docs/example.md.twig +++ b/templates/http/docs/example.md.twig @@ -2,7 +2,7 @@ {{ method.method | caseUpper }} {{spec.basePath}}{{ method.path }} HTTP/1.1 Host: {{ spec.host }} {% for key, header in method.headers %} -{{ key }}: {{ header }}{% if header == 'multipart/form-data' %}; boundary="{{boundary}}"{% endif ~%} +{{ key | caseUcwords }}: {{ header }}{% if header == 'multipart/form-data' %}; boundary="{{boundary}}"{% endif ~%} {% endfor %} {% for key,header in spec.global.defaultHeaders %} {{ key }}: {{ header }} From 67b34225815f4ba42ece6e6b15e817f656d39a5b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 26 Oct 2022 11:17:48 +1300 Subject: [PATCH 508/555] Fix unescaped strings --- src/SDK/Language/HTTP.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/SDK/Language/HTTP.php b/src/SDK/Language/HTTP.php index eea498c7df..62e5ce0c00 100644 --- a/src/SDK/Language/HTTP.php +++ b/src/SDK/Language/HTTP.php @@ -154,10 +154,23 @@ public function getParamExample(array $param): string case self::TYPE_FILE: case self::TYPE_NUMBER: case self::TYPE_INTEGER: - case self::TYPE_STRING: - case self::TYPE_ARRAY: $output .= $example; break; + case self::TYPE_ARRAY: + // If array of strings, make sure any sub-strings are escaped + if (\substr($example, 1, 1) === '"') { + $start = \substr($example, 0, 2); + $end = \substr($example, -2); + $contents = \substr($example, 2, -2); + $contents = \addslashes($contents); + $output .= $start . $contents . $end; + } else { + $output .= $example; + } + break; + case self::TYPE_STRING: + $output .= '"' . \addslashes($example) . '"'; + break; case self::TYPE_BOOLEAN: $output .= ($example) ? 'true' : 'false'; break; From ee4ea1c71c09965b2c0837db3ddc180f46943c7f Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 26 Oct 2022 13:44:04 +1300 Subject: [PATCH 509/555] Differentiate method auth and method security --- src/Spec/Swagger2.php | 15 +++++++++------ templates/android/docs/java/example.md.twig | 4 ++-- templates/android/docs/kotlin/example.md.twig | 4 ++-- .../io/appwrite/services/ServiceTemplate.kt.twig | 4 ++-- templates/dart/base/requests/location.twig | 2 +- templates/dart/base/requests/oauth.twig | 4 ++-- templates/dart/docs/example.md.twig | 4 ++-- templates/deno/docs/example.md.twig | 4 ++-- templates/dotnet/docs/example.md.twig | 4 ++-- .../src/Appwrite/Services/ServiceTemplate.cs.twig | 4 ++-- templates/flutter/base/requests/location.twig | 2 +- templates/flutter/base/requests/oauth.twig | 4 ++-- templates/flutter/docs/example.md.twig | 4 ++-- templates/go/docs/example.md.twig | 4 ++-- templates/http/docs/example.md.twig | 8 ++++---- templates/kotlin/base/utils.twig | 2 +- templates/kotlin/docs/java/example.md.twig | 4 ++-- templates/kotlin/docs/kotlin/example.md.twig | 4 ++-- .../io/appwrite/services/ServiceTemplate.kt.twig | 2 +- templates/node/docs/example.md.twig | 4 ++-- templates/php/docs/example.md.twig | 4 ++-- templates/python/docs/example.md.twig | 4 ++-- templates/ruby/docs/example.md.twig | 2 +- templates/swift/base/params.twig | 4 ++-- templates/swift/docs/example.md.twig | 4 ++-- templates/web/docs/example.md.twig | 4 ++-- templates/web/src/services/template.ts.twig | 4 ++-- 27 files changed, 58 insertions(+), 55 deletions(-) diff --git a/src/Spec/Swagger2.php b/src/Spec/Swagger2.php index 7fab305a1c..81d6b98d0b 100644 --- a/src/Spec/Swagger2.php +++ b/src/Spec/Swagger2.php @@ -137,13 +137,15 @@ public function getMethods($service) foreach ($paths as $pathName => $path) { foreach ($path as $methodName => $method) { - $auth = $method['x-appwrite']['auth'] ?? []; + $methodAuth = $method['x-appwrite']['auth'] ?? []; + $methodSecurity = $method['security'][0] ?? []; if (isset($method['tags']) && is_array($method['tags']) && in_array($service, $method['tags'])) { - if (isset($auth) && is_array($auth)) { - foreach ($auth as $i => $node) { - $auth[$i] = (array_key_exists($i, $security)) ? $security[$i] : []; - } + foreach ($methodAuth as $i => $node) { + $methodAuth[$i] = (array_key_exists($i, $security)) ? $security[$i] : []; + } + foreach ($methodSecurity as $i => $node) { + $methodSecurity[$i] = (array_key_exists($i, $security)) ? $security[$i] : []; } $responses = $method['responses']; @@ -169,7 +171,8 @@ public function getMethods($service) 'packaging' => $method['x-appwrite']['packaging'] ?? false, 'title' => $method['summary'] ?? '', 'description' => $method['description'] ?? '', - 'security' => [$auth] ?? [], + 'auth' => [$methodAuth] ?? [], + 'security' => [$methodSecurity] ?? [], 'consumes' => $method['consumes'] ?? [], 'cookies' => $method['x-appwrite']['cookies'] ?? false, 'type' => $method['x-appwrite']['type'] ?? false, diff --git a/templates/android/docs/java/example.md.twig b/templates/android/docs/java/example.md.twig index 7722f903b5..35a64b80b6 100644 --- a/templates/android/docs/java/example.md.twig +++ b/templates/android/docs/java/example.md.twig @@ -16,9 +16,9 @@ public class MainActivity extends AppCompatActivity { setContentView(R.layout.activity_main); Client client = new Client(getApplicationContext()) -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}"){% if loop.last %};{% endif %} // {{node[header].description}} {% endfor %} diff --git a/templates/android/docs/kotlin/example.md.twig b/templates/android/docs/kotlin/example.md.twig index 131d43bc93..90e4fd7952 100644 --- a/templates/android/docs/kotlin/example.md.twig +++ b/templates/android/docs/kotlin/example.md.twig @@ -14,9 +14,9 @@ class MainActivity : AppCompatActivity() { setContentView(R.layout.activity_main) val client = Client(applicationContext) -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}") // {{node[header].description}} {% endfor %} diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index 69985fffbe..e82f4a1eb9 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -3,7 +3,7 @@ {% if parameters.all|length > 0 %}{% for parameter in parameters.all %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} {% endmacro %} {% macro methodNeedsSecurityParameters(method) %} -{% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} +{% if (method.type == "webAuth" or method.type == "location") and method.auth|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} {% endmacro %} {% macro resultType(namespace, method) %} {% if method.type == "webAuth" %}Bool{% elseif method.type == "location" %}ByteArray{% elseif not method.responseModel or method.responseModel == 'any' %}Any{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} @@ -55,7 +55,7 @@ class {{ service.name | caseUcfirst }} : Service { {% endfor %} {% if _self.methodNeedsSecurityParameters(method) %} -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} "{{header|caseLower}}" to client.config["{{header|caseLower}}"]{% if not loop.last %},{% endif %} diff --git a/templates/dart/base/requests/location.twig b/templates/dart/base/requests/location.twig index e2d1629e95..ab3e3dc4a1 100644 --- a/templates/dart/base/requests/location.twig +++ b/templates/dart/base/requests/location.twig @@ -2,7 +2,7 @@ final Map params = { {{ utils.map_parameter(method.parameters.query) }} {{ utils.map_parameter(method.parameters.body) }} -{% if method.security|length > 0 %}{% for node in method.security %} +{% if method.auth|length > 0 %}{% for node in method.auth %} {% for key,header in node|keys %} '{{header|caseLower}}': client.config['{{header|caseLower}}'], {% endfor %} diff --git a/templates/dart/base/requests/oauth.twig b/templates/dart/base/requests/oauth.twig index 377b829da1..237079f364 100644 --- a/templates/dart/base/requests/oauth.twig +++ b/templates/dart/base/requests/oauth.twig @@ -2,8 +2,8 @@ final Map params = { {{ utils.map_parameter(method.parameters.query) }} {{ utils.map_parameter(method.parameters.body) }} -{% if method.security|length > 0 %} -{% for node in method.security %} +{% if method.auth|length > 0 %} +{% for node in method.auth %} {% for key,header in node|keys %} '{{header|caseLower}}': client.config['{{header|caseLower}}'], {% endfor %} diff --git a/templates/dart/docs/example.md.twig b/templates/dart/docs/example.md.twig index f438c7e9c2..0a0e59863f 100644 --- a/templates/dart/docs/example.md.twig +++ b/templates/dart/docs/example.md.twig @@ -7,10 +7,10 @@ void main() { // Init SDK Client client = Client(); {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = {{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter.name | caseCamel | overrideIdentifier }}: {{ parameter | paramExample }}{% endfor %}{% endif %}); -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} .set{{header}}('{{node[header]['x-appwrite']['demo']}}') // {{node[header].description}} {% endfor %} diff --git a/templates/deno/docs/example.md.twig b/templates/deno/docs/example.md.twig index 98fb10f194..bda79d1100 100644 --- a/templates/deno/docs/example.md.twig +++ b/templates/deno/docs/example.md.twig @@ -8,10 +8,10 @@ let client = new sdk.Client(); let {{ service.name | caseCamel }} = new sdk.{{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} .set{{header}}('{{node[header]['x-appwrite']['demo']}}') // {{node[header].description}} {% endfor %} diff --git a/templates/dotnet/docs/example.md.twig b/templates/dotnet/docs/example.md.twig index eb5c4a9020..a121a7eabc 100644 --- a/templates/dotnet/docs/example.md.twig +++ b/templates/dotnet/docs/example.md.twig @@ -2,10 +2,10 @@ using {{ spec.title | caseUcfirst }}; Client client = new Client(); -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} client .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} .Set{{header | caseUcfirst}}("{{node[header]["x-appwrite"]["demo"]}}") // {{node[header].description}} {% endfor %} diff --git a/templates/dotnet/src/Appwrite/Services/ServiceTemplate.cs.twig b/templates/dotnet/src/Appwrite/Services/ServiceTemplate.cs.twig index f8490accd7..95ff6dcd24 100644 --- a/templates/dotnet/src/Appwrite/Services/ServiceTemplate.cs.twig +++ b/templates/dotnet/src/Appwrite/Services/ServiceTemplate.cs.twig @@ -10,7 +10,7 @@ {{ parameter.name | caseCamel | escapeKeyword }}{% endif %} {% endmacro %} {% macro methodNeedsSecurityParameters(method) %} -{% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} +{% if (method.type == "webAuth" or method.type == "location") and method.auth|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} {% endmacro %} using System.Collections.Generic; @@ -46,7 +46,7 @@ namespace {{ spec.title | caseUcfirst }} {% endfor %} }; -{% if _self.methodNeedsSecurityParameters(method) %}{% for node in method.security %} +{% if _self.methodNeedsSecurityParameters(method) %}{% for node in method.auth %} {% for key,header in node|keys %} // { "{{header|caseLower}}", _client.GetConfig().get("{{header|caseLower}}") }{% if not loop.last %},{% endif %} diff --git a/templates/flutter/base/requests/location.twig b/templates/flutter/base/requests/location.twig index 47731d778b..76be6e723b 100644 --- a/templates/flutter/base/requests/location.twig +++ b/templates/flutter/base/requests/location.twig @@ -2,7 +2,7 @@ final Map params = { {{ utils.map_parameter(method.parameters.query) }} {{ utils.map_parameter(method.parameters.body) }} -{% if method.security|length > 0 %}{% for node in method.security %} +{% if method.auth|length > 0 %}{% for node in method.auth %} {% for key,header in node|keys %} '{{header|caseLower}}': client.config['{{header|caseLower}}'], {% endfor %} diff --git a/templates/flutter/base/requests/oauth.twig b/templates/flutter/base/requests/oauth.twig index 4a19160be8..627b4f14e2 100644 --- a/templates/flutter/base/requests/oauth.twig +++ b/templates/flutter/base/requests/oauth.twig @@ -2,8 +2,8 @@ final Map params = { {{ utils.map_parameter(method.parameters.query) }} {{ utils.map_parameter(method.parameters.body) }} -{% if method.security|length > 0 %} -{% for node in method.security %} +{% if method.auth|length > 0 %} +{% for node in method.auth %} {% for key,header in node|keys %} '{{header|caseLower}}': client.config['{{header|caseLower}}'], {% endfor %} diff --git a/templates/flutter/docs/example.md.twig b/templates/flutter/docs/example.md.twig index 44163cffdf..a47393aa0a 100644 --- a/templates/flutter/docs/example.md.twig +++ b/templates/flutter/docs/example.md.twig @@ -7,10 +7,10 @@ void main() { // Init SDK Client client = Client(); {{ service.name | caseUcfirst }} {{ service.name | caseCamel }} = {{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter.name | caseCamel | overrideIdentifier }}: {{ parameter | paramExample }}{% endfor %}{% endif %}); -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} .set{{header}}('{{node[header]['x-appwrite']['demo']}}') // {{node[header].description}} {% endfor %} diff --git a/templates/go/docs/example.md.twig b/templates/go/docs/example.md.twig index 27597a0c5a..6894e830dc 100644 --- a/templates/go/docs/example.md.twig +++ b/templates/go/docs/example.md.twig @@ -9,9 +9,9 @@ import ( func main() { client := {{ spec.title | caseLower }}.NewClient() -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} client.SetEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} client.Set{{header}}("{{node[header]['x-{{ spec.title | caseLower }}']['demo']}}") // {{node[header].description}} {% endfor %} diff --git a/templates/http/docs/example.md.twig b/templates/http/docs/example.md.twig index 16c33dc8e2..691e37b220 100644 --- a/templates/http/docs/example.md.twig +++ b/templates/http/docs/example.md.twig @@ -7,10 +7,10 @@ Host: {{ spec.host }} {% for key,header in spec.global.defaultHeaders %} {{ key }}: {{ header }} {% endfor %} -{% for header in spec.global.headers %} -{% if header.key != 'Mode' and header.key != 'Locale' %} -{{ header.name }}: {% for node in method.security %}{% for key,x in node|keys %}{% if x == header.key %}{{node[x]['x-appwrite']['demo']}}{% endif %}{% endfor %}{% endfor ~%} -{% endif %} +{% for node in method.security %} +{% for key,header in node | keys %} +{{ node[header]['name'] }}: {{ node[header]['x-appwrite']['demo'] }} +{% endfor %} {% endfor %} {% for key, header in method.headers %} {% if header == 'application/json' %} diff --git a/templates/kotlin/base/utils.twig b/templates/kotlin/base/utils.twig index 8770b8a947..9caca1beff 100644 --- a/templates/kotlin/base/utils.twig +++ b/templates/kotlin/base/utils.twig @@ -3,7 +3,7 @@ {% if parameters.all|length > 0 %}{% for parameter in parameters.all %}{{ '\n\t\t' }}{{ _self.parameter(parameter) }}{% if not loop.last %}{{ ',' }}{% endif %}{% endfor %}{% if 'multipart/form-data' in consumes %}, onProgress: ((UploadProgress) -> Unit)? = null{% endif %}{% endif %} {% endmacro %} {% macro methodNeedsSecurityParameters(method) %} -{% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} +{% if (method.type == "webAuth" or method.type == "location") and method.auth|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} {% endmacro %} {% macro resultType(namespace, method) %} {% if method.type == "webAuth" %}Bool{% elseif method.type == "location" %}ByteArray{% elseif not method.responseModel or method.responseModel == 'any' %}Any{% else %}{{ namespace | caseDot}}.models.{{method.responseModel | caseUcfirst}}{% endif %} diff --git a/templates/kotlin/docs/java/example.md.twig b/templates/kotlin/docs/java/example.md.twig index f91259417f..488a52decb 100644 --- a/templates/kotlin/docs/java/example.md.twig +++ b/templates/kotlin/docs/java/example.md.twig @@ -6,9 +6,9 @@ import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} public void main() { Client client = Client(context) -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}"){% if loop.last %};{% endif %} // {{node[header].description}} {% endfor %}{% endfor %}{% endif %} diff --git a/templates/kotlin/docs/kotlin/example.md.twig b/templates/kotlin/docs/kotlin/example.md.twig index 0d7ecb6ce5..17047986db 100644 --- a/templates/kotlin/docs/kotlin/example.md.twig +++ b/templates/kotlin/docs/kotlin/example.md.twig @@ -6,9 +6,9 @@ import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }} suspend fun main() { val client = Client(context) -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}") // {{node[header].description}} {% endfor %}{% endfor %}{% endif %} diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index 559444b49c..2aad4a543a 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -44,7 +44,7 @@ class {{ service.name | caseUcfirst }} : Service { {% endfor %} {% if utils.methodNeedsSecurityParameters(method) %} -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} "{{header|caseLower}}" to client.config["{{header|caseLower}}"]{% if not loop.last %},{% endif %} diff --git a/templates/node/docs/example.md.twig b/templates/node/docs/example.md.twig index 33374dd944..83192ff4ba 100644 --- a/templates/node/docs/example.md.twig +++ b/templates/node/docs/example.md.twig @@ -8,10 +8,10 @@ const client = new sdk.Client(); const {{ service.name | caseCamel }} = new sdk.{{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} .set{{header}}('{{node[header]['x-appwrite']['demo']}}') // {{node[header].description}} {% endfor %} diff --git a/templates/php/docs/example.md.twig b/templates/php/docs/example.md.twig index 56a2826b10..205055d65d 100644 --- a/templates/php/docs/example.md.twig +++ b/templates/php/docs/example.md.twig @@ -8,10 +8,10 @@ use {{ spec.title | caseUcfirst }}\Services\{{ service.name | caseUcfirst }}; $client = new Client(); -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} ->set{{header}}('{{node[header]['x-appwrite']['demo']}}') // {{node[header].description}} {% endfor %} diff --git a/templates/python/docs/example.md.twig b/templates/python/docs/example.md.twig index aa22527d80..7beffa9783 100644 --- a/templates/python/docs/example.md.twig +++ b/templates/python/docs/example.md.twig @@ -6,10 +6,10 @@ from {{ spec.title | caseSnake }}.services.{{ service.name | caseSnake }} import client = Client() -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} .set_{{header | caseSnake}}('{{node[header]['x-appwrite']['demo']}}') # {{node[header].description}} {% endfor %} diff --git a/templates/ruby/docs/example.md.twig b/templates/ruby/docs/example.md.twig index 268de5a5ac..41fc53d422 100644 --- a/templates/ruby/docs/example.md.twig +++ b/templates/ruby/docs/example.md.twig @@ -4,7 +4,7 @@ include {{ spec.title | caseUcfirst }} client = Client.new .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} .set_{{header|caseSnake}}('{{node[header]['x-appwrite']['demo']}}') # {{node[header].description}} {% endfor %} diff --git a/templates/swift/base/params.twig b/templates/swift/base/params.twig index 9eeea4c140..d85dd803e6 100644 --- a/templates/swift/base/params.twig +++ b/templates/swift/base/params.twig @@ -1,5 +1,5 @@ {% macro methodNeedsSecurityParameters(method) %} -{% if (method.type == "webAuth" or method.type == "location") and method.security|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} +{% if (method.type == "webAuth" or method.type == "location") and method.auth|length > 0 %}{{ true }}{% else %}{{false}}{% endif %} {% endmacro %} {% if method.parameters.path %} var{% else %} let{% endif %} path: String = "{{ method.path }}" {% for parameter in method.parameters.path %} @@ -18,7 +18,7 @@ {% endfor %} {% if _self.methodNeedsSecurityParameters(method) %} -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} "{{header|caseLower}}": client.config["{{header|caseLower}}"]{% if not loop.last %},{% endif %} diff --git a/templates/swift/docs/example.md.twig b/templates/swift/docs/example.md.twig index 25a9e95c7d..1985a4ebca 100644 --- a/templates/swift/docs/example.md.twig +++ b/templates/swift/docs/example.md.twig @@ -2,9 +2,9 @@ import Appwrite func main() async throws { let client = Client() -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} .set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}") // {{node[header].description}} {% endfor %} diff --git a/templates/web/docs/example.md.twig b/templates/web/docs/example.md.twig index 6e80ad1c36..42c242545b 100644 --- a/templates/web/docs/example.md.twig +++ b/templates/web/docs/example.md.twig @@ -4,10 +4,10 @@ const client = new Client(); const {{ service.name | caseCamel }} = new {{service.name | caseUcfirst}}(client{% if service.globalParams | length %}{% for parameter in service.globalParams %}, {{ parameter | paramExample }}{% endfor %}{% endif %}); -{% if method.security|length > 0 %} +{% if method.auth|length > 0 %} client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint -{% for node in method.security %} +{% for node in method.auth %} {% for key,header in node|keys %} .set{{header}}('{{node[header]['x-appwrite']['demo']}}') // {{node[header].description}} {% endfor %} diff --git a/templates/web/src/services/template.ts.twig b/templates/web/src/services/template.ts.twig index 6924b2e768..f1345d1e1a 100644 --- a/templates/web/src/services/template.ts.twig +++ b/templates/web/src/services/template.ts.twig @@ -51,8 +51,8 @@ export class {{ service.name | caseUcfirst }} extends Service { {% endfor %} const uri = new URL(this.client.config.endpoint + path); {% if method.type == 'location' or method.type == 'webAuth' %} -{% if method.security|length > 0 %} -{% for node in method.security %} +{% if method.auth|length > 0 %} +{% for node in method.auth %} {% for key,header in node|keys %} payload['{{header|caseLower}}'] = this.client.config.{{header|caseLower}}; From b67a12e6038c33f37f383199de775e961e67fea3 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 26 Oct 2022 14:09:37 +1300 Subject: [PATCH 510/555] Extend GraphQL and REST from an HTTP base class --- example.php | 6 +- src/SDK/Language/GraphQL.php | 22 +---- src/SDK/Language/HTTP.php | 171 ++--------------------------------- src/SDK/Language/REST.php | 149 ++++++++++++++++++++++++++++++ 4 files changed, 159 insertions(+), 189 deletions(-) create mode 100644 src/SDK/Language/REST.php diff --git a/example.php b/example.php index 01366fb4c4..87a9595c0d 100644 --- a/example.php +++ b/example.php @@ -14,7 +14,7 @@ use Appwrite\SDK\Language\Dart; use Appwrite\SDK\Language\Go; use Appwrite\SDK\Language\Deno; -use Appwrite\SDK\Language\HTTP; +use Appwrite\SDK\Language\REST; use Appwrite\SDK\Language\Swift; use Appwrite\SDK\Language\SwiftClient; use Appwrite\SDK\Language\DotNet; @@ -389,8 +389,8 @@ function getSSLPage($url) { $sdk->generate(__DIR__ . '/examples/dotnet'); - // HTTP - $sdk = new SDK(new HTTP(), new Swagger2($spec)); + // REST + $sdk = new SDK(new REST(), new Swagger2($spec)); $sdk ->setName('NAME') diff --git a/src/SDK/Language/GraphQL.php b/src/SDK/Language/GraphQL.php index 0db720576a..628f7598f7 100644 --- a/src/SDK/Language/GraphQL.php +++ b/src/SDK/Language/GraphQL.php @@ -2,9 +2,7 @@ namespace Appwrite\SDK\Language; -use Appwrite\SDK\Language; - -class GraphQL extends Language +class GraphQL extends HTTP { /** * @return string @@ -14,24 +12,6 @@ public function getName(): string return 'GraphQL'; } - /** - * Get Language Keywords List - * - * @return array - */ - public function getKeywords(): array - { - return []; - } - - /** - * @return array - */ - public function getIdentifierOverrides(): array - { - return []; - } - /** * @param $type * @return string diff --git a/src/SDK/Language/HTTP.php b/src/SDK/Language/HTTP.php index 62e5ce0c00..f43646c61b 100644 --- a/src/SDK/Language/HTTP.php +++ b/src/SDK/Language/HTTP.php @@ -3,17 +3,10 @@ namespace Appwrite\SDK\Language; use Appwrite\SDK\Language; +use Exception; -class HTTP extends Language +abstract class HTTP extends Language { - /** - * @return string - */ - public function getName(): string - { - return 'HTTP'; - } - /** * Get Language Keywords List * @@ -33,164 +26,12 @@ public function getIdentifierOverrides(): array } /** - * @param $type + * @param array $parameter * @return string + * @throws Exception */ public function getTypeName(array $parameter): string { - switch ($parameter['type']) { - case self::TYPE_INTEGER: - return 'int'; - case self::TYPE_STRING: - return 'String'; - case self::TYPE_FILE: - return 'MultipartFile'; - case self::TYPE_BOOLEAN: - return 'bool'; - case self::TYPE_ARRAY: - if (!empty($parameter['array']['type'])) { - return 'List<' . $this->getTypeName($parameter['array']) . '>'; - } - return 'List'; - case self::TYPE_OBJECT: - return 'dynamic'; - } - - return $parameter['type']; - } - - /** - * @param array $param - * @return string - */ - public function getParamDefault(array $param): string - { - $type = $param['type'] ?? ''; - $default = $param['default'] ?? ''; - $required = $param['required'] ?? ''; - - if ($required) { - return ''; - } - - $output = ''; - - if (empty($default) && $default !== 0 && $default !== false) { - switch ($type) { - case self::TYPE_OBJECT: - $output .= '{}'; - break; - case self::TYPE_NUMBER: - case self::TYPE_INTEGER: - $output .= '0'; - break; - case self::TYPE_BOOLEAN: - $output .= 'false'; - break; - case self::TYPE_ARRAY: - $output .= '[]'; - break; - case self::TYPE_STRING: - $output .= '""'; - break; - } - } else { - switch ($type) { - case self::TYPE_OBJECT: - case self::TYPE_NUMBER: - case self::TYPE_ARRAY: - case self::TYPE_INTEGER: - $output .= $default; - break; - case self::TYPE_BOOLEAN: - $output .= ($default) ? 'true' : 'false'; - break; - case self::TYPE_STRING: - $output .= '"' . $default . '"'; - break; - } - } - - return $output; - } - - /** - * @param array $param - * @return string - */ - public function getParamExample(array $param): string - { - $type = $param['type'] ?? ''; - $example = $param['example'] ?? ''; - - $output = ''; - - if (empty($example) && $example !== 0 && $example !== false) { - switch ($type) { - case self::TYPE_FILE: - $output .= 'cf 94 84 24 8d c4 91 10 0f dc 54 26 6c 8e 4b bc -e8 ee 55 94 29 e7 94 89 19 26 28 01 26 29 3f 16...'; - break; - case self::TYPE_NUMBER: - case self::TYPE_INTEGER: - $output .= '0'; - break; - case self::TYPE_BOOLEAN: - $output .= 'false'; - break; - case self::TYPE_STRING: - $output .= ""; - break; - case self::TYPE_OBJECT: - $output .= '{}'; - break; - case self::TYPE_ARRAY: - $output .= '[]'; - break; - } - } else { - switch ($type) { - case self::TYPE_OBJECT: - case self::TYPE_FILE: - case self::TYPE_NUMBER: - case self::TYPE_INTEGER: - $output .= $example; - break; - case self::TYPE_ARRAY: - // If array of strings, make sure any sub-strings are escaped - if (\substr($example, 1, 1) === '"') { - $start = \substr($example, 0, 2); - $end = \substr($example, -2); - $contents = \substr($example, 2, -2); - $contents = \addslashes($contents); - $output .= $start . $contents . $end; - } else { - $output .= $example; - } - break; - case self::TYPE_STRING: - $output .= '"' . \addslashes($example) . '"'; - break; - case self::TYPE_BOOLEAN: - $output .= ($example) ? 'true' : 'false'; - break; - } - } - - return $output; - } - - /** - * @return array - */ - public function getFiles(): array - { - return [ - [ - 'scope' => 'method', - 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}', - 'template' => '/http/docs/example.md.twig', - ], - ]; + throw new Exception('Method not supported for HTTP APIs'); } -} +} \ No newline at end of file diff --git a/src/SDK/Language/REST.php b/src/SDK/Language/REST.php new file mode 100644 index 0000000000..f10e2d98a1 --- /dev/null +++ b/src/SDK/Language/REST.php @@ -0,0 +1,149 @@ + 'method', + 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}', + 'template' => '/http/docs/example.md.twig', + ], + ]; + } +} From 65606baa3d4f1be4d79bc18bafaf3f6d63377ed6 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 26 Oct 2022 15:19:54 +1300 Subject: [PATCH 511/555] Lint --- src/SDK/Language/HTTP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SDK/Language/HTTP.php b/src/SDK/Language/HTTP.php index f43646c61b..1e674c945a 100644 --- a/src/SDK/Language/HTTP.php +++ b/src/SDK/Language/HTTP.php @@ -34,4 +34,4 @@ public function getTypeName(array $parameter): string { throw new Exception('Method not supported for HTTP APIs'); } -} \ No newline at end of file +} From 969bfa308f9504b7aaa45fa064f9e2ca83858343 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 26 Oct 2022 16:38:42 +1300 Subject: [PATCH 512/555] Fix extension --- src/SDK/Language/HTTP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SDK/Language/HTTP.php b/src/SDK/Language/HTTP.php index 62e5ce0c00..ec9d0d6e70 100644 --- a/src/SDK/Language/HTTP.php +++ b/src/SDK/Language/HTTP.php @@ -188,7 +188,7 @@ public function getFiles(): array return [ [ 'scope' => 'method', - 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}', + 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => '/http/docs/example.md.twig', ], ]; From 48445da3bf555d360bdc3fa822c9ddcb2b552ee2 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 26 Oct 2022 16:38:59 +1300 Subject: [PATCH 513/555] Fix extension --- src/SDK/Language/REST.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SDK/Language/REST.php b/src/SDK/Language/REST.php index f10e2d98a1..e53b54ae0b 100644 --- a/src/SDK/Language/REST.php +++ b/src/SDK/Language/REST.php @@ -141,7 +141,7 @@ public function getFiles(): array return [ [ 'scope' => 'method', - 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}', + 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', 'template' => '/http/docs/example.md.twig', ], ]; From 9b9c6cfc106b2c2281c2f4c0f0246f7cb6b1927c Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 26 Oct 2022 19:45:45 +1300 Subject: [PATCH 514/555] Handle multipart/form-data in graphql examples --- templates/graphql/docs/example.md.twig | 46 +++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/templates/graphql/docs/example.md.twig b/templates/graphql/docs/example.md.twig index 1bb71597ec..d45fd785f6 100644 --- a/templates/graphql/docs/example.md.twig +++ b/templates/graphql/docs/example.md.twig @@ -1,3 +1,45 @@ +{% for key,header in method.headers %} +{% if header == 'multipart/form-data' %} +{% set boundary = random() %} +{{ method.method | caseUpper }} {{spec.basePath}}{{ method.path }} HTTP/1.1 +Host: {{ spec.host }} +{% for key, header in method.headers %} +{{ key | caseUcwords }}: {{ header }}{% if header == 'multipart/form-data' %}; boundary="{{boundary}}"{% endif ~%} +{% endfor %} +{% for key,header in spec.global.defaultHeaders %} +{{ key }}: {{ header }} +{% endfor %} +{% for node in method.security %} +{% for key,header in node | keys %} +{{ node[header]['name'] }}: {{ node[header]['x-appwrite']['demo'] }} +{% endfor %} +{% endfor %} +Content-Length: *Length of your entity body in bytes* + +--{{boundary}} +Content-Disposition: form-data; name="operations" + +{ "query": "mutation { {{ service.name | caseCamel }}{{ method.name | caseCamel | caseUcfirst }}({% for parameter in method.parameters.all | filter(p => p.required) %}{{ parameter.name | caseCamel }}: ${{ parameter.name | caseCamel }}{% if not loop.last %}, {% endif %}{% endfor %}) { id }" }, "variables": { {% for parameter in method.parameters.all | filter(p => p.required) %}"{{ parameter.name | caseCamel }}": {{ parameter | paramExample }}{% if not loop.last %}, {% endif %}{% endfor %} } } + +--{{boundary}} +Content-Disposition: form-data; name="map" + +{% set counter = 0 %} +{ {% for parameter in method.parameters.all | filter(p => p.required) %}{% if parameter.type == 'file' %}"{{ counter }}": ["variables.{{ parameter.name | caseCamel }}"]{% if not loop.last %}, {% endif %}{% set counter = counter + 1 %}{% endif %}{% endfor %} } + +{% set counter = 0 %} +{% for parameter in method.parameters.all | filter(p => p.required) %} +{% if parameter.type == 'file' %} +--{{ boundary }} +Content-Disposition: form-data; name="{{ counter }}"; filename="{{ parameter.name }}.ext" + +File contents + +{% set counter = counter + 1 %} +{% endif %} +{% endfor %} +--{{boundary}}-- +{% else %} {%~ if method.method == 'get' %} query { {%~ else %} @@ -25,4 +67,6 @@ mutation { {%~ endfor %} {%~ endif %} } -} \ No newline at end of file +} +{% endif %} +{% endfor %} \ No newline at end of file From 4bbff1538724274a92b74e39cf4cda4580bafb68 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 26 Oct 2022 19:49:27 +1300 Subject: [PATCH 515/555] Set constant boundary so examples are not updated every generation --- templates/graphql/docs/example.md.twig | 2 +- templates/http/docs/example.md.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/graphql/docs/example.md.twig b/templates/graphql/docs/example.md.twig index d45fd785f6..1b8a85271a 100644 --- a/templates/graphql/docs/example.md.twig +++ b/templates/graphql/docs/example.md.twig @@ -1,6 +1,6 @@ {% for key,header in method.headers %} {% if header == 'multipart/form-data' %} -{% set boundary = random() %} +{% set boundary = 'cec8e8123c05ba25' %} {{ method.method | caseUpper }} {{spec.basePath}}{{ method.path }} HTTP/1.1 Host: {{ spec.host }} {% for key, header in method.headers %} diff --git a/templates/http/docs/example.md.twig b/templates/http/docs/example.md.twig index 691e37b220..80e71e1201 100644 --- a/templates/http/docs/example.md.twig +++ b/templates/http/docs/example.md.twig @@ -1,4 +1,4 @@ -{% set boundary = random() %} +{% set boundary = 'cec8e8123c05ba25' %} {{ method.method | caseUpper }} {{spec.basePath}}{{ method.path }} HTTP/1.1 Host: {{ spec.host }} {% for key, header in method.headers %} From 269626dd87ba5277d1afe4b341d43cf80cb551ba Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 27 Oct 2022 10:36:19 +0200 Subject: [PATCH 516/555] Update device_info_plus --- templates/flutter/pubspec.yaml.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 606284a80a..4be3452cbd 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -12,7 +12,7 @@ dependencies: flutter: sdk: flutter cookie_jar: ^3.0.1 - device_info_plus: ^7.0.1 + device_info_plus: ^8.0.0 flutter_web_auth_2: ^1.1.2 http: ^0.13.5 package_info_plus: ^3.0.1 From 96ada2e41a2fb5a35e542a078ff8357bf8dcb380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 27 Oct 2022 11:45:55 +0000 Subject: [PATCH 517/555] PR review changes --- templates/cli/lib/commands/deploy.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cli/lib/commands/deploy.js.twig b/templates/cli/lib/commands/deploy.js.twig index f2f9802eeb..d0a3d9b26a 100644 --- a/templates/cli/lib/commands/deploy.js.twig +++ b/templates/cli/lib/commands/deploy.js.twig @@ -611,7 +611,7 @@ const deployTeam = async ({ all, yes } = {}) => { teamIds.push(...configTeams.map((t) => t.$id)); } - if(teamIds.length <= 0) { + if(teamIds.length === 0) { let answers = await inquirer.prompt(questionsDeployTeams[0]) teamIds.push(...answers.teams); } From d2c5cc122edbc284ceb6a0e4a2a6dd5fefc1cc17 Mon Sep 17 00:00:00 2001 From: Chinmay Date: Sat, 29 Oct 2022 11:13:27 +0530 Subject: [PATCH 518/555] Update long_description in setup.py.twig --- templates/python/setup.py.twig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/python/setup.py.twig b/templates/python/setup.py.twig index 82867e2fe1..be41ef80d4 100644 --- a/templates/python/setup.py.twig +++ b/templates/python/setup.py.twig @@ -6,6 +6,8 @@ setuptools.setup( version = '{{sdk.version}}', license='{{spec.licenseName}}', description = '{{sdk.shortDescription}}', + long_description = '{{sdk.longDescription}}', + long_description_content_type = 'text/markdown', author = '{{spec.contactName}}', author_email = '{{spec.contactEmail}}', maintainer = '{{spec.contactName}}', From bccafa1eaf4d90fa3086448779a3649bb5825e77 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 2 Nov 2022 14:49:47 +1300 Subject: [PATCH 519/555] Fix generic inference from parameter type --- templates/swift/Sources/Services/Service.swift.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index e6e6cf84d9..ae156cf423 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -25,7 +25,7 @@ open class {{ service.name | caseUcfirst }}: Service { {%~ endif %} open func {{ method.name | caseCamel }}{% if method.responseModel | hasGenericType(spec) %}{% endif %}( {%~ for parameter in method.parameters.all %} - {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter | typeName | raw }}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} + {{ parameter.name | caseCamel | escapeKeyword }}: {% if parameter.type == "object" %}T{% else %}{{ parameter | typeName | raw }}{% endif %}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} {%~ endfor %} {%~ if 'multipart/form-data' in method.consumes %} From 8ed594e8945a713d11f310018e520f8c26145b38 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 2 Nov 2022 15:31:12 +1300 Subject: [PATCH 520/555] Update string helper names --- src/SDK/Language.php | 6 +++--- src/SDK/Language/Swift.php | 8 ++++---- src/SDK/Language/Web.php | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/SDK/Language.php b/src/SDK/Language.php index 4741e08e83..0a7a259f7a 100644 --- a/src/SDK/Language.php +++ b/src/SDK/Language.php @@ -84,12 +84,12 @@ public function getFilters(): array return []; } - protected function toUpperCase(string $value): string + protected function toUpperCaseWords(string $value): string { - return ucfirst($this->helperCamelCase($value)); + return ucfirst($this->toCamelCase($value)); } - protected function helperCamelCase($str): string + protected function toCamelCase($str): string { $str = preg_replace('/[^a-z0-9' . implode("", []) . ']+/i', ' ', $str); $str = trim($str); diff --git a/src/SDK/Language/Swift.php b/src/SDK/Language/Swift.php index 159238d19c..edb0213ecc 100644 --- a/src/SDK/Language/Swift.php +++ b/src/SDK/Language/Swift.php @@ -466,7 +466,7 @@ protected function getReturnType(array $method, array $spec, string $generic): s return 'Any'; } - $ret = $this->toUpperCase($method['responseModel']); + $ret = $this->toUpperCaseWords($method['responseModel']); if ($this->hasGenericType($method['responseModel'], $spec)) { $ret .= '<' . $generic . '>'; @@ -478,15 +478,15 @@ protected function getReturnType(array $method, array $spec, string $generic): s protected function getModelType(array $definition, array $spec, string $generic): string { if ($this->hasGenericType($definition['name'], $spec)) { - return $this->toUpperCase($definition['name']) . '<' . $generic . '>'; + return $this->toUpperCaseWords($definition['name']) . '<' . $generic . '>'; } - return $this->toUpperCase($definition['name']); + return $this->toUpperCaseWords($definition['name']); } protected function getPropertyType(array $property, array $spec, string $generic): string { if (\array_key_exists('sub_schema', $property)) { - $type = $this->toUpperCase($property['sub_schema']); + $type = $this->toUpperCaseWords($property['sub_schema']); if ($this->hasGenericType($property['sub_schema'], $spec)) { $type .= '<' . $generic . '>'; diff --git a/src/SDK/Language/Web.php b/src/SDK/Language/Web.php index 58b8fd1bb6..26ec511361 100644 --- a/src/SDK/Language/Web.php +++ b/src/SDK/Language/Web.php @@ -208,7 +208,7 @@ public function getTypeName(array $parameter, array $method = []): string protected function populateGenerics(string $model, array $spec, array &$generics, bool $skipFirst = false) { if (!$skipFirst && $spec['definitions'][$model]['additionalProperties']) { - $generics[] = $this->toUpperCase($model); + $generics[] = $this->toUpperCaseWords($model); } $properties = $spec['definitions'][$model]['properties']; @@ -257,14 +257,14 @@ public function getReturn(array $method, array $spec): string $ret .= 'Models.'; } - $ret .= $this->toUpperCase($method['responseModel']); + $ret .= $this->toUpperCaseWords($method['responseModel']); $models = []; $this->populateGenerics($method['responseModel'], $spec, $models); $models = array_unique($models); - $models = array_filter($models, fn ($model) => $model != $this->toUpperCase($method['responseModel'])); + $models = array_filter($models, fn ($model) => $model != $this->toUpperCaseWords($method['responseModel'])); if (!empty($models)) { $ret .= '<' . implode(', ', $models) . '>'; @@ -284,9 +284,9 @@ public function getSubSchema(array $property, array $spec): string $generics = []; $this->populateGenerics($property['sub_schema'], $spec, $generics); - $generics = array_filter($generics, fn ($model) => $model != $this->toUpperCase($property['sub_schema'])); + $generics = array_filter($generics, fn ($model) => $model != $this->toUpperCaseWords($property['sub_schema'])); - $ret .= $this->toUpperCase($property['sub_schema']); + $ret .= $this->toUpperCaseWords($property['sub_schema']); if (!empty($generics)) { $ret .= '<' . implode(', ', $generics) . '>'; } From a533d6a998af5ccb58204b4fdd8b2370302042bb Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 2 Nov 2022 15:33:47 +1300 Subject: [PATCH 521/555] Update string helper names --- src/SDK/Language.php | 6 +++--- src/SDK/Language/Kotlin.php | 8 ++++---- src/SDK/Language/Web.php | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/SDK/Language.php b/src/SDK/Language.php index 71a87c9cae..41bf13c024 100644 --- a/src/SDK/Language.php +++ b/src/SDK/Language.php @@ -84,12 +84,12 @@ public function getFilters(): array return []; } - protected function toUpperCase(string $value): string + protected function toUpperCaseWords(string $value): string { - return ucfirst($this->helperCamelCase($value)); + return ucfirst($this->toCamelCase($value)); } - protected function helperCamelCase($str): string + protected function toCamelCase($str): string { $str = preg_replace('/[^a-z0-9' . implode("", []) . ']+/i', ' ', $str); $str = trim($str); diff --git a/src/SDK/Language/Kotlin.php b/src/SDK/Language/Kotlin.php index afc9498e06..dd1d78b46e 100644 --- a/src/SDK/Language/Kotlin.php +++ b/src/SDK/Language/Kotlin.php @@ -451,7 +451,7 @@ protected function getReturnType(array $method, array $spec, string $namespace, return 'Any'; } - $ret = $this->toUpperCase($method['responseModel']); + $ret = $this->toUpperCaseWords($method['responseModel']); if ($this->hasGenericType($method['responseModel'], $spec)) { $ret .= '<' . $generic . '>'; @@ -463,15 +463,15 @@ protected function getReturnType(array $method, array $spec, string $namespace, protected function getModelType(array $definition, array $spec, string $generic = 'T'): string { if ($this->hasGenericType($definition['name'], $spec)) { - return $this->toUpperCase($definition['name']) . '<' . $generic . '>'; + return $this->toUpperCaseWords($definition['name']) . '<' . $generic . '>'; } - return $this->toUpperCase($definition['name']); + return $this->toUpperCaseWords($definition['name']); } protected function getPropertyType(array $property, array $spec, string $generic = 'T'): string { if (\array_key_exists('sub_schema', $property)) { - $type = $this->toUpperCase($property['sub_schema']); + $type = $this->toUpperCaseWords($property['sub_schema']); if ($this->hasGenericType($property['sub_schema'], $spec)) { $type .= '<' . $generic . '>'; diff --git a/src/SDK/Language/Web.php b/src/SDK/Language/Web.php index 58b8fd1bb6..26ec511361 100644 --- a/src/SDK/Language/Web.php +++ b/src/SDK/Language/Web.php @@ -208,7 +208,7 @@ public function getTypeName(array $parameter, array $method = []): string protected function populateGenerics(string $model, array $spec, array &$generics, bool $skipFirst = false) { if (!$skipFirst && $spec['definitions'][$model]['additionalProperties']) { - $generics[] = $this->toUpperCase($model); + $generics[] = $this->toUpperCaseWords($model); } $properties = $spec['definitions'][$model]['properties']; @@ -257,14 +257,14 @@ public function getReturn(array $method, array $spec): string $ret .= 'Models.'; } - $ret .= $this->toUpperCase($method['responseModel']); + $ret .= $this->toUpperCaseWords($method['responseModel']); $models = []; $this->populateGenerics($method['responseModel'], $spec, $models); $models = array_unique($models); - $models = array_filter($models, fn ($model) => $model != $this->toUpperCase($method['responseModel'])); + $models = array_filter($models, fn ($model) => $model != $this->toUpperCaseWords($method['responseModel'])); if (!empty($models)) { $ret .= '<' . implode(', ', $models) . '>'; @@ -284,9 +284,9 @@ public function getSubSchema(array $property, array $spec): string $generics = []; $this->populateGenerics($property['sub_schema'], $spec, $generics); - $generics = array_filter($generics, fn ($model) => $model != $this->toUpperCase($property['sub_schema'])); + $generics = array_filter($generics, fn ($model) => $model != $this->toUpperCaseWords($property['sub_schema'])); - $ret .= $this->toUpperCase($property['sub_schema']); + $ret .= $this->toUpperCaseWords($property['sub_schema']); if (!empty($generics)) { $ret .= '<' . implode(', ', $generics) . '>'; } From f1dcfd295f38061dbfdf502f23df2ca185df5536 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Wed, 16 Nov 2022 20:17:58 +0100 Subject: [PATCH 522/555] Upgrade flutter_web_auth_2 --- templates/flutter/pubspec.yaml.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 4be3452cbd..805e5c1875 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -13,7 +13,7 @@ dependencies: sdk: flutter cookie_jar: ^3.0.1 device_info_plus: ^8.0.0 - flutter_web_auth_2: ^1.1.2 + flutter_web_auth_2: ^2.0.2 http: ^0.13.5 package_info_plus: ^3.0.1 path_provider: ^2.0.11 From adb8c88198fad0ae515820fe25b0e97c50155a7b Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Wed, 16 Nov 2022 20:18:11 +0100 Subject: [PATCH 523/555] Update package_info_plus --- templates/flutter/pubspec.yaml.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/pubspec.yaml.twig b/templates/flutter/pubspec.yaml.twig index 805e5c1875..0aae048ede 100644 --- a/templates/flutter/pubspec.yaml.twig +++ b/templates/flutter/pubspec.yaml.twig @@ -15,7 +15,7 @@ dependencies: device_info_plus: ^8.0.0 flutter_web_auth_2: ^2.0.2 http: ^0.13.5 - package_info_plus: ^3.0.1 + package_info_plus: ^3.0.2 path_provider: ^2.0.11 web_socket_channel: ^2.2.0 From 059b28b20c8d99b2684bcc5a611cfa52454320be Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Wed, 16 Nov 2022 20:19:01 +0100 Subject: [PATCH 524/555] Update lints and test --- templates/dart/pubspec.yaml.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/dart/pubspec.yaml.twig b/templates/dart/pubspec.yaml.twig index c2460f9539..72948b6031 100644 --- a/templates/dart/pubspec.yaml.twig +++ b/templates/dart/pubspec.yaml.twig @@ -11,5 +11,5 @@ dependencies: http: ^0.13.5 dev_dependencies: - test: ^1.21.4 - lints: ^2.0.0 + lints: ^2.0.1 + test: ^1.22.0 From b40e642181856f0db027f8e180ca5bb3c4e27603 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 17 Nov 2022 16:29:30 +1300 Subject: [PATCH 525/555] Fix Xcode 14 hang risk warnings --- .../swift/Sources/Services/Service.swift.twig | 4 +-- .../WebSockets/WebSocketClient.swift.twig | 27 +++++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index ae156cf423..90f98616ae 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -31,7 +31,7 @@ open class {{ service.name | caseUcfirst }}: Service { {%~ if 'multipart/form-data' in method.consumes %} onProgress: ((UploadProgress) -> Void)? = nil {%~ endif %} - ) async throws -> {{ method | returnType(spec) | raw }} { + ){%~ if not method.type == "webAuth" %} async{% endif %} throws -> {{ method | returnType(spec) | raw }} { {{~ include('swift/base/params.twig') }} {%~ if method.type == 'webAuth' %} {{~ include('swift/base/requests/OAuth.twig') }} @@ -109,4 +109,4 @@ open class {{ service.name | caseUcfirst }}: Service { {% endfor %} -} \ No newline at end of file +%} \ No newline at end of file diff --git a/templates/swift/Sources/WebSockets/WebSocketClient.swift.twig b/templates/swift/Sources/WebSockets/WebSocketClient.swift.twig index d67ec5d714..6426fcb78b 100644 --- a/templates/swift/Sources/WebSockets/WebSocketClient.swift.twig +++ b/templates/swift/Sources/WebSockets/WebSocketClient.swift.twig @@ -26,10 +26,10 @@ public class WebSocketClient { var channel: Channel? = nil var tlsEnabled: Bool = false var closeSent: Bool = false - - let upgradedSignalled = DispatchSemaphore(value: 0) - let locker = DispatchQueue(label: WEBSOCKET_LOCKER_QUEUE) - let threadGroup = MultiThreadedEventLoopGroup(numberOfThreads: 1) + + let locker = DispatchQueue(label: WEBSOCKET_LOCKER_QUEUE, qos: .background) + + var threadGroup: MultiThreadedEventLoopGroup? = nil weak var delegate: WebSocketClientDelegate? = nil @@ -184,6 +184,10 @@ public class WebSocketClient { self.maxFrameSize = maxFrameSize self.tlsEnabled = tlsEnabled self.delegate = delegate + + DispatchQueue.global(qos: .background).async { + self.threadGroup = MultiThreadedEventLoopGroup(numberOfThreads: 1) + } } /// Create a new `WebSocketClient`. @@ -207,10 +211,14 @@ public class WebSocketClient { self.maxFrameSize = 24 self.tlsEnabled = tlsEnabled self.delegate = delegate + + DispatchQueue.global(qos: .background).async { + self.threadGroup = MultiThreadedEventLoopGroup(numberOfThreads: 1) + } } deinit { - try! threadGroup.syncShutdownGracefully() + try! threadGroup!.syncShutdownGracefully() } // MARK: - Open connection @@ -221,16 +229,16 @@ public class WebSocketClient { SocketOptionLevel(SOL_SOCKET), SO_REUSEPORT ) + + while(threadGroup == nil) {} - let bootstrap = ClientBootstrap(group: threadGroup) + let bootstrap = ClientBootstrap(group: threadGroup!) .channelOption(socketOptions, value: 1) .channelInitializer(self.openChannel) _ = try bootstrap .connect(host: self.host, port: self.port) .wait() - - self.upgradedSignalled.wait() } private func openChannel(channel: Channel) -> EventLoopFuture { @@ -260,13 +268,10 @@ public class WebSocketClient { } private func upgradePipelineHandler(channel: Channel, response: HTTPResponseHead) -> EventLoopFuture { - self.onOpen(channel) - let handler = MessageHandler(client: self) if response.status == .switchingProtocols { self.channel = channel - self.upgradedSignalled.signal() } return channel.pipeline.addHandler(handler) From 22b1e84efcbf2fa64de847f57774c29639a4d0d1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 17 Nov 2022 17:25:12 +1300 Subject: [PATCH 526/555] Fix stack overflow recursion when storing a result without a type specified --- templates/swift/Sources/Services/Service.swift.twig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index ae156cf423..230d6894d4 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -28,6 +28,9 @@ open class {{ service.name | caseUcfirst }}: Service { {{ parameter.name | caseCamel | escapeKeyword }}: {% if parameter.type == "object" %}T{% else %}{{ parameter | typeName | raw }}{% endif %}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} {%~ endfor %} + {%~ if method.responseModel | hasGenericType(spec) %} + nestedType: T.Type, + {%~ endif %} {%~ if 'multipart/form-data' in method.consumes %} onProgress: ((UploadProgress) -> Void)? = nil {%~ endif %} @@ -100,6 +103,7 @@ open class {{ service.name | caseUcfirst }}: Service { {{ parameter.name | caseCamel | escapeKeyword }}: {{ parameter.name | caseCamel | escapeKeyword }}{% if not loop.last %},{% endif %} {%~ endfor %} + nestedType: [String: AnyCodable].self {%~ if 'multipart/form-data' in method.consumes %} onProgress: onProgress {%~ endif %} From 4e3db9690f2ad35726d77671fff5afa76caefe78 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 17 Nov 2022 17:32:09 +1300 Subject: [PATCH 527/555] Fix parameter encoding --- templates/swift/Sources/Client.swift.twig | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index 8b169eb895..55a519b8ed 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -426,7 +426,28 @@ open class Client { _ request: inout HTTPClientRequest, with params: [String: Any?] = [:] ) throws { - let json = try JSONSerialization.data(withJSONObject: params, options: []) + var encodedParams = [String:Any]() + + for (key, param) in params { + if param is String + || param is Int + || param is Float + || param is Bool + || param is [String] + || param is [Int] + || param is [Float] + || param is [Bool] + || param is [String: Any] + || param is [Int: Any] + || param is [Float: Any] + || param is [Bool: Any] + encodedParams[key] = param + } else { + encodedParams[key] = try! (param as! Encodable).toJson() + } + } + + let json = try JSONSerialization.data(withJSONObject: encodedParams, options: []) request.body = .bytes(json) } From 32643f0aab7c44a5d3421c78787fe9de56c4879f Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 17 Nov 2022 18:15:07 +1300 Subject: [PATCH 528/555] Fix syntax errors --- templates/swift/Sources/Services/Service.swift.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index 90f98616ae..fba9085472 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -31,7 +31,7 @@ open class {{ service.name | caseUcfirst }}: Service { {%~ if 'multipart/form-data' in method.consumes %} onProgress: ((UploadProgress) -> Void)? = nil {%~ endif %} - ){%~ if not method.type == "webAuth" %} async{% endif %} throws -> {{ method | returnType(spec) | raw }} { + ){%~ if method.type != "webAuth" %} async{% endif %} throws -> {{ method | returnType(spec) | raw }} { {{~ include('swift/base/params.twig') }} {%~ if method.type == 'webAuth' %} {{~ include('swift/base/requests/OAuth.twig') }} @@ -109,4 +109,4 @@ open class {{ service.name | caseUcfirst }}: Service { {% endfor %} -%} \ No newline at end of file +} \ No newline at end of file From 96f285d17e72192d2b17a09b627e8212e453c551 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 17 Nov 2022 18:48:57 +1300 Subject: [PATCH 529/555] Reenable realtime tests --- tests/AppleSwift55Test.php | 2 +- tests/languages/apple/Tests.swift | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/AppleSwift55Test.php b/tests/AppleSwift55Test.php index fb7098198f..b9b2e88426 100644 --- a/tests/AppleSwift55Test.php +++ b/tests/AppleSwift55Test.php @@ -26,7 +26,7 @@ class AppleSwift55Test extends Base ...Base::LARGE_FILE_RESPONSES, ...Base::LARGE_FILE_RESPONSES, ...Base::EXCEPTION_RESPONSES, - //...Base::REALTIME_RESPONSES, + ...Base::REALTIME_RESPONSES, ...Base::COOKIE_RESPONSES, ...Base::QUERY_HELPER_RESPONSES, ...Base::PERMISSION_HELPER_RESPONSES, diff --git a/tests/languages/apple/Tests.swift b/tests/languages/apple/Tests.swift index 9e6d3f4909..e15195b2f3 100644 --- a/tests/languages/apple/Tests.swift +++ b/tests/languages/apple/Tests.swift @@ -31,12 +31,12 @@ class Tests: XCTestCase { let realtime = Realtime(client) var realtimeResponse = "Realtime failed!" -// let expectation = XCTestExpectation(description: "realtime server") -// -// realtime.subscribe(channels: ["tests"]) { message in -// realtimeResponse = message.payload!["response"] as! String -// expectation.fulfill() -// } + let expectation = XCTestExpectation(description: "realtime server") + + realtime.subscribe(channels: ["tests"]) { message in + realtimeResponse = message.payload!["response"] as! String + expectation.fulfill() + } var mock: Mock @@ -132,8 +132,8 @@ class Tests: XCTestCase { print(error.localizedDescription) } -// wait(for: [expectation], timeout: 10.0) -// print(realtimeResponse) + wait(for: [expectation], timeout: 10.0) + print(realtimeResponse) mock = try await general.setCookie() print(mock.result) From 5160f308d3a8793363d9e92620db55cdfca961aa Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 17 Nov 2022 19:55:58 +1300 Subject: [PATCH 530/555] Fix syntax --- templates/swift/Sources/Client.swift.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/swift/Sources/Client.swift.twig b/templates/swift/Sources/Client.swift.twig index 55a519b8ed..695b839df7 100644 --- a/templates/swift/Sources/Client.swift.twig +++ b/templates/swift/Sources/Client.swift.twig @@ -440,7 +440,7 @@ open class Client { || param is [String: Any] || param is [Int: Any] || param is [Float: Any] - || param is [Bool: Any] + || param is [Bool: Any] { encodedParams[key] = param } else { encodedParams[key] = try! (param as! Encodable).toJson() From 4fb2026472cd4d2f456c9f1a338b6d4d91da9f09 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 17 Nov 2022 20:17:20 +1300 Subject: [PATCH 531/555] Fix merge --- .../kotlin/io/appwrite/services/ServiceTemplate.kt.twig | 4 ++-- templates/swift/Sources/Services/Service.swift.twig | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index 39670af1a9..15b8a21cd1 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -99,11 +99,11 @@ class {{ service.name | caseUcfirst }} : Service { {{ method.headers|map((header, key) => " \"#{key}\" to \"#{header}\"")|join(',\n')|raw }} ) {% if method.responseModel %} - val converter: (Map) -> {{ utils.resultTypeKt(sdk.namespace, method) }} = { + val converter: (Any) -> {{ utils.resultTypeKt(sdk.namespace, method) }} = { {% if method.responseModel == 'any' %} it {% else %} - {{ utils.resultTypeKt(sdk.namespace, method) }}.from(map = it) + {{ utils.resultTypeKt(sdk.namespace, method) }}.from(map = it as Map) {% endif %} } {% endif %} diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index ae156cf423..8d9c73c0db 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -52,11 +52,11 @@ open class {{ service.name | caseUcfirst }}: Service { {%~ endif %} {%~ if method.responseModel %} - let converter: ([String: Any]) -> {{ method | returnType(spec) | raw }} = { dict in + let converter: (Any) -> {{ method | returnType(spec) | raw }} = { response in {%~ if method.responseModel == 'any' %} - return dict + return response {%~ else %} - return {{ spec.title | caseUcfirst}}Models.{{method.responseModel | caseUcfirst}}.from(map: dict) + return {{ spec.title | caseUcfirst}}Models.{{method.responseModel | caseUcfirst}}.from(map: response as! [String: Any]) {%~ endif %} } From 702c7eedd40b08bd43f37d6280da48de6aa210d5 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 17 Nov 2022 20:46:46 +1300 Subject: [PATCH 532/555] Fix merge --- templates/android/docs/java/example.md.twig | 1 - templates/kotlin/docs/java/example.md.twig | 1 - 2 files changed, 2 deletions(-) diff --git a/templates/android/docs/java/example.md.twig b/templates/android/docs/java/example.md.twig index dbe2a51a0c..3056462784 100644 --- a/templates/android/docs/java/example.md.twig +++ b/templates/android/docs/java/example.md.twig @@ -1,4 +1,3 @@ -{% import 'kotlin/base/utils.twig' as utils %} import {{ sdk.namespace | caseDot }}.Client; import {{ sdk.namespace | caseDot }}.coroutines.CoroutineCallback; {% if method.parameters.all | filter((param) => param.type == 'file') | length > 0 %} diff --git a/templates/kotlin/docs/java/example.md.twig b/templates/kotlin/docs/java/example.md.twig index 6c120a361e..0e70d06879 100644 --- a/templates/kotlin/docs/java/example.md.twig +++ b/templates/kotlin/docs/java/example.md.twig @@ -1,4 +1,3 @@ -{% import 'kotlin/base/utils.twig' as utils %} import {{ sdk.namespace | caseDot }}.Client; import {{ sdk.namespace | caseDot }}.coroutines.CoroutineCallback; {% if method.parameters.all | filter((param) => param.type == 'file') | length > 0 %} From 03aacacae6f83879f0076505f27e4254fd4eb5bc Mon Sep 17 00:00:00 2001 From: Daniel Albert Date: Thu, 17 Nov 2022 11:36:10 +0100 Subject: [PATCH 533/555] fix-flutter-oauth2-under-windows --- templates/flutter/base/requests/oauth.twig | 2 +- templates/flutter/lib/src/client.dart.twig | 2 +- templates/flutter/lib/src/client_browser.dart.twig | 4 ++-- templates/flutter/lib/src/client_io.dart.twig | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/flutter/base/requests/oauth.twig b/templates/flutter/base/requests/oauth.twig index 627b4f14e2..36538cd3dc 100644 --- a/templates/flutter/base/requests/oauth.twig +++ b/templates/flutter/base/requests/oauth.twig @@ -31,4 +31,4 @@ query: query.join('&') ); - return client.webAuth(url); \ No newline at end of file + return client.webAuth(url, callbackUrlScheme: success); \ No newline at end of file diff --git a/templates/flutter/lib/src/client.dart.twig b/templates/flutter/lib/src/client.dart.twig index f4eb901b69..c910de109f 100644 --- a/templates/flutter/lib/src/client.dart.twig +++ b/templates/flutter/lib/src/client.dart.twig @@ -19,7 +19,7 @@ abstract class Client { bool selfSigned = false}) => createClient(endPoint: endPoint, selfSigned: selfSigned); - Future webAuth(Uri url); + Future webAuth(Uri url, {String? callbackUrlScheme}); Future chunkedUpload({ required String path, diff --git a/templates/flutter/lib/src/client_browser.dart.twig b/templates/flutter/lib/src/client_browser.dart.twig index f67f65cb90..6c83a7bc51 100644 --- a/templates/flutter/lib/src/client_browser.dart.twig +++ b/templates/flutter/lib/src/client_browser.dart.twig @@ -211,10 +211,10 @@ class ClientBrowser extends ClientBase with ClientMixin { } @override - Future webAuth(Uri url) { + Future webAuth(Uri url, {String? callbackUrlScheme}) { return FlutterWebAuth2.authenticate( url: url.toString(), - callbackUrlScheme: "appwrite-callback-" + config['project']!, + callbackUrlScheme: callbackUrlScheme ?? "appwrite-callback-" + config['project']!, ); } } diff --git a/templates/flutter/lib/src/client_io.dart.twig b/templates/flutter/lib/src/client_io.dart.twig index fd2c8f0d02..ebba2cab4a 100644 --- a/templates/flutter/lib/src/client_io.dart.twig +++ b/templates/flutter/lib/src/client_io.dart.twig @@ -304,10 +304,10 @@ class ClientIO extends ClientBase with ClientMixin { } @override - Future webAuth(Uri url) { + Future webAuth(Uri url, {String? callbackUrlScheme}) { return FlutterWebAuth2.authenticate( url: url.toString(), - callbackUrlScheme: "appwrite-callback-" + config['project']!, + callbackUrlScheme: callbackUrlScheme != null && Platform.isWindows ? callbackUrlScheme : "appwrite-callback-" + config['project']!, ).then((value) async { Uri url = Uri.parse(value); final key = url.queryParameters['key']; From c73e04ac8c79ca9d84cf82571d248ede8d1957cd Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 25 Nov 2022 11:34:25 +0545 Subject: [PATCH 534/555] fix end calculation for chunk --- templates/dart/lib/src/client_browser.dart.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/dart/lib/src/client_browser.dart.twig b/templates/dart/lib/src/client_browser.dart.twig index 230e345e9b..ada3ece4e4 100644 --- a/templates/dart/lib/src/client_browser.dart.twig +++ b/templates/dart/lib/src/client_browser.dart.twig @@ -120,7 +120,7 @@ class ClientBrowser extends ClientBase with ClientMixin { while (offset < size) { var chunk; - final end = min(offset + CHUNK_SIZE-1, size-1); + final end = min(offset + CHUNK_SIZE, size); chunk = file.bytes!.getRange(offset, end).toList(); params[paramName] = http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); From 91a4c1d7e048412ef9199387ac83452826525191 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 25 Nov 2022 11:34:48 +0545 Subject: [PATCH 535/555] fix end calculation --- templates/flutter/lib/src/client_browser.dart.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/lib/src/client_browser.dart.twig b/templates/flutter/lib/src/client_browser.dart.twig index f67f65cb90..0395a0c7cc 100644 --- a/templates/flutter/lib/src/client_browser.dart.twig +++ b/templates/flutter/lib/src/client_browser.dart.twig @@ -149,7 +149,7 @@ class ClientBrowser extends ClientBase with ClientMixin { while (offset < size) { var chunk; - final end = min(offset + CHUNK_SIZE-1, size-1); + final end = min(offset + CHUNK_SIZE, size); chunk = file.bytes!.getRange(offset, end).toList(); params[paramName] = http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename); From fa52900aa46f831018c8adac157c244ab2e6147d Mon Sep 17 00:00:00 2001 From: Chinmay Date: Sun, 27 Nov 2022 18:12:42 +0530 Subject: [PATCH 536/555] Linked long_description with README.md --- templates/python/setup.py.twig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/python/setup.py.twig b/templates/python/setup.py.twig index be41ef80d4..ded8211210 100644 --- a/templates/python/setup.py.twig +++ b/templates/python/setup.py.twig @@ -1,5 +1,10 @@ import setuptools +long_description: str + +with open("README.md", "r", encoding="utf-8") as readme_file_desc: + long_description = readme_file_desc.read() + setuptools.setup( name = '{{spec.title | caseSnake}}', packages = ['{{spec.title | caseSnake}}', '{{spec.title | caseSnake}}/services'], From 56a3baa61a0213587686e7a7db41711e06f45623 Mon Sep 17 00:00:00 2001 From: Chinmay Date: Sun, 27 Nov 2022 18:15:36 +0530 Subject: [PATCH 537/555] Update long_description --- templates/python/setup.py.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/python/setup.py.twig b/templates/python/setup.py.twig index ded8211210..12eee5774b 100644 --- a/templates/python/setup.py.twig +++ b/templates/python/setup.py.twig @@ -11,7 +11,7 @@ setuptools.setup( version = '{{sdk.version}}', license='{{spec.licenseName}}', description = '{{sdk.shortDescription}}', - long_description = '{{sdk.longDescription}}', + long_description = long_description, long_description_content_type = 'text/markdown', author = '{{spec.contactName}}', author_email = '{{spec.contactEmail}}', From f1e06997c5556f0c82194c5fbc588236ad1a923d Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi Date: Mon, 5 Dec 2022 18:05:24 +0000 Subject: [PATCH 538/555] make constructors private for better intellisense --- templates/dart/lib/id.dart.twig | 2 ++ templates/dart/lib/permission.dart.twig | 2 ++ templates/dart/lib/query.dart.twig | 2 ++ templates/dart/lib/role.dart.twig | 2 ++ 4 files changed, 8 insertions(+) diff --git a/templates/dart/lib/id.dart.twig b/templates/dart/lib/id.dart.twig index 12a034738d..b70fa7c72e 100644 --- a/templates/dart/lib/id.dart.twig +++ b/templates/dart/lib/id.dart.twig @@ -1,6 +1,8 @@ part of {{ language.params.packageName }}; class ID { + const ID._(); + static String unique() { return 'unique()'; } diff --git a/templates/dart/lib/permission.dart.twig b/templates/dart/lib/permission.dart.twig index 675d8184b3..756cad9ef3 100644 --- a/templates/dart/lib/permission.dart.twig +++ b/templates/dart/lib/permission.dart.twig @@ -1,6 +1,8 @@ part of {{ language.params.packageName }}; class Permission { + const Permission._(); + static String read(String role) { return 'read("$role")'; } diff --git a/templates/dart/lib/query.dart.twig b/templates/dart/lib/query.dart.twig index bcbf94fd1f..8683d384a3 100644 --- a/templates/dart/lib/query.dart.twig +++ b/templates/dart/lib/query.dart.twig @@ -1,6 +1,8 @@ part of {{ language.params.packageName }}; class Query { + const Query._(); + static equal(String attribute, dynamic value) => _addQuery(attribute, 'equal', value); diff --git a/templates/dart/lib/role.dart.twig b/templates/dart/lib/role.dart.twig index 35eb07414c..c5b7327baf 100644 --- a/templates/dart/lib/role.dart.twig +++ b/templates/dart/lib/role.dart.twig @@ -1,6 +1,8 @@ part of {{ language.params.packageName }}; class Role { + const Role._(); + static String any() { return 'any'; } From 7d09c4e1de8239deb30b7c49f5914640dd7bc63c Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 22 Dec 2022 21:21:06 +1300 Subject: [PATCH 539/555] Update directory structrue for REST templates --- example.php | 2 +- src/SDK/Language/REST.php | 2 +- templates/{http => rest}/docs/example.md.twig | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename templates/{http => rest}/docs/example.md.twig (100%) diff --git a/example.php b/example.php index e0b03084c6..c3948d6bc2 100644 --- a/example.php +++ b/example.php @@ -409,7 +409,7 @@ function getSSLPage($url) { ->setDiscord('564160730845151244', 'https://appwrite.io/discord') ; - $sdk->generate(__DIR__ . '/examples/HTTP'); + $sdk->generate(__DIR__ . '/examples/REST'); // Android diff --git a/src/SDK/Language/REST.php b/src/SDK/Language/REST.php index e53b54ae0b..1d2ff1907f 100644 --- a/src/SDK/Language/REST.php +++ b/src/SDK/Language/REST.php @@ -142,7 +142,7 @@ public function getFiles(): array [ 'scope' => 'method', 'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md', - 'template' => '/http/docs/example.md.twig', + 'template' => '/rest/docs/example.md.twig', ], ]; } diff --git a/templates/http/docs/example.md.twig b/templates/rest/docs/example.md.twig similarity index 100% rename from templates/http/docs/example.md.twig rename to templates/rest/docs/example.md.twig From 61f31e327ea39a9e3206e5b3a0cf206888bacaa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 26 Dec 2022 09:07:40 +0000 Subject: [PATCH 540/555] Fix failing tests --- .../main/java/io/appwrite/services/ServiceTemplate.kt.twig | 6 +++--- .../kotlin/io/appwrite/services/ServiceTemplate.kt.twig | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index 38f28f4a0d..21b2cca078 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -120,11 +120,11 @@ class {{ service.name | caseUcfirst }} : Service { {%~ endfor %} ) {%~ if method.responseModel %} - val converter: (Any) -> {{ method | returnType(spec, sdk.namespace | caseDot) | raw }} = { + val converter: (Any) -> {{ method | returnType(spec, sdk.namespace | caseDot) | raw }} = { {% if method.responseModel == 'any' %} - it + it {% else %} - {{ sdk.namespace | caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) + {{ sdk.namespace | caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) {% endif %} } {%~ endif %} diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index 8e736e93a9..6604ccc2e0 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -68,11 +68,11 @@ class {{ service.name | caseUcfirst }} : Service { {%~ endfor %} ) {%~ if method.responseModel %} - val converter: (Any) -> {{ method | returnType(spec, sdk.namespace | caseDot) | raw }} = { + val converter: (Any) -> {{ method | returnType(spec, sdk.namespace | caseDot) | raw }} = { {% if method.responseModel == 'any' %} - it + it {% else %} - {{ sdk.namespace | caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) + {{ sdk.namespace | caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) {% endif %} } {%~ endif %} From ef98dbfbe598e3d5f8a27729aca40a362622193f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 26 Dec 2022 09:15:52 +0000 Subject: [PATCH 541/555] conflict fix --- .../main/java/io/appwrite/services/ServiceTemplate.kt.twig | 4 ++-- .../main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index 21b2cca078..b0bc566267 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -120,11 +120,11 @@ class {{ service.name | caseUcfirst }} : Service { {%~ endfor %} ) {%~ if method.responseModel %} - val converter: (Any) -> {{ method | returnType(spec, sdk.namespace | caseDot) | raw }} = { + val converter: (Any) -> {{ _self.resultType(sdk.namespace, method) }} = { {% if method.responseModel == 'any' %} it {% else %} - {{ sdk.namespace | caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) + {{ _self.resultType(sdk.namespace, method) }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) {% endif %} } {%~ endif %} diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index 6604ccc2e0..7979daa839 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -68,11 +68,11 @@ class {{ service.name | caseUcfirst }} : Service { {%~ endfor %} ) {%~ if method.responseModel %} - val converter: (Any) -> {{ method | returnType(spec, sdk.namespace | caseDot) | raw }} = { + val converter: (Any) -> {{ utils.resultTypeKt(sdk.namespace, method) }} = { {% if method.responseModel == 'any' %} it {% else %} - {{ sdk.namespace | caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) + {{ utils.resultTypeKt(sdk.namespace, method) }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) {% endif %} } {%~ endif %} From a97c3fbf62f8cd9e85b70a651196db181fc5aa49 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 26 Dec 2022 10:08:09 +0000 Subject: [PATCH 542/555] fix conflict merge --- .../main/java/io/appwrite/services/ServiceTemplate.kt.twig | 4 ++-- .../main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index b0bc566267..811d078fb0 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -120,11 +120,11 @@ class {{ service.name | caseUcfirst }} : Service { {%~ endfor %} ) {%~ if method.responseModel %} - val converter: (Any) -> {{ _self.resultType(sdk.namespace, method) }} = { + val converter: (Any) -> {{ method | returnType(spec, sdk.namespace | caseDot) | raw }} = { {% if method.responseModel == 'any' %} it {% else %} - {{ _self.resultType(sdk.namespace, method) }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) + {{ method | returnType(spec, sdk.namespace | caseDot) | raw }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) {% endif %} } {%~ endif %} diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index 7979daa839..7d4807ec63 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -68,11 +68,11 @@ class {{ service.name | caseUcfirst }} : Service { {%~ endfor %} ) {%~ if method.responseModel %} - val converter: (Any) -> {{ utils.resultTypeKt(sdk.namespace, method) }} = { + val converter: (Any) -> {{ method | returnType(spec, sdk.namespace | caseDot) | raw }} = { {% if method.responseModel == 'any' %} it {% else %} - {{ utils.resultTypeKt(sdk.namespace, method) }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) + {{ method | returnType(spec, sdk.namespace | caseDot) | raw }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) {% endif %} } {%~ endif %} From a7e9bd97b49b6888db06e038b42d4041b59ba72b Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 26 Dec 2022 10:10:31 +0000 Subject: [PATCH 543/555] fix convert error --- .../src/main/java/io/appwrite/services/ServiceTemplate.kt.twig | 2 +- .../main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index 811d078fb0..f5c6adef35 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -124,7 +124,7 @@ class {{ service.name | caseUcfirst }} : Service { {% if method.responseModel == 'any' %} it {% else %} - {{ method | returnType(spec, sdk.namespace | caseDot) | raw }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) + {{sdk.namespace caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) {% endif %} } {%~ endif %} diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index 7d4807ec63..ed4b16d09e 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -72,7 +72,7 @@ class {{ service.name | caseUcfirst }} : Service { {% if method.responseModel == 'any' %} it {% else %} - {{ method | returnType(spec, sdk.namespace | caseDot) | raw }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) + {{sdk.namespace caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) {% endif %} } {%~ endif %} From e3972355534edd18a4514ee56a1e6f8a18e56273 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 26 Dec 2022 10:11:18 +0000 Subject: [PATCH 544/555] fix typo --- .../src/main/java/io/appwrite/services/ServiceTemplate.kt.twig | 2 +- .../main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig index f5c6adef35..f665880bde 100644 --- a/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/android/library/src/main/java/io/appwrite/services/ServiceTemplate.kt.twig @@ -124,7 +124,7 @@ class {{ service.name | caseUcfirst }} : Service { {% if method.responseModel == 'any' %} it {% else %} - {{sdk.namespace caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) + {{sdk.namespace | caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) {% endif %} } {%~ endif %} diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig index ed4b16d09e..00ce691ab2 100644 --- a/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig +++ b/templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig @@ -72,7 +72,7 @@ class {{ service.name | caseUcfirst }} : Service { {% if method.responseModel == 'any' %} it {% else %} - {{sdk.namespace caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) + {{sdk.namespace | caseDot}}.models.{{ method.responseModel | caseUcfirst }}.from(map = it as Map{% if method.responseModel | hasGenericType(spec) %}, nestedType{% endif %}) {% endif %} } {%~ endif %} From e8f3687e5724bade13f2b02daaf08eca60768661 Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi Date: Tue, 27 Dec 2022 17:41:41 +0000 Subject: [PATCH 545/555] remove const --- templates/dart/lib/id.dart.twig | 2 +- templates/dart/lib/permission.dart.twig | 2 +- templates/dart/lib/query.dart.twig | 2 +- templates/dart/lib/role.dart.twig | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/dart/lib/id.dart.twig b/templates/dart/lib/id.dart.twig index b70fa7c72e..30360f557a 100644 --- a/templates/dart/lib/id.dart.twig +++ b/templates/dart/lib/id.dart.twig @@ -1,7 +1,7 @@ part of {{ language.params.packageName }}; class ID { - const ID._(); + ID._(); static String unique() { return 'unique()'; diff --git a/templates/dart/lib/permission.dart.twig b/templates/dart/lib/permission.dart.twig index 756cad9ef3..618f25bb09 100644 --- a/templates/dart/lib/permission.dart.twig +++ b/templates/dart/lib/permission.dart.twig @@ -1,7 +1,7 @@ part of {{ language.params.packageName }}; class Permission { - const Permission._(); + Permission._(); static String read(String role) { return 'read("$role")'; diff --git a/templates/dart/lib/query.dart.twig b/templates/dart/lib/query.dart.twig index 8683d384a3..70b6141de3 100644 --- a/templates/dart/lib/query.dart.twig +++ b/templates/dart/lib/query.dart.twig @@ -1,7 +1,7 @@ part of {{ language.params.packageName }}; class Query { - const Query._(); + Query._(); static equal(String attribute, dynamic value) => _addQuery(attribute, 'equal', value); diff --git a/templates/dart/lib/role.dart.twig b/templates/dart/lib/role.dart.twig index c5b7327baf..9b4461c85c 100644 --- a/templates/dart/lib/role.dart.twig +++ b/templates/dart/lib/role.dart.twig @@ -1,7 +1,7 @@ part of {{ language.params.packageName }}; class Role { - const Role._(); + Role._(); static String any() { return 'any'; From 8bf59a12f908ab5e2429f801cc9ea0deabb1217a Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Tue, 27 Dec 2022 12:08:28 -0800 Subject: [PATCH 546/555] Make sure attributes with $ use _ instead in GraphQL examples $ is reserved so we had to replace all $ with _ --- templates/graphql/docs/example.md.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/graphql/docs/example.md.twig b/templates/graphql/docs/example.md.twig index 1b8a85271a..3840ac7fd3 100644 --- a/templates/graphql/docs/example.md.twig +++ b/templates/graphql/docs/example.md.twig @@ -58,7 +58,7 @@ mutation { {%~ for definition in spec.definitions %} {%~ if definition.name == method.responseModel %} {%~ for property in definition.properties | filter(p => p.required) %} - {{ property.name | caseCamel }} + {{ property.name | replace({'$': '_'}) }} {%~ endfor %} {%~ if definition.additionalProperties %} data From b96813fce28d8346b858cf711bfe1d7b13384ca3 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Tue, 27 Dec 2022 18:28:19 -0800 Subject: [PATCH 547/555] Recursively display response model attributes for graphql examples --- templates/graphql/docs/example.md.twig | 29 +++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/templates/graphql/docs/example.md.twig b/templates/graphql/docs/example.md.twig index 3840ac7fd3..7d6bcd51bb 100644 --- a/templates/graphql/docs/example.md.twig +++ b/templates/graphql/docs/example.md.twig @@ -1,3 +1,21 @@ +{% macro getProperty(definitions, responseModel, depth) %} + {%~ for definition in definitions %} + {%~ if definition.name == responseModel %} + {%~ for property in definition.properties | filter(p => p.required) %} + {{ ("% " ~ depth * 4 ~ "s") |format("") }}{{ property.name | replace({'$': '_'}) }}{%~ if property.sub_schema %} {{ '{' }} + {{- '\n' -}} + {{- _self.getProperty(definitions, property.sub_schema, depth + 1) -}} + {{ ("% " ~ depth * 4 ~ "s") |format("") }}{{ ' }' }} + {%~ else %} + {{- '\n' -}} + {%~ endif %} + {%~ endfor %} + {%~ if definition.additionalProperties %} + {{ ("% " ~ depth * 4 ~ "s") |format("") }}data + {%~ endif %} + {%~ endif %} + {%~ endfor %} +{% endmacro %} {% for key,header in method.headers %} {% if header == 'multipart/form-data' %} {% set boundary = 'cec8e8123c05ba25' %} @@ -55,16 +73,7 @@ mutation { {%~ if method.responseModel == 'none' or method.responseModel == '' %} status {%~ else %} - {%~ for definition in spec.definitions %} - {%~ if definition.name == method.responseModel %} - {%~ for property in definition.properties | filter(p => p.required) %} - {{ property.name | replace({'$': '_'}) }} - {%~ endfor %} - {%~ if definition.additionalProperties %} - data - {%~ endif %} - {%~ endif %} - {%~ endfor %} + {{- _self.getProperty(spec.definitions, method.responseModel, 0) -}} {%~ endif %} } } From b5fd95603e19a45f128b249a235f6ba56eb3016c Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Wed, 28 Dec 2022 13:55:09 -0800 Subject: [PATCH 548/555] Fix "unexpected end of file" error This workaround fixes a bug in axios. See https://stackoverflow.com/questions/74779161/why-axios-returns-z-buf-error --- templates/node/lib/client.js.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/node/lib/client.js.twig b/templates/node/lib/client.js.twig index 07a4928fe6..1be2e1869c 100644 --- a/templates/node/lib/client.js.twig +++ b/templates/node/lib/client.js.twig @@ -9,6 +9,7 @@ class Client { constructor() { this.endpoint = '{{spec.endpoint}}'; this.headers = { + 'accept-encoding': '*', 'content-type': '', 'x-sdk-name': '{{ sdk.name }}', 'x-sdk-platform': '{{ sdk.platform }}', From ccd34b089315c030302a14a89f58b6637cb7b7b5 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Wed, 28 Dec 2022 16:00:40 -0800 Subject: [PATCH 549/555] Fix chunk slicing slice() takes a start and end rather than start and length --- templates/node/base/requests/file.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/base/requests/file.twig b/templates/node/base/requests/file.twig index 80ca5faaaa..268da20a9f 100644 --- a/templates/node/base/requests/file.twig +++ b/templates/node/base/requests/file.twig @@ -81,7 +81,7 @@ const chunks = []; for(let i = 0; i < chunksCount; i++) { - const chunk = mainChunk.slice(i * client.CHUNK_SIZE, client.CHUNK_SIZE); + const chunk = mainChunk.slice(i * client.CHUNK_SIZE, (i + 1) * client.CHUNK_SIZE); chunks.push(chunk); } From 3763b01e359d971dcb9f49705881a111ce867af5 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Wed, 28 Dec 2022 16:01:04 -0800 Subject: [PATCH 550/555] Fix typing for InputFile --- templates/node/index.d.ts.twig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/node/index.d.ts.twig b/templates/node/index.d.ts.twig index 69e2cab0d8..f7d664706d 100644 --- a/templates/node/index.d.ts.twig +++ b/templates/node/index.d.ts.twig @@ -131,11 +131,13 @@ declare module "{{ language.params.npmPackage|caseDash }}" { static fromBuffer(buffer: Buffer, filename: string): InputFile; - static fromBlob(blob: Blob, filename: string): InputFile; + static fromBlob(blob: buffer.Blob, filename: string): Promise; - static fromStream(stream: any, filename: string, size: number): InputFile; + static fromStream(stream: NodeJS.ReadableStream, filename: string, size: number): InputFile; static fromPlainText(content: string, filename: string): InputFile; + + constructor(stream: NodeJS.ReadableStream, filename: string, size: number); } type QueryTypesSingle = string | number | boolean; From e85b2396f2f840a0835e720891f351f329f4d474 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Wed, 28 Dec 2022 16:03:19 -0800 Subject: [PATCH 551/555] Fix InputFile helpers to avoid toString() toString() can change the actual data and corrupt the upload --- templates/node/lib/inputFile.js.twig | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/templates/node/lib/inputFile.js.twig b/templates/node/lib/inputFile.js.twig index d4b5fcf60d..de7f0d9c7b 100644 --- a/templates/node/lib/inputFile.js.twig +++ b/templates/node/lib/inputFile.js.twig @@ -1,6 +1,5 @@ const { Readable } = require('stream'); const fs = require('fs'); -const { promisify } = require('util'); class InputFile { stream; // Content of file, readable stream @@ -14,16 +13,15 @@ class InputFile { }; static fromBuffer = (buffer, filename) => { - const stream = Readable.from(buffer.toString()); + const stream = Readable.from(buffer); const size = Buffer.byteLength(buffer); return new InputFile(stream, filename, size); }; - static fromBlob = (blob, filename) => { - const buffer = blob.arrayBuffer(); - const stream = Readable.from(buffer.toString()); - const size = Buffer.byteLength(buffer); - return new InputFile(stream, filename); + static fromBlob = async (blob, filename) => { + const arrayBuffer = await blob.arrayBuffer(); + const buffer = Buffer.from(arrayBuffer); + return InputFile.fromBuffer(buffer, filename); }; static fromStream = (stream, filename, size) => { @@ -32,7 +30,7 @@ class InputFile { static fromPlainText = (content, filename) => { const buffer = Buffer.from(content, "utf-8"); - const stream = Readable.from(buffer.toString()); + const stream = Readable.from(buffer); const size = Buffer.byteLength(buffer); return new InputFile(stream, filename, size); }; From 2fbf240a20dd59f0bd7c296ad8fd4ba90994f539 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Wed, 28 Dec 2022 16:43:47 -0800 Subject: [PATCH 552/555] Fix incorrect Response return type --- templates/node/index.d.ts.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node/index.d.ts.twig b/templates/node/index.d.ts.twig index f7d664706d..99809fa057 100644 --- a/templates/node/index.d.ts.twig +++ b/templates/node/index.d.ts.twig @@ -237,7 +237,7 @@ declare module "{{ language.params.npmPackage|caseDash }}" { * @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception} * @returns {Promise} */ - {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}): Promise<{% if method.type == 'location' %}Buffer{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}>; + {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required %}?{% endif %}: {{ parameter | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}): Promise<{% if method.type == 'location' %}Buffer{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}string{% endif %}{% endif %}>; {% endfor %} } {% endfor %} From ac63dcea46c84e06811c68fc783d14b87b02629f Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Wed, 28 Dec 2022 18:38:40 -0800 Subject: [PATCH 553/555] Ensure node file upload captures and throws errors stream.write() must handle errors or else undefined behavior may occur. See https://nodejs.org/api/stream.html\#errors-while-writing for more info. --- templates/node/base/requests/file.twig | 78 ++++++++++++++------------ 1 file changed, 43 insertions(+), 35 deletions(-) diff --git a/templates/node/base/requests/file.twig b/templates/node/base/requests/file.twig index 80ca5faaaa..f22d31c87d 100644 --- a/templates/node/base/requests/file.twig +++ b/templates/node/base/requests/file.twig @@ -74,48 +74,56 @@ return await new Promise((resolve, reject) => { const writeStream = new Stream.Writable(); - writeStream._write = async (mainChunk, encoding, next) => { - // Segment incoming chunk into up to 5MB chunks - const mainChunkSize = Buffer.byteLength(mainChunk); - const chunksCount = Math.ceil(mainChunkSize / client.CHUNK_SIZE); - const chunks = []; - - for(let i = 0; i < chunksCount; i++) { - const chunk = mainChunk.slice(i * client.CHUNK_SIZE, client.CHUNK_SIZE); - chunks.push(chunk); - } + writeStream._write = async (mainChunk, encoding, callback) => { + try { + // Segment incoming chunk into up to 5MB chunks + const mainChunkSize = Buffer.byteLength(mainChunk); + const chunksCount = Math.ceil(mainChunkSize / client.CHUNK_SIZE); + const chunks = []; + + for(let i = 0; i < chunksCount; i++) { + const chunk = mainChunk.slice(i * client.CHUNK_SIZE, client.CHUNK_SIZE); + chunks.push(chunk); + } - for (const chunk of chunks) { - const chunkSize = Buffer.byteLength(chunk); - - if(chunkSize + currentChunkSize == client.CHUNK_SIZE) { - // Upload chunk - currentChunk = Buffer.concat([currentChunk, chunk]); - await uploadChunk(); - currentChunk = Buffer.from(''); - currentChunkSize = 0; - } else if(chunkSize + currentChunkSize > client.CHUNK_SIZE) { - // Upload chunk, put rest into next chunk - const bytesToUpload = client.CHUNK_SIZE - currentChunkSize; - const newChunkSection = chunk.slice(0, bytesToUpload); - currentChunk = Buffer.concat([currentChunk, newChunkSection]); - currentChunkSize = Buffer.byteLength(currentChunk); - await uploadChunk(); - currentChunk = chunk.slice(bytesToUpload, undefined); - currentChunkSize = chunkSize - bytesToUpload; - } else { - // Append into current chunk - currentChunk = Buffer.concat([currentChunk, chunk]); - currentChunkSize = chunkSize + currentChunkSize; + for (const chunk of chunks) { + const chunkSize = Buffer.byteLength(chunk); + + if(chunkSize + currentChunkSize == client.CHUNK_SIZE) { + // Upload chunk + currentChunk = Buffer.concat([currentChunk, chunk]); + await uploadChunk(); + currentChunk = Buffer.from(''); + currentChunkSize = 0; + } else if(chunkSize + currentChunkSize > client.CHUNK_SIZE) { + // Upload chunk, put rest into next chunk + const bytesToUpload = client.CHUNK_SIZE - currentChunkSize; + const newChunkSection = chunk.slice(0, bytesToUpload); + currentChunk = Buffer.concat([currentChunk, newChunkSection]); + currentChunkSize = Buffer.byteLength(currentChunk); + await uploadChunk(); + currentChunk = chunk.slice(bytesToUpload, undefined); + currentChunkSize = chunkSize - bytesToUpload; + } else { + // Append into current chunk + currentChunk = Buffer.concat([currentChunk, chunk]); + currentChunkSize = chunkSize + currentChunkSize; + } } - } - next(); + callback(); + } catch (e) { + callback(e); + } } writeStream.on("finish", async () => { if(currentChunkSize > 0) { - await uploadChunk(true); + try { + await uploadChunk(true); + } catch (e) { + reject(e); + } } resolve(response); From e71980745cdaec52bdc97ff7f9a1bbe161b91b35 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 2 Jan 2023 05:03:34 +0000 Subject: [PATCH 554/555] fix , when there was nested type --- templates/swift/Sources/Services/Service.swift.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/swift/Sources/Services/Service.swift.twig b/templates/swift/Sources/Services/Service.swift.twig index 6f3a32d61e..8d27fa72d1 100644 --- a/templates/swift/Sources/Services/Service.swift.twig +++ b/templates/swift/Sources/Services/Service.swift.twig @@ -25,11 +25,11 @@ open class {{ service.name | caseUcfirst }}: Service { {%~ endif %} open func {{ method.name | caseCamel }}{% if method.responseModel | hasGenericType(spec) %}{% endif %}( {%~ for parameter in method.parameters.all %} - {{ parameter.name | caseCamel | escapeKeyword }}: {% if parameter.type == "object" %}T{% else %}{{ parameter | typeName | raw }}{% endif %}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes %},{% endif %} + {{ parameter.name | caseCamel | escapeKeyword }}: {% if parameter.type == "object" %}T{% else %}{{ parameter | typeName | raw }}{% endif %}{% if not parameter.required %}? = nil{% endif %}{% if not loop.last or 'multipart/form-data' in method.consumes or method.responseModel | hasGenericType(spec) %},{% endif %} {%~ endfor %} {%~ if method.responseModel | hasGenericType(spec) %} - nestedType: T.Type, + nestedType: T.Type {%~ endif %} {%~ if 'multipart/form-data' in method.consumes %} onProgress: ((UploadProgress) -> Void)? = nil From a983eb321be6ab8b383f62192f67050eb033662f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 9 Jan 2023 11:00:20 +0545 Subject: [PATCH 555/555] fix flutter web oauth issue Fix for https://github.com/appwrite/sdk-for-flutter/issues/114 --- templates/flutter/lib/src/client_browser.dart.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/flutter/lib/src/client_browser.dart.twig b/templates/flutter/lib/src/client_browser.dart.twig index 894e72f291..4f3fd0d739 100644 --- a/templates/flutter/lib/src/client_browser.dart.twig +++ b/templates/flutter/lib/src/client_browser.dart.twig @@ -214,7 +214,7 @@ class ClientBrowser extends ClientBase with ClientMixin { Future webAuth(Uri url, {String? callbackUrlScheme}) { return FlutterWebAuth2.authenticate( url: url.toString(), - callbackUrlScheme: callbackUrlScheme ?? "appwrite-callback-" + config['project']!, + callbackUrlScheme: "appwrite-callback-" + config['project']!, ); } }