Query structured spec data via REST or MCP. Get exactly what your agent needs.
https://cloud.appwrite.io/v1
/account
Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the /account/verfication 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.
application/json
AccountCreateNewUserRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| string | required | |
| userId | string | required |
| password | string | required |
User
POST /account
/account/jwt
Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
JWT
POST /account/jwt
/account/mfa/authenticators/{type}
Add an authenticator app to be used as an MFA factor. Verify the authenticator using the verify authenticator method.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| type | path | required | string | Type of authenticator. Must be |
MFAType
POST /account/mfa/authenticators/{type}
/account/mfa/challenge
Begin the process of MFA verification after sign-in. Finish the flow with updateMfaChallenge method.
application/json
AccountBeginMfaVerificationRequest
| Property | Type | Required |
|---|---|---|
| factor | string | required |
MFA Challenge
POST /account/mfa/challenge
/account/mfa/recovery-codes
Generate recovery codes as backup for MFA flow. It’s recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in createMfaChallenge method.
MFA Recovery Codes
POST /account/mfa/recovery-codes
/account/recovery
Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the PUT /account/recovery endpoint to complete the process. The verification link sent to the user’s email address is valid for 1 hour.
application/json
AccountCreatePasswordRecoveryRequest
| Property | Type | Required |
|---|---|---|
| url | string | required |
| string | required |
Token
POST /account/recovery
/account/sessions/anonymous
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 or create an OAuth2 session.
Session
POST /account/sessions/anonymous
/account/sessions/email
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.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
application/json
AccountCreateEmailPasswordSessionRequest
| Property | Type | Required |
|---|---|---|
| string | required | |
| password | string | required |
Session
POST /account/sessions/email
/account/sessions/token
Use this endpoint to create a session from token. Provide the userId and secret parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
application/json
AccountCreateTokenSessionRequest
| Property | Type | Required |
|---|---|---|
| secret | string | required |
| userId | string | required |
Session
POST /account/sessions/token
/account/tokens/email
Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the POST /v1/account/sessions/token endpoint to complete the login process. The secret sent to the user’s email is valid for 15 minutes.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
application/json
AccountCreateEmailTokenRequest
| Property | Type | Required |
|---|---|---|
| string | required | |
| phrase | boolean | optional |
| userId | string | required |
Token
POST /account/tokens/email
/account/tokens/magic-url
Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the POST /v1/account/sessions/token 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.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
application/json
AccountCreateMagicUrlTokenRequest
| Property | Type | Required |
|---|---|---|
| url | string | optional |
| string | required | |
| phrase | boolean | optional |
| userId | string | required |
Token
POST /account/tokens/magic-url
/account/tokens/phone
Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the POST /v1/account/sessions/token endpoint to complete the login process. The secret sent to the user’s phone is valid for 15 minutes.
A user is limited to 10 active sessions at a time by default. Learn more about session limits.
application/json
AccountCreatePhoneTokenRequest
| Property | Type | Required |
|---|---|---|
| phone | string | required |
| userId | string | required |
Token
POST /account/tokens/phone
/account/verification
Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the userId and secret arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the userId and secret parameters. Learn more about how to complete the verification process. The verification link sent to the user’s email address is valid for 7 days.
Please note that in order to avoid a Redirect Attack, the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
application/json
AccountCreateEmailVerificationRequest
| Property | Type | Required |
|---|---|---|
| url | string | required |
Token
POST /account/verification
/account/verification/phone
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 endpoint. Learn more about how to complete the verification process. The verification code sent to the user’s phone number is valid for 15 minutes.
Token
POST /account/verification/phone
/databases
Create a new Database.
application/json
DatabasesCreateDatabaseRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| enabled | boolean | optional |
| databaseId | string | required |
Database
POST /databases
/databases/{databaseId}/collections
Create a new Collection. Before using this route, you should create a new database resource using either a server integration API or directly from your database console.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| databaseId | path | required | string | Database ID. |
application/json
DatabasesCreateCollectionRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| enabled | boolean | optional |
| permissions | array | optional |
| collectionId | string | required |
| documentSecurity | boolean | optional |
Collection
POST /databases/{databaseId}/collections
/databases/{databaseId}/collections/{collectionId}/attributes/boolean
Create a boolean attribute.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| databaseId | path | required | string | Database ID. |
| collectionId | path | required | string | Collection ID. You can create a new collection using the Database service server integration. |
application/json
DatabasesCreateBooleanAttributeRequest
| Property | Type | Required |
|---|---|---|
| key | string | required |
| array | boolean | optional |
| default | boolean | optional |
| required | boolean | required |
AttributeBoolean
POST /databases/{databaseId}/collections/{collectionId}/attributes/boolean
/databases/{databaseId}/collections/{collectionId}/attributes/datetime
Create a date time attribute according to the ISO 8601 standard.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| databaseId | path | required | string | Database ID. |
| collectionId | path | required | string | Collection ID. You can create a new collection using the Database service server integration. |
application/json
DatabasesCreateDatetimeAttributeRequest
| Property | Type | Required |
|---|---|---|
| key | string | required |
| array | boolean | optional |
| default | string | optional |
| required | boolean | required |
AttributeDatetime
POST /databases/{databaseId}/collections/{collectionId}/attributes/datetime
/databases/{databaseId}/collections/{collectionId}/attributes/email
Create an email attribute.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| databaseId | path | required | string | Database ID. |
| collectionId | path | required | string | Collection ID. You can create a new collection using the Database service server integration. |
application/json
DatabasesCreateEmailAttributeRequest
| Property | Type | Required |
|---|---|---|
| key | string | required |
| array | boolean | optional |
| default | string | optional |
| required | boolean | required |
AttributeEmail
POST /databases/{databaseId}/collections/{collectionId}/attributes/email
/databases/{databaseId}/collections/{collectionId}/attributes/enum
Create an enumeration attribute. The elements param acts as a white-list of accepted values for this attribute.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| databaseId | path | required | string | Database ID. |
| collectionId | path | required | string | Collection ID. You can create a new collection using the Database service server integration. |
application/json
DatabasesCreateEnumAttributeRequest
| Property | Type | Required |
|---|---|---|
| key | string | required |
| array | boolean | optional |
| default | string | optional |
| elements | array | required |
| required | boolean | required |
AttributeEnum
POST /databases/{databaseId}/collections/{collectionId}/attributes/enum
/databases/{databaseId}/collections/{collectionId}/attributes/float
Create a float attribute. Optionally, minimum and maximum values can be provided.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| databaseId | path | required | string | Database ID. |
| collectionId | path | required | string | Collection ID. You can create a new collection using the Database service server integration. |
application/json
DatabasesCreateFloatAttributeRequest
| Property | Type | Required |
|---|---|---|
| key | string | required |
| max | number | optional |
| min | number | optional |
| array | boolean | optional |
| default | number | optional |
| required | boolean | required |
AttributeFloat
POST /databases/{databaseId}/collections/{collectionId}/attributes/float
/databases/{databaseId}/collections/{collectionId}/attributes/integer
Create an integer attribute. Optionally, minimum and maximum values can be provided.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| databaseId | path | required | string | Database ID. |
| collectionId | path | required | string | Collection ID. You can create a new collection using the Database service server integration. |
application/json
DatabasesCreateIntegerAttributeRequest
| Property | Type | Required |
|---|---|---|
| key | string | required |
| max | integer | optional |
| min | integer | optional |
| array | boolean | optional |
| default | integer | optional |
| required | boolean | required |
AttributeInteger
POST /databases/{databaseId}/collections/{collectionId}/attributes/integer
/databases/{databaseId}/collections/{collectionId}/attributes/ip
Create IP address attribute.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| databaseId | path | required | string | Database ID. |
| collectionId | path | required | string | Collection ID. You can create a new collection using the Database service server integration. |
application/json
DatabasesCreateIpAttributeRequest
| Property | Type | Required |
|---|---|---|
| key | string | required |
| array | boolean | optional |
| default | string | optional |
| required | boolean | required |
AttributeIP
POST /databases/{databaseId}/collections/{collectionId}/attributes/ip
/databases/{databaseId}/collections/{collectionId}/attributes/relationship
Create relationship attribute. Learn more about relationship attributes.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| databaseId | path | required | string | Database ID. |
| collectionId | path | required | string | Collection ID. You can create a new collection using the Database service server integration. |
application/json
DatabasesCreateRelationshipAttributeRequest
| Property | Type | Required |
|---|---|---|
| key | string | optional |
| type | string | required |
| twoWay | boolean | optional |
| onDelete | string | optional |
| twoWayKey | string | optional |
| relatedCollectionId | string | required |
AttributeRelationship
POST /databases/{databaseId}/collections/{collectionId}/attributes/relationship
/databases/{databaseId}/collections/{collectionId}/attributes/string
Create a string attribute.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| databaseId | path | required | string | Database ID. |
| collectionId | path | required | string | Collection ID. You can create a new collection using the Database service server integration. |
application/json
DatabasesCreateStringAttributeRequest
| Property | Type | Required |
|---|---|---|
| key | string | required |
| size | integer | required |
| array | boolean | optional |
| default | string | optional |
| encrypt | boolean | optional |
| required | boolean | required |
AttributeString
POST /databases/{databaseId}/collections/{collectionId}/attributes/string
/databases/{databaseId}/collections/{collectionId}/attributes/url
Create a URL attribute.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| databaseId | path | required | string | Database ID. |
| collectionId | path | required | string | Collection ID. You can create a new collection using the Database service server integration. |
application/json
DatabasesCreateUrlAttributeRequest
| Property | Type | Required |
|---|---|---|
| key | string | required |
| array | boolean | optional |
| default | string | optional |
| required | boolean | required |
AttributeURL
POST /databases/{databaseId}/collections/{collectionId}/attributes/url
/databases/{databaseId}/collections/{collectionId}/documents
Create a new Document. Before using this route, you should create a new collection resource using either a server integration API or directly from your database console.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| databaseId | path | required | string | Database ID. |
| collectionId | path | required | string | Collection ID. You can create a new collection using the Database service server integration. Make sure to define attributes before creating documents. |
application/json
DatabasesCreateDocumentRequest
| Property | Type | Required |
|---|---|---|
| data | object | required |
| documentId | string | required |
| permissions | array | optional |
Document
POST /databases/{databaseId}/collections/{collectionId}/documents
/databases/{databaseId}/collections/{collectionId}/indexes
Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
Attributes can be key, fulltext, and unique.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| databaseId | path | required | string | Database ID. |
| collectionId | path | required | string | Collection ID. You can create a new collection using the Database service server integration. |
application/json
DatabasesCreateIndexRequest
| Property | Type | Required |
|---|---|---|
| key | string | required |
| type | string | required |
| orders | array | optional |
| attributes | array | required |
Index
POST /databases/{databaseId}/collections/{collectionId}/indexes
/functions
Create a new function. You can pass a list of permissions to allow different project users or team with access to execute the function using the client API.
application/json
FunctionsCreateNewFunctionRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| events | array | optional |
| enabled | boolean | optional |
| execute | array | optional |
| logging | boolean | optional |
| runtime | string | required |
| timeout | integer | optional |
| commands | string | optional |
| schedule | string | optional |
| entrypoint | string | optional |
| functionId | string | required |
| templateOwner | string | optional |
| installationId | string | optional |
| providerBranch | string | optional |
| templateBranch | string | optional |
| providerSilentMode | boolean | optional |
| templateRepository | string | optional |
| providerRepositoryId | string | optional |
| providerRootDirectory | string | optional |
| templateRootDirectory | string | optional |
Function
POST /functions
/functions/{functionId}/deployments
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.
This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the Appwrite Cloud Functions tutorial.
Use the “command” param to set the entrypoint used to execute your code.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| functionId | path | required | string | Function ID. |
multipart/form-data
FunctionsCreateDeploymentFunctionCodeRequest
| Property | Type | Required |
|---|---|---|
| code | string | required |
| activate | boolean | required |
| commands | string | optional |
| entrypoint | string | optional |
Deployment
POST /functions/{functionId}/deployments
/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}
Create a new build for an Appwrite Function deployment. This endpoint can be used to retry a failed build.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| functionId | path | required | string | Function ID. |
| deploymentId | path | required | string | Deployment ID. |
| buildId | path | required | string | Build unique ID. |
No content
POST /functions/{functionId}/deployments/{deploymentId}/builds/{buildId}
/functions/{functionId}/executions
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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| functionId | path | required | string | Function ID. |
application/json
FunctionsTriggerExecutionRequest
| Property | Type | Required |
|---|---|---|
| body | string | optional |
| path | string | optional |
| async | boolean | optional |
| method | string | optional |
| headers | object | optional |
Execution
POST /functions/{functionId}/executions
/functions/{functionId}/variables
Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| functionId | path | required | string | Function unique ID. |
application/json
FunctionsCreateVariableRequest
| Property | Type | Required |
|---|---|---|
| key | string | required |
| value | string | required |
Variable
POST /functions/{functionId}/variables
/graphql
Execute a GraphQL mutation.
Any
POST /graphql
/graphql/mutation
Execute a GraphQL mutation.
Any
POST /graphql/mutation
/messaging/messages/email
Create a new email message.
application/json
MessagingCreateEmailMessageRequest
| Property | Type | Required |
|---|---|---|
| cc | array | optional |
| bcc | array | optional |
| html | boolean | optional |
| draft | boolean | optional |
| users | array | optional |
| topics | array | optional |
| content | string | required |
| subject | string | required |
| targets | array | optional |
| messageId | string | required |
| attachments | array | optional |
| scheduledAt | string | optional |
Message
POST /messaging/messages/email
/messaging/messages/push
Create a new push notification.
application/json
MessagingCreatePushNotificationRequest
| Property | Type | Required |
|---|---|---|
| tag | string | optional |
| body | string | required |
| data | object | optional |
| icon | string | optional |
| badge | string | optional |
| color | string | optional |
| draft | boolean | optional |
| image | string | optional |
| sound | string | optional |
| title | string | required |
| users | array | optional |
| action | string | optional |
| topics | array | optional |
| targets | array | optional |
| messageId | string | required |
| scheduledAt | string | optional |
Message
POST /messaging/messages/push
/messaging/messages/sms
Create a new SMS message.
application/json
MessagingCreateSmsMessageRequest
| Property | Type | Required |
|---|---|---|
| draft | boolean | optional |
| users | array | optional |
| topics | array | optional |
| content | string | required |
| targets | array | optional |
| messageId | string | required |
| scheduledAt | string | optional |
Message
POST /messaging/messages/sms
/messaging/providers/apns
Create a new Apple Push Notification service provider.
application/json
MessagingCreateApnsProviderRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| teamId | string | optional |
| authKey | string | optional |
| enabled | boolean | optional |
| sandbox | boolean | optional |
| bundleId | string | optional |
| authKeyId | string | optional |
| providerId | string | required |
Provider
POST /messaging/providers/apns
/messaging/providers/fcm
Create a new Firebase Cloud Messaging provider.
application/json
MessagingCreateFcmProviderRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| enabled | boolean | optional |
| providerId | string | required |
| serviceAccountJSON | object | optional |
Provider
POST /messaging/providers/fcm
/messaging/providers/mailgun
Create a new Mailgun provider.
application/json
MessagingCreateProviderRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| apiKey | string | optional |
| domain | string | optional |
| enabled | boolean | optional |
| fromName | string | optional |
| fromEmail | string | optional |
| isEuRegion | boolean | optional |
| providerId | string | required |
| replyToName | string | optional |
| replyToEmail | string | optional |
Provider
POST /messaging/providers/mailgun
/messaging/providers/msg91
Create a new MSG91 provider.
application/json
MessagingCreateMsg91ProviderRequest
| Property | Type | Required |
|---|---|---|
| from | string | optional |
| name | string | required |
| authKey | string | optional |
| enabled | boolean | optional |
| senderId | string | optional |
| providerId | string | required |
Provider
POST /messaging/providers/msg91
/messaging/providers/sendgrid
Create a new Sendgrid provider.
application/json
MessagingCreateSendgridProviderRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| apiKey | string | optional |
| enabled | boolean | optional |
| fromName | string | optional |
| fromEmail | string | optional |
| providerId | string | required |
| replyToName | string | optional |
| replyToEmail | string | optional |
Provider
POST /messaging/providers/sendgrid
/messaging/providers/smtp
Create a new SMTP provider.
application/json
MessagingCreateSmtpProviderRequest
| Property | Type | Required |
|---|---|---|
| host | string | required |
| name | string | required |
| port | integer | optional |
| mailer | string | optional |
| autoTLS | boolean | optional |
| enabled | boolean | optional |
| fromName | string | optional |
| password | string | optional |
| username | string | optional |
| fromEmail | string | optional |
| encryption | string | optional |
| providerId | string | required |
| replyToName | string | optional |
| replyToEmail | string | optional |
Provider
POST /messaging/providers/smtp
/messaging/providers/telesign
Create a new Telesign provider.
application/json
MessagingCreateTelesignProviderRequest
| Property | Type | Required |
|---|---|---|
| from | string | optional |
| name | string | required |
| apiKey | string | optional |
| enabled | boolean | optional |
| customerId | string | optional |
| providerId | string | required |
Provider
POST /messaging/providers/telesign
/messaging/providers/textmagic
Create a new Textmagic provider.
application/json
MessagingCreateTextmagicProviderRequest
| Property | Type | Required |
|---|---|---|
| from | string | optional |
| name | string | required |
| apiKey | string | optional |
| enabled | boolean | optional |
| username | string | optional |
| providerId | string | required |
Provider
POST /messaging/providers/textmagic
/messaging/providers/twilio
Create a new Twilio provider.
application/json
MessagingCreateTwilioProviderRequest
| Property | Type | Required |
|---|---|---|
| from | string | optional |
| name | string | required |
| enabled | boolean | optional |
| authToken | string | optional |
| accountSid | string | optional |
| providerId | string | required |
Provider
POST /messaging/providers/twilio
/messaging/providers/vonage
Create a new Vonage provider.
application/json
MessagingCreateVonageProviderRequest
| Property | Type | Required |
|---|---|---|
| from | string | optional |
| name | string | required |
| apiKey | string | optional |
| enabled | boolean | optional |
| apiSecret | string | optional |
| providerId | string | required |
Provider
POST /messaging/providers/vonage
/messaging/topics
Create a new topic.
application/json
MessagingCreateTopicRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| topicId | string | required |
| subscribe | array | optional |
Topic
POST /messaging/topics
/messaging/topics/{topicId}/subscribers
Create a new subscriber.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| topicId | path | required | string | Topic ID. The topic ID to subscribe to. |
application/json
MessagingCreateSubscriberRequest
| Property | Type | Required |
|---|---|---|
| targetId | string | required |
| subscriberId | string | required |
Subscriber
POST /messaging/topics/{topicId}/subscribers
/storage/buckets
Create a new storage bucket.
application/json
StorageCreateNewBucketRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| enabled | boolean | optional |
| bucketId | string | required |
| antivirus | boolean | optional |
| encryption | boolean | optional |
| compression | string | optional |
| permissions | array | optional |
| fileSecurity | boolean | optional |
| maximumFileSize | integer | optional |
| allowedFileExtensions | array | optional |
Bucket
POST /storage/buckets
/storage/buckets/{bucketId}/files
Create a new file. Before using this route, you should create a new bucket resource using either a server integration API or directly from your Appwrite console.
Larger files should be uploaded using multiple requests with the 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.
When 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.
If you’re creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| bucketId | path | required | string | Storage bucket unique ID. You can create a new storage bucket using the Storage service server integration. |
multipart/form-data
StorageCreateFileRequest
| Property | Type | Required |
|---|---|---|
| file | string | required |
| fileId | string | required |
| permissions | array | optional |
File
POST /storage/buckets/{bucketId}/files
/teams
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.
application/json
TeamsCreateNewTeamRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| roles | array | optional |
| teamId | string | required |
Team
POST /teams
/teams/{teamId}/memberships
Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn’t exist. If initiated from a Server SDK, the new member will be added automatically to the team.
You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
Use the url parameter to redirect the user from the invitation email to your app. After the user is redirected, use the Update Team Membership Status endpoint to allow the user to accept the invitation to the team.
Please note that to avoid a Redirect Attack Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| teamId | path | required | string | Team ID. |
application/json
TeamsCreateMembershipRequestRequest
| Property | Type | Required |
|---|---|---|
| url | string | optional |
| name | string | optional |
| string | optional | |
| phone | string | optional |
| roles | array | required |
| userId | string | optional |
Membership
POST /teams/{teamId}/memberships
/users
Create a new user.
application/json
UsersCreateNewUserRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| string | optional | |
| phone | string | optional |
| userId | string | required |
| password | string | optional |
User
POST /users
/users/argon2
Create a new user. Password provided must be hashed with the Argon2 algorithm. Use the POST /users endpoint to create users with a plain text password.
application/json
UsersCreateArgon2UserRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| string | required | |
| userId | string | required |
| password | string | required |
User
POST /users/argon2
/users/bcrypt
Create a new user. Password provided must be hashed with the Bcrypt algorithm. Use the POST /users endpoint to create users with a plain text password.
application/json
UsersCreateBcryptUserRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| string | required | |
| userId | string | required |
| password | string | required |
User
POST /users/bcrypt
/users/md5
Create a new user. Password provided must be hashed with the MD5 algorithm. Use the POST /users endpoint to create users with a plain text password.
application/json
UsersCreateMd5UserRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| string | required | |
| userId | string | required |
| password | string | required |
User
POST /users/md5
/users/phpass
Create a new user. Password provided must be hashed with the PHPass algorithm. Use the POST /users endpoint to create users with a plain text password.
application/json
UsersCreatePhpassUserRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| string | required | |
| userId | string | required |
| password | string | required |
User
POST /users/phpass
/users/scrypt
Create a new user. Password provided must be hashed with the Scrypt algorithm. Use the POST /users endpoint to create users with a plain text password.
application/json
UsersCreateScryptUserRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| string | required | |
| userId | string | required |
| password | string | required |
| passwordCpu | integer | required |
| passwordSalt | string | required |
| passwordLength | integer | required |
| passwordMemory | integer | required |
| passwordParallel | integer | required |
User
POST /users/scrypt
/users/scrypt-modified
Create a new user. Password provided must be hashed with the Scrypt Modified algorithm. Use the POST /users endpoint to create users with a plain text password.
application/json
UsersCreateScryptModifiedUserRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| string | required | |
| userId | string | required |
| password | string | required |
| passwordSalt | string | required |
| passwordSignerKey | string | required |
| passwordSaltSeparator | string | required |
User
POST /users/scrypt-modified
/users/sha
Create a new user. Password provided must be hashed with the SHA algorithm. Use the POST /users endpoint to create users with a plain text password.
application/json
UsersCreateShaUserRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| string | required | |
| userId | string | required |
| password | string | required |
| passwordVersion | string | optional |
User
POST /users/sha
/users/{userId}/sessions
Creates a session for a user. Returns an immediately usable session object.
If you want to generate a token for a custom authentication flow, use the POST /users/{userId}/tokens endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| userId | path | required | string | User ID. Choose a custom ID or generate a random ID with |
Session
POST /users/{userId}/sessions
/users/{userId}/targets
Create a messaging target.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| userId | path | required | string | User ID. |
application/json
UsersCreateTargetMessagingRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| targetId | string | required |
| identifier | string | required |
| providerId | string | optional |
| providerType | string | required |
Target
POST /users/{userId}/targets
/users/{userId}/tokens
Returns a token 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/custom endpoint to complete the login process.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| userId | path | required | string | User ID. |
application/json
UsersCreateTokenSessionRequest
| Property | Type | Required |
|---|---|---|
| expire | integer | optional |
| length | integer | optional |
Token
POST /users/{userId}/tokens
AccountBeginMfaVerificationRequest
{
"type": "object",
"required": [
"factor"
],
"properties": {
"factor": {
"enum": [
"email",
"phone",
"totp",
"recoverycode"
],
"type": "string",
"x-example": "email",
"description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.",
"x-enum-keys": [],
"x-enum-name": "AuthenticationFactor"
}
}
}
AccountCompleteEmailVerificationRequest
{
"type": "object",
"required": [
"userId",
"secret"
],
"properties": {
"secret": {
"type": "string",
"x-example": "<SECRET>",
"description": "Valid verification token."
},
"userId": {
"type": "string",
"x-example": "<USER_ID>",
"description": "User ID."
}
}
}
AccountCompleteMfaChallengeRequest
{
"type": "object",
"required": [
"challengeId",
"otp"
],
"properties": {
"otp": {
"type": "string",
"x-example": "<OTP>",
"description": "Valid verification token."
},
"challengeId": {
"type": "string",
"x-example": "<CHALLENGE_ID>",
"description": "ID of the challenge."
}
}
}
AccountCompletePasswordRecoveryRequest
{
"type": "object",
"required": [
"userId",
"secret",
"password"
],
"properties": {
"secret": {
"type": "string",
"x-example": "<SECRET>",
"description": "Valid reset token."
},
"userId": {
"type": "string",
"x-example": "<USER_ID>",
"description": "User ID."
},
"password": {
"type": "string",
"x-example": null,
"description": "New user password. Must be between 8 and 256 chars."
}
}
}
AccountConfirmPhoneVerificationRequest
{
"type": "object",
"required": [
"userId",
"secret"
],
"properties": {
"secret": {
"type": "string",
"x-example": "<SECRET>",
"description": "Valid verification token."
},
"userId": {
"type": "string",
"x-example": "<USER_ID>",
"description": "User ID."
}
}
}
AccountCreateEmailPasswordSessionRequest
{
"type": "object",
"required": [
"email",
"password"
],
"properties": {
"email": {
"type": "string",
"x-example": "email@example.com",
"description": "User email."
},
"password": {
"type": "string",
"x-example": "password",
"description": "User password. Must be at least 8 chars."
}
}
}
AccountCreateEmailTokenRequest
{
"type": "object",
"required": [
"userId",
"email"
],
"properties": {
"email": {
"type": "string",
"x-example": "email@example.com",
"description": "User email."
},
"phrase": {
"type": "boolean",
"x-example": false,
"description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow."
},
"userId": {
"type": "string",
"x-example": "<USER_ID>",
"description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars."
}
}
}
AccountCreateEmailVerificationRequest
{
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string",
"x-example": "https://example.com",
"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."
}
}
}
AccountCreateMagicUrlTokenRequest
{
"type": "object",
"required": [
"userId",
"email"
],
"properties": {
"url": {
"type": "string",
"x-example": "https://example.com",
"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."
},
"email": {
"type": "string",
"x-example": "email@example.com",
"description": "User email."
},
"phrase": {
"type": "boolean",
"x-example": false,
"description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow."
},
"userId": {
"type": "string",
"x-example": "<USER_ID>",
"description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars."
}
}
}
AccountCreateNewUserRequest
{
"type": "object",
"required": [
"userId",
"email",
"password"
],
"properties": {
"name": {
"type": "string",
"x-example": "<NAME>",
"description": "User name. Max length: 128 chars."
},
"email": {
"type": "string",
"x-example": "email@example.com",
"description": "User email."
},
"userId": {
"type": "string",
"x-example": "<USER_ID>",
"description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars."
},
"password": {
"type": "string",
"x-example": null,
"description": "New user password. Must be between 8 and 256 chars."
}
}
}
AccountCreatePasswordRecoveryRequest
{
"type": "object",
"required": [
"email",
"url"
],
"properties": {
"url": {
"type": "string",
"x-example": "https://example.com",
"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."
},
"email": {
"type": "string",
"x-example": "email@example.com",
"description": "User email."
}
}
}
AccountCreatePhoneTokenRequest
{
"type": "object",
"required": [
"userId",
"phone"
],
"properties": {
"phone": {
"type": "string",
"x-example": "+12065550100",
"description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212."
},
"userId": {
"type": "string",
"x-example": "<USER_ID>",
"description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars."
}
}
}
AccountCreateTokenSessionRequest
{
"type": "object",
"required": [
"userId",
"secret"
],
"properties": {
"secret": {
"type": "string",
"x-example": "<SECRET>",
"description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods."
},
"userId": {
"type": "string",
"x-example": "<USER_ID>",
"description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars."
}
}
}
AccountDeleteAuthenticatorByIdRequest
{
"type": "object",
"required": [
"otp"
],
"properties": {
"otp": {
"type": "string",
"x-example": "<OTP>",
"description": "Valid verification token."
}
}
}
AccountUpdateEmailAddressRequest
{
"type": "object",
"required": [
"email",
"password"
],
"properties": {
"email": {
"type": "string",
"x-example": "email@example.com",
"description": "User email."
},
"password": {
"type": "string",
"x-example": "password",
"description": "User password. Must be at least 8 chars."
}
}
}
AccountUpdateMagicUrlSessionRequest
{
"type": "object",
"required": [
"userId",
"secret"
],
"properties": {
"secret": {
"type": "string",
"x-example": "<SECRET>",
"description": "Valid verification token."
},
"userId": {
"type": "string",
"x-example": "<USER_ID>",
"description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars."
}
}
}
AccountUpdateMfaStatusRequest
{
"type": "object",
"required": [
"mfa"
],
"properties": {
"mfa": {
"type": "boolean",
"x-example": false,
"description": "Enable or disable MFA."
}
}
}
AccountUpdateNameOperationRequest
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"x-example": "<NAME>",
"description": "User name. Max length: 128 chars."
}
}
}
AccountUpdatePasswordOperationRequest
{
"type": "object",
"required": [
"password"
],
"properties": {
"password": {
"type": "string",
"x-example": null,
"description": "New user password. Must be at least 8 chars."
},
"oldPassword": {
"type": "string",
"x-example": "password",
"description": "Current user password. Must be at least 8 chars."
}
}
}
AccountUpdatePhoneRequest
{
"type": "object",
"required": [
"phone",
"password"
],
"properties": {
"phone": {
"type": "string",
"x-example": "+12065550100",
"description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212."
},
"password": {
"type": "string",
"x-example": "password",
"description": "User password. Must be at least 8 chars."
}
}
}
AccountUpdatePhoneSessionRequest
{
"type": "object",
"required": [
"userId",
"secret"
],
"properties": {
"secret": {
"type": "string",
"x-example": "<SECRET>",
"description": "Valid verification token."
},
"userId": {
"type": "string",
"x-example": "<USER_ID>",
"description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars."
}
}
}
AccountUpdatePreferencesRequest
{
"type": "object",
"required": [
"prefs"
],
"properties": {
"prefs": {
"type": "object",
"x-example": "{}",
"description": "Prefs key-value JSON object."
}
}
}
AccountVerifyAuthenticatorRequest
{
"type": "object",
"required": [
"otp"
],
"properties": {
"otp": {
"type": "string",
"x-example": "<OTP>",
"description": "Valid verification token."
}
}
}
DatabasesCreateBooleanAttributeRequest
{
"type": "object",
"required": [
"key",
"required"
],
"properties": {
"key": {
"type": "string",
"x-example": null,
"description": "Attribute Key."
},
"array": {
"type": "boolean",
"x-example": false,
"description": "Is attribute an array?"
},
"default": {
"type": "boolean",
"x-example": false,
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesCreateCollectionRequest
{
"type": "object",
"required": [
"collectionId",
"name"
],
"properties": {
"name": {
"type": "string",
"x-example": "<NAME>",
"description": "Collection name. Max length: 128 chars."
},
"enabled": {
"type": "boolean",
"x-example": false,
"description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled."
},
"permissions": {
"type": "array",
"items": {
"type": "string"
},
"x-example": "[\"read(\"any\")\"]",
"description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions)."
},
"collectionId": {
"type": "string",
"x-example": "<COLLECTION_ID>",
"description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars."
},
"documentSecurity": {
"type": "boolean",
"x-example": false,
"description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions)."
}
}
}
DatabasesCreateDatabaseRequest
{
"type": "object",
"required": [
"databaseId",
"name"
],
"properties": {
"name": {
"type": "string",
"x-example": "<NAME>",
"description": "Database name. Max length: 128 chars."
},
"enabled": {
"type": "boolean",
"x-example": false,
"description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled."
},
"databaseId": {
"type": "string",
"x-example": "<DATABASE_ID>",
"description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars."
}
}
}
DatabasesCreateDatetimeAttributeRequest
{
"type": "object",
"required": [
"key",
"required"
],
"properties": {
"key": {
"type": "string",
"x-example": null,
"description": "Attribute Key."
},
"array": {
"type": "boolean",
"x-example": false,
"description": "Is attribute an array?"
},
"default": {
"type": "string",
"x-example": null,
"description": "Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesCreateDocumentRequest
{
"type": "object",
"required": [
"documentId",
"data"
],
"properties": {
"data": {
"type": "object",
"x-example": "{}",
"description": "Document data as JSON object."
},
"documentId": {
"type": "string",
"x-example": "<DOCUMENT_ID>",
"description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars."
},
"permissions": {
"type": "array",
"items": {
"type": "string"
},
"x-example": "[\"read(\"any\")\"]",
"description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions)."
}
}
}
DatabasesCreateEmailAttributeRequest
{
"type": "object",
"required": [
"key",
"required"
],
"properties": {
"key": {
"type": "string",
"x-example": null,
"description": "Attribute Key."
},
"array": {
"type": "boolean",
"x-example": false,
"description": "Is attribute an array?"
},
"default": {
"type": "string",
"x-example": "email@example.com",
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesCreateEnumAttributeRequest
{
"type": "object",
"required": [
"key",
"elements",
"required"
],
"properties": {
"key": {
"type": "string",
"x-example": null,
"description": "Attribute Key."
},
"array": {
"type": "boolean",
"x-example": false,
"description": "Is attribute an array?"
},
"default": {
"type": "string",
"x-example": "<DEFAULT>",
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"elements": {
"type": "array",
"items": {
"type": "string"
},
"x-example": null,
"description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesCreateFloatAttributeRequest
{
"type": "object",
"required": [
"key",
"required"
],
"properties": {
"key": {
"type": "string",
"x-example": null,
"description": "Attribute Key."
},
"max": {
"type": "number",
"x-example": null,
"description": "Maximum value to enforce on new documents"
},
"min": {
"type": "number",
"x-example": null,
"description": "Minimum value to enforce on new documents"
},
"array": {
"type": "boolean",
"x-example": false,
"description": "Is attribute an array?"
},
"default": {
"type": "number",
"x-example": null,
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesCreateIndexRequest
{
"type": "object",
"required": [
"key",
"type",
"attributes"
],
"properties": {
"key": {
"type": "string",
"x-example": null,
"description": "Index Key."
},
"type": {
"enum": [
"key",
"fulltext",
"unique"
],
"type": "string",
"x-example": "key",
"description": "Index type.",
"x-enum-keys": [],
"x-enum-name": "IndexType"
},
"orders": {
"type": "array",
"items": {
"type": "string"
},
"x-example": null,
"description": "Array of index orders. Maximum of 100 orders are allowed."
},
"attributes": {
"type": "array",
"items": {
"type": "string"
},
"x-example": null,
"description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long."
}
}
}
DatabasesCreateIntegerAttributeRequest
{
"type": "object",
"required": [
"key",
"required"
],
"properties": {
"key": {
"type": "string",
"x-example": null,
"description": "Attribute Key."
},
"max": {
"type": "integer",
"x-example": null,
"description": "Maximum value to enforce on new documents"
},
"min": {
"type": "integer",
"x-example": null,
"description": "Minimum value to enforce on new documents"
},
"array": {
"type": "boolean",
"x-example": false,
"description": "Is attribute an array?"
},
"default": {
"type": "integer",
"x-example": null,
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesCreateIpAttributeRequest
{
"type": "object",
"required": [
"key",
"required"
],
"properties": {
"key": {
"type": "string",
"x-example": null,
"description": "Attribute Key."
},
"array": {
"type": "boolean",
"x-example": false,
"description": "Is attribute an array?"
},
"default": {
"type": "string",
"x-example": null,
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesCreateRelationshipAttributeRequest
{
"type": "object",
"required": [
"relatedCollectionId",
"type"
],
"properties": {
"key": {
"type": "string",
"x-example": null,
"description": "Attribute Key."
},
"type": {
"enum": [
"oneToOne",
"manyToOne",
"manyToMany",
"oneToMany"
],
"type": "string",
"x-example": "oneToOne",
"description": "Relation type",
"x-enum-keys": [],
"x-enum-name": "RelationshipType"
},
"twoWay": {
"type": "boolean",
"x-example": false,
"description": "Is Two Way?"
},
"onDelete": {
"enum": [
"cascade",
"restrict",
"setNull"
],
"type": "string",
"x-example": "cascade",
"description": "Constraints option",
"x-enum-keys": [],
"x-enum-name": "RelationMutate"
},
"twoWayKey": {
"type": "string",
"x-example": null,
"description": "Two Way Attribute Key."
},
"relatedCollectionId": {
"type": "string",
"x-example": "<RELATED_COLLECTION_ID>",
"description": "Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)."
}
}
}
DatabasesCreateStringAttributeRequest
{
"type": "object",
"required": [
"key",
"size",
"required"
],
"properties": {
"key": {
"type": "string",
"x-example": null,
"description": "Attribute Key."
},
"size": {
"type": "integer",
"x-example": 1,
"description": "Attribute size for text attributes, in number of characters."
},
"array": {
"type": "boolean",
"x-example": false,
"description": "Is attribute an array?"
},
"default": {
"type": "string",
"x-example": "<DEFAULT>",
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"encrypt": {
"type": "boolean",
"x-example": false,
"description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesCreateUrlAttributeRequest
{
"type": "object",
"required": [
"key",
"required"
],
"properties": {
"key": {
"type": "string",
"x-example": null,
"description": "Attribute Key."
},
"array": {
"type": "boolean",
"x-example": false,
"description": "Is attribute an array?"
},
"default": {
"type": "string",
"x-example": "https://example.com",
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesGetAttributeByIdResponse
{
"oneOf": [
{
"$ref": "#/components/schemas/attributeBoolean"
},
{
"$ref": "#/components/schemas/attributeInteger"
},
{
"$ref": "#/components/schemas/attributeFloat"
},
{
"$ref": "#/components/schemas/attributeEmail"
},
{
"$ref": "#/components/schemas/attributeEnum"
},
{
"$ref": "#/components/schemas/attributeUrl"
},
{
"$ref": "#/components/schemas/attributeIp"
},
{
"$ref": "#/components/schemas/attributeDatetime"
},
{
"$ref": "#/components/schemas/attributeRelationship"
},
{
"$ref": "#/components/schemas/attributeString"
}
]
}
DatabasesUpdateBooleanAttributeRequest
{
"type": "object",
"required": [
"required",
"default"
],
"properties": {
"default": {
"type": "boolean",
"x-example": false,
"x-nullable": true,
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesUpdateByIdRequest
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"x-example": "<NAME>",
"description": "Database name. Max length: 128 chars."
},
"enabled": {
"type": "boolean",
"x-example": false,
"description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled."
}
}
}
DatabasesUpdateCollectionByIdRequest
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"x-example": "<NAME>",
"description": "Collection name. Max length: 128 chars."
},
"enabled": {
"type": "boolean",
"x-example": false,
"description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled."
},
"permissions": {
"type": "array",
"items": {
"type": "string"
},
"x-example": "[\"read(\"any\")\"]",
"description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions)."
},
"documentSecurity": {
"type": "boolean",
"x-example": false,
"description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions)."
}
}
}
DatabasesUpdateDatetimeAttributeRequest
{
"type": "object",
"required": [
"required",
"default"
],
"properties": {
"default": {
"type": "string",
"x-example": null,
"x-nullable": true,
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesUpdateDocumentByIdRequest
{
"type": "object",
"properties": {
"data": {
"type": "object",
"x-example": "{}",
"description": "Document data as JSON object. Include only attribute and value pairs to be updated."
},
"permissions": {
"type": "array",
"items": {
"type": "string"
},
"x-example": "[\"read(\"any\")\"]",
"description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions)."
}
}
}
DatabasesUpdateEmailAttributeRequest
{
"type": "object",
"required": [
"required",
"default"
],
"properties": {
"default": {
"type": "string",
"x-example": "email@example.com",
"x-nullable": true,
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesUpdateEnumAttributeRequest
{
"type": "object",
"required": [
"elements",
"required",
"default"
],
"properties": {
"default": {
"type": "string",
"x-example": "<DEFAULT>",
"x-nullable": true,
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"elements": {
"type": "array",
"items": {
"type": "string"
},
"x-example": null,
"description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesUpdateFloatAttributeRequest
{
"type": "object",
"required": [
"required",
"min",
"max",
"default"
],
"properties": {
"max": {
"type": "number",
"x-example": null,
"description": "Maximum value to enforce on new documents"
},
"min": {
"type": "number",
"x-example": null,
"description": "Minimum value to enforce on new documents"
},
"default": {
"type": "number",
"x-example": null,
"x-nullable": true,
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesUpdateIntegerAttributeRequest
{
"type": "object",
"required": [
"required",
"min",
"max",
"default"
],
"properties": {
"max": {
"type": "integer",
"x-example": null,
"description": "Maximum value to enforce on new documents"
},
"min": {
"type": "integer",
"x-example": null,
"description": "Minimum value to enforce on new documents"
},
"default": {
"type": "integer",
"x-example": null,
"x-nullable": true,
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesUpdateIpAttributeRequest
{
"type": "object",
"required": [
"required",
"default"
],
"properties": {
"default": {
"type": "string",
"x-example": null,
"x-nullable": true,
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}
DatabasesUpdateRelationshipAttributeRequest
{
"type": "object",
"properties": {
"onDelete": {
"enum": [
"cascade",
"restrict",
"setNull"
],
"type": "string",
"x-example": "cascade",
"description": "Constraints option",
"x-enum-keys": [],
"x-enum-name": "RelationMutate"
}
}
}
DatabasesUpdateStringAttributeRequest
{
"type": "object",
"required": [
"required",
"default"
],
"properties": {
"default": {
"type": "string",
"x-example": "<DEFAULT>",
"x-nullable": true,
"description": "Default value for attribute when not provided. Cannot be set when attribute is required."
},
"required": {
"type": "boolean",
"x-example": false,
"description": "Is attribute required?"
}
}
}