Storage 5 endpoints

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

Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.

operationId: Storage_getFileById

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 ID.

Responses

200

File

GET /storage/buckets/{bucketId}/files/{fileId}
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}
GET /storage/buckets/{bucketId}/files/{fileId}/download

Get a file content by its unique ID. The endpoint response return with a ‘Content-Disposition: attachment’ header that tells the browser to start downloading the file to user downloads directory.

operationId: Storage_getFileDownload

Parameters

Name In Required Type Description
bucketId path required string

Storage bucket ID. You can create a new storage bucket using the Storage service server integration.

fileId path required string

File ID.

Responses

200

File

GET /storage/buckets/{bucketId}/files/{fileId}/download
GET /storage/buckets/{bucketId}/files/{fileId}/preview

Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.

operationId: Storage_getFilePreviewImage

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 ID

width query optional integer

Resize preview image width, Pass an integer between 0 to 4000.

height query optional integer

Resize preview image height, Pass an integer between 0 to 4000.

gravity query optional string

Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right

quality query optional integer

Preview image quality. Pass an integer between 0 to 100. Defaults to 100.

borderWidth query optional integer

Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.

borderColor query optional string

Preview image border color. Use a valid HEX color, no # is needed for prefix.

borderRadius query optional integer

Preview image border radius in pixels. Pass an integer between 0 to 4000.

opacity query optional number

Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.

rotation query optional integer

Preview image rotation in degrees. Pass an integer between -360 and 360.

background query optional string

Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.

output query optional string

Output format type (jpeg, jpg, png, gif and webp).

Responses

200

Image

GET /storage/buckets/{bucketId}/files/{fileId}/preview
GET /storage/buckets/{bucketId}/files/{fileId}/view

Get a file content by its unique ID. This endpoint is similar to the download method but returns with no ‘Content-Disposition: attachment’ header.

operationId: Storage_getFileView

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 ID.

Responses

200

File

GET /storage/buckets/{bucketId}/files/{fileId}/view

Teams 13 endpoints

GET /teams

Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.

operationId: Teams_getUserTeams

Parameters

Name In Required Type Description
queries query optional array

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan

search query optional string

Search term to filter your list results. Max length: 256 chars.

Responses

200

Teams List

GET /teams
POST /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.

operationId: Teams_createNewTeam

Request Body

application/json
schema TeamsCreateNewTeamRequest
Property Type Required
name string required
roles array optional
teamId string required

Responses

201

Team

POST /teams
DELETE /teams/{teamId}

Delete a team using its ID. Only team members with the owner role can delete the team.

operationId: Teams_removeTeamById

Parameters

Name In Required Type Description
teamId path required string

Team ID.

Responses

204

No content

DELETE /teams/{teamId}
GET /teams/{teamId}

Get a team by its ID. All team members have read access for this resource.

operationId: Teams_getById

Parameters

Name In Required Type Description
teamId path required string

Team ID.

Responses

200

Team

GET /teams/{teamId}
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}
GET /teams/{teamId}/memberships

Use this endpoint to list a team’s members using the team’s ID. All team members have read access to this endpoint.

operationId: Teams_listMemberships

Parameters

Name In Required Type Description
teamId path required string

Team ID.

queries query optional array

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm

search query optional string

Search term to filter your list results. Max length: 256 chars.

Responses

200

Memberships List

GET /teams/{teamId}/memberships
POST /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.

operationId: Teams_createMembershipRequest

Parameters

Name In Required Type Description
teamId path required string

Team ID.

Request Body

application/json
schema TeamsCreateMembershipRequestRequest
Property Type Required
url string optional
name string optional
email string optional
phone string optional
roles array required
userId string optional

Responses

201

Membership

POST /teams/{teamId}/memberships
DELETE /teams/{teamId}/memberships/{membershipId}

This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.

operationId: Teams_deleteMembership

Parameters

Name In Required Type Description
teamId path required string

Team ID.

membershipId path required string

Membership ID.

Responses

204

No content

DELETE /teams/{teamId}/memberships/{membershipId}
GET /teams/{teamId}/memberships/{membershipId}

Get a team member by the membership unique id. All team members have read access for this resource.

operationId: Teams_getMembership

Parameters

Name In Required Type Description
teamId path required string

Team ID.

membershipId path required string

Membership ID.

Responses

200

Membership

GET /teams/{teamId}/memberships/{membershipId}
PATCH /teams/{teamId}/memberships/{membershipId}

Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about roles and permissions.

operationId: Teams_updateMembershipRoles

Parameters

Name In Required Type Description
teamId path required string

Team ID.

membershipId path required string

Membership ID.

Request Body

application/json
schema TeamsUpdateMembershipRolesRequest
Property Type Required
roles array required

Responses

200

Membership

PATCH /teams/{teamId}/memberships/{membershipId}
PATCH /teams/{teamId}/memberships/{membershipId}/status

Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.

If the request is successful, a session for the user is automatically created.

operationId: Teams_updateMembershipStatus

Parameters

Name In Required Type Description
teamId path required string

Team ID.

membershipId path required string

Membership ID.

Request Body

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

Responses

200

Membership

PATCH /teams/{teamId}/memberships/{membershipId}/status
GET /teams/{teamId}/prefs

Get the team’s shared preferences by its unique ID. If a preference doesn’t need to be shared by all team members, prefer storing them in user preferences.

operationId: Teams_getPrefsById

Parameters

Name In Required Type Description
teamId path required string

Team ID.

Responses

200

Preferences

GET /teams/{teamId}/prefs
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 32 endpoints

GET /users

Get a list of all the project’s users. You can use the query params to filter your results.

operationId: Users_listAll

Parameters

Name In Required Type Description
queries query optional array

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels

search query optional string

Search term to filter your list results. Max length: 256 chars.

Responses

200

Users List

GET /users
POST /users

Create a new user.

operationId: Users_createNewUser

Request Body

application/json
schema UsersCreateNewUserRequest
Property Type Required
name string optional
email string optional
phone string optional
userId string required
password string optional

Responses

201

User

POST /users
POST /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.

operationId: Users_createArgon2User

Request Body

application/json
schema UsersCreateArgon2UserRequest
Property Type Required
name string optional
email string required
userId string required
password string required

Responses

201

User

POST /users/argon2
POST /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.

operationId: Users_createBcryptUser

Request Body

application/json
schema UsersCreateBcryptUserRequest
Property Type Required
name string optional
email string required
userId string required
password string required

Responses

201

User

POST /users/bcrypt
GET /users/identities

Get identities for all users.

operationId: Users_listIdentities

Parameters

Name In Required Type Description
queries query optional array

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry

search query optional string

Search term to filter your list results. Max length: 256 chars.

Responses

200

Identities List

GET /users/identities
DELETE /users/identities/{identityId}

Delete an identity by its unique ID.

operationId: Users_deleteIdentityById

Parameters

Name In Required Type Description
identityId path required string

Identity ID.

Responses

204

No content

DELETE /users/identities/{identityId}
POST /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.

operationId: Users_createMd5User

Request Body

application/json
schema UsersCreateMd5UserRequest
Property Type Required
name string optional
email string required
userId string required
password string required

Responses

201

User

POST /users/md5
POST /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.

operationId: Users_createPhpassUser

Request Body

application/json
schema UsersCreatePhpassUserRequest
Property Type Required
name string optional
email string required
userId string required
password string required

Responses

201

User

POST /users/phpass
POST /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.

operationId: Users_createScryptUser

Request Body

application/json
schema UsersCreateScryptUserRequest
Property Type Required
name string optional
email string required
userId string required
password string required
passwordCpu integer required
passwordSalt string required
passwordLength integer required
passwordMemory integer required
passwordParallel integer required

Responses

201

User

POST /users/scrypt
POST /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.

operationId: Users_createScryptModifiedUser

Request Body

application/json
schema UsersCreateScryptModifiedUserRequest
Property Type Required
name string optional
email string required
userId string required
password string required
passwordSalt string required
passwordSignerKey string required
passwordSaltSeparator string required

Responses

201

User

POST /users/scrypt-modified
POST /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.

operationId: Users_createShaUser

Request Body

application/json
schema UsersCreateShaUserRequest
Property Type Required
name string optional
email string required
userId string required
password string required
passwordVersion string optional

Responses

201

User

POST /users/sha
DELETE /users/{userId}

Delete a user by its unique ID, thereby releasing it’s ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the updateStatus endpoint instead.

operationId: Users_deleteUserById

Parameters

Name In Required Type Description
userId path required string

User ID.

Responses

204

No content

DELETE /users/{userId}
GET /users/{userId}

Get a user by its unique ID.

operationId: Users_getById

Parameters

Name In Required Type Description
userId path required string

User ID.

Responses

200

User

GET /users/{userId}
PATCH /users/{userId}/email

Update the user email by its unique ID.

operationId: Users_updateEmailById

Parameters

Name In Required Type Description
userId path required string

User ID.

Request Body

application/json
schema UsersUpdateEmailByIdRequest
Property Type Required
email string required

Responses

200

User

PATCH /users/{userId}/email
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
GET /users/{userId}/logs

Get the user activity logs list by its unique ID.

operationId: Users_listUserLogs

Parameters

Name In Required Type Description
userId path required string

User ID.

queries query optional array

Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Only supported methods are limit and offset

Responses

200

Logs List

GET /users/{userId}/logs
GET /users/{userId}/memberships

Get the user membership list by its unique ID.

operationId: Users_listMemberships

Parameters

Name In Required Type Description
userId path required string

User ID.

Responses

200

Memberships List

GET /users/{userId}/memberships
PATCH /users/{userId}/mfa

Enable or disable MFA on a user account.

operationId: Users_updateMfaStatus

Parameters

Name In Required Type Description
userId path required string

User ID.

Request Body

application/json
schema UsersUpdateMfaStatusRequest
Property Type Required
mfa boolean required

Responses

200

User

PATCH /users/{userId}/mfa
DELETE /users/{userId}/mfa/authenticators/{type}

Delete an authenticator app.

operationId: Users_deleteAuthenticator

Parameters

Name In Required Type Description
userId path required string

User ID.

type path required string

Type of authenticator.

Responses

200

User

DELETE /users/{userId}/mfa/authenticators/{type}
GET /users/{userId}/mfa/factors

List the factors available on the account to be used as a MFA challange.

operationId: Users_listFactors

Parameters

Name In Required Type Description
userId path required string

User ID.

Responses

200

MFAFactors

GET /users/{userId}/mfa/factors
GET /users/{userId}/mfa/recovery-codes

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

operationId: Users_getMfaRecoveryCodes

Parameters

Name In Required Type Description
userId path required string

User ID.

Responses

200

MFA Recovery Codes

GET /users/{userId}/mfa/recovery-codes
PATCH /users/{userId}/mfa/recovery-codes

Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in createMfaChallenge method by client SDK.

operationId: Users_createMfaRecoveryCodes

Parameters

Name In Required Type Description
userId path required string

User ID.

Responses

201

MFA Recovery Codes

PATCH /users/{userId}/mfa/recovery-codes
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
PATCH /users/{userId}/name

Update the user name by its unique ID.

operationId: Users_updateUserByName

Parameters

Name In Required Type Description
userId path required string

User ID.

Request Body

application/json
schema UsersUpdateUserByNameRequest
Property Type Required
name string required

Responses

200

User

PATCH /users/{userId}/name
PATCH /users/{userId}/password

Update the user password by its unique ID.

operationId: Users_updatePasswordById

Parameters

Name In Required Type Description
userId path required string

User ID.

Request Body

application/json
schema UsersUpdatePasswordByIdRequest
Property Type Required
password string required

Responses

200

User

PATCH /users/{userId}/password
PATCH /users/{userId}/phone

Update the user phone by its unique ID.

operationId: Users_updatePhoneById

Parameters

Name In Required Type Description
userId path required string

User ID.

Request Body

application/json
schema UsersUpdatePhoneByIdRequest
Property Type Required
number string required

Responses

200

User

PATCH /users/{userId}/phone
GET /users/{userId}/prefs

Get the user preferences by its unique ID.

operationId: Users_getUserPrefs

Parameters

Name In Required Type Description
userId path required string

User ID.

Responses

200

Preferences

GET /users/{userId}/prefs
PATCH /users/{userId}/prefs

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

operationId: Users_updatePreferencesById

Parameters

Name In Required Type Description
userId path required string

User ID.

Request Body

application/json
schema UsersUpdatePreferencesByIdRequest
Property Type Required
prefs object required

Responses

200

Preferences

PATCH /users/{userId}/prefs
DELETE /users/{userId}/sessions

Delete all user’s sessions by using the user’s unique ID.

operationId: Users_deleteUserSessions

Parameters

Name In Required Type Description
userId path required string

User ID.

Responses

204

No content

DELETE /users/{userId}/sessions
GET /users/{userId}/sessions

Get the user sessions list by its unique ID.

operationId: Users_listSessions

Parameters

Name In Required Type Description
userId path required string

User ID.

Responses

200

Sessions List

GET /users/{userId}/sessions
POST /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.

operationId: Users_createSession

Parameters

Name In Required Type Description
userId path required string

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.

Responses

201

Session

POST /users/{userId}/sessions
DELETE /users/{userId}/sessions/{sessionId}

Delete a user sessions by its unique ID.

operationId: Users_deleteSessionById

Parameters

Name In Required Type Description
userId path required string

User ID.

sessionId path required string

Session ID.

Responses

204

No content

DELETE /users/{userId}/sessions/{sessionId}
Load more endpoints