Appwrite Server

Open source backend-as-a-service

appwrite.io/docs/references ↗
Version
1.5.0
OpenAPI
3.0.0
Endpoints
259
Schemas
207
92
Quality
Updated
3 days ago
Backend backend database authentication open-source
Use this API in your AI agent

Query structured spec data via REST or MCP. Get exactly what your agent needs.

Get API Key

Server URLs

https://cloud.appwrite.io/v1

Endpoints

Clear filters

Account 7 endpoints

PUT /account/mfa/authenticators/{type}

Verify an authenticator app after adding it using the add authenticator method.

operationId: Account_verifyAuthenticator

Parameters

Name In Required Type Description
type path required string

Type of authenticator.

Request Body

application/json
schema AccountVerifyAuthenticatorRequest
Property Type Required
otp string required

Responses

200

User

PUT /account/mfa/authenticators/{type}
PUT /account/mfa/challenge

Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use createMfaChallenge method.

operationId: Account_completeMfaChallenge

Request Body

application/json
schema AccountCompleteMfaChallengeRequest
Property Type Required
otp string required
challengeId string required

Responses

204

No content

PUT /account/mfa/challenge
PUT /account/recovery

Use this endpoint to complete the user account password reset. Both the userId and secret arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the POST /account/recovery endpoint.

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.

operationId: Account_completePasswordRecovery

Request Body

application/json
schema AccountCompletePasswordRecoveryRequest
Property Type Required
secret string required
userId string required
password string required

Responses

200

Token

PUT /account/recovery
PUT /account/sessions/magic-url

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.

operationId: Account_updateMagicUrlSession

Request Body

application/json
schema AccountUpdateMagicUrlSessionRequest
Property Type Required
secret string required
userId string required

Responses

201

Session

PUT /account/sessions/magic-url
PUT /account/sessions/phone

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.

operationId: Account_updatePhoneSession

Request Body

application/json
schema AccountUpdatePhoneSessionRequest
Property Type Required
secret string required
userId string required

Responses

201

Session

PUT /account/sessions/phone
PUT /account/verification

Use this endpoint to complete the user email verification process. Use both the userId and secret parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.

operationId: Account_completeEmailVerification

Request Body

application/json
schema AccountCompleteEmailVerificationRequest
Property Type Required
secret string required
userId string required

Responses

200

Token

PUT /account/verification
PUT /account/verification/phone

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.

operationId: Account_confirmPhoneVerification

Request Body

application/json
schema AccountConfirmPhoneVerificationRequest
Property Type Required
secret string required
userId string required

Responses

200

Token

PUT /account/verification/phone

Databases 2 endpoints

PUT /databases/{databaseId}

Update a database by its unique ID.

operationId: Databases_updateById

Parameters

Name In Required Type Description
databaseId path required string

Database ID.

Request Body

application/json
schema DatabasesUpdateByIdRequest
Property Type Required
name string required
enabled boolean optional

Responses

200

Database

PUT /databases/{databaseId}
PUT /databases/{databaseId}/collections/{collectionId}

Update a collection by its unique ID.

operationId: Databases_updateCollectionById

Parameters

Name In Required Type Description
databaseId path required string

Database ID.

collectionId path required string

Collection ID.

Request Body

application/json
schema DatabasesUpdateCollectionByIdRequest
Property Type Required
name string required
enabled boolean optional
permissions array optional
documentSecurity boolean optional

Responses

200

Collection

PUT /databases/{databaseId}/collections/{collectionId}

Functions 2 endpoints

PUT /functions/{functionId}

Update function by its unique ID.

operationId: Functions_updateById

Parameters

Name In Required Type Description
functionId path required string

Function ID.

Request Body

application/json
schema FunctionsUpdateByIdRequest
Property Type Required
name string required
events array optional
enabled boolean optional
execute array optional
logging boolean optional
runtime string optional
timeout integer optional
commands string optional
schedule string optional
entrypoint string optional
installationId string optional
providerBranch string optional
providerSilentMode boolean optional
providerRepositoryId string optional
providerRootDirectory string optional

Responses

200

Function

PUT /functions/{functionId}
PUT /functions/{functionId}/variables/{variableId}

Update variable by its unique ID.

operationId: Functions_updateVariableById

Parameters

Name In Required Type Description
functionId path required string

Function unique ID.

variableId path required string

Variable unique ID.

Request Body

application/json
schema FunctionsUpdateVariableByIdRequest
Property Type Required
key string required
value string optional

Responses

200

Variable

PUT /functions/{functionId}/variables/{variableId}

Storage 2 endpoints

PUT /storage/buckets/{bucketId}

Update a storage bucket by its unique ID.

operationId: Storage_updateBucketById

Parameters

Name In Required Type Description
bucketId path required string

Bucket unique ID.

Request Body

application/json
schema StorageUpdateBucketByIdRequest
Property Type Required
name string required
enabled boolean optional
antivirus boolean optional
encryption boolean optional
compression string optional
permissions array optional
fileSecurity boolean optional
maximumFileSize integer optional
allowedFileExtensions array optional

Responses

200

Bucket

PUT /storage/buckets/{bucketId}
PUT /storage/buckets/{bucketId}/files/{fileId}

Update a file by its unique ID. Only users with write permissions have access to update this resource.

operationId: Storage_updateFileById

Parameters

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.

fileId path required string

File unique ID.

Request Body

application/json
schema StorageUpdateFileByIdRequest
Property Type Required
name string optional
permissions array optional

Responses

200

File

PUT /storage/buckets/{bucketId}/files/{fileId}

Teams 2 endpoints

PUT /teams/{teamId}

Update the team’s name by its unique ID.

operationId: Teams_updateNameById

Parameters

Name In Required Type Description
teamId path required string

Team ID.

Request Body

application/json
schema TeamsUpdateNameByIdRequest
Property Type Required
name string required

Responses

200

Team

PUT /teams/{teamId}
PUT /teams/{teamId}/prefs

Update the team’s preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.

operationId: Teams_updatePrefsById

Parameters

Name In Required Type Description
teamId path required string

Team ID.

Request Body

application/json
schema TeamsUpdatePrefsByIdRequest
Property Type Required
prefs object required

Responses

200

Preferences

PUT /teams/{teamId}/prefs

Users 2 endpoints

PUT /users/{userId}/labels

Update the user labels by its unique ID.

Labels can be used to grant access to resources. While teams are a way for user’s to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the Permissions docs for more info.

operationId: Users_updateLabelsById

Parameters

Name In Required Type Description
userId path required string

User ID.

Request Body

application/json
schema UsersUpdateLabelsByIdRequest
Property Type Required
labels array required

Responses

200

User

PUT /users/{userId}/labels
PUT /users/{userId}/mfa/recovery-codes

Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method.

operationId: Users_regenerateMfaRecoveryCodes

Parameters

Name In Required Type Description
userId path required string

User ID.

Responses

200

MFA Recovery Codes

PUT /users/{userId}/mfa/recovery-codes

Schemas

object 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"
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object AccountDeleteAuthenticatorByIdRequest
{
  "type": "object",
  "required": [
    "otp"
  ],
  "properties": {
    "otp": {
      "type": "string",
      "x-example": "<OTP>",
      "description": "Valid verification token."
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object AccountUpdateMfaStatusRequest
{
  "type": "object",
  "required": [
    "mfa"
  ],
  "properties": {
    "mfa": {
      "type": "boolean",
      "x-example": false,
      "description": "Enable or disable MFA."
    }
  }
}
object AccountUpdateNameOperationRequest
{
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "x-example": "<NAME>",
      "description": "User name. Max length: 128 chars."
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object AccountUpdatePreferencesRequest
{
  "type": "object",
  "required": [
    "prefs"
  ],
  "properties": {
    "prefs": {
      "type": "object",
      "x-example": "{}",
      "description": "Prefs key-value JSON object."
    }
  }
}
object AccountVerifyAuthenticatorRequest
{
  "type": "object",
  "required": [
    "otp"
  ],
  "properties": {
    "otp": {
      "type": "string",
      "x-example": "<OTP>",
      "description": "Valid verification token."
    }
  }
}
object 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?"
    }
  }
}
object 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)."
    }
  }
}
object 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."
    }
  }
}
object 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?"
    }
  }
}
object 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)."
    }
  }
}
object 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?"
    }
  }
}
object 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?"
    }
  }
}
object 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?"
    }
  }
}
object 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."
    }
  }
}
object 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?"
    }
  }
}
object 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?"
    }
  }
}
object 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)."
    }
  }
}
object 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?"
    }
  }
}
object 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?"
    }
  }
}
object 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"
    }
  ]
}
object 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?"
    }
  }
}
object 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."
    }
  }
}
object 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)."
    }
  }
}
object 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?"
    }
  }
}
object 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)."
    }
  }
}
object 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?"
    }
  }
}
object 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?"
    }
  }
}
object 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?"
    }
  }
}
object 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?"
    }
  }
}
object 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?"
    }
  }
}
object DatabasesUpdateRelationshipAttributeRequest
{
  "type": "object",
  "properties": {
    "onDelete": {
      "enum": [
        "cascade",
        "restrict",
        "setNull"
      ],
      "type": "string",
      "x-example": "cascade",
      "description": "Constraints option",
      "x-enum-keys": [],
      "x-enum-name": "RelationMutate"
    }
  }
}
object 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?"
    }
  }
}