GET https://cloud.appwrite.io/v1/databases
** Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. **
Field Name | Type | Description | Default |
---|---|---|---|
queries | 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 | [] |
search | string | Search term to filter your list results. Max length: 256 chars. |
POST https://cloud.appwrite.io/v1/databases
** Create a new Database. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | 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. |
|
name | string | Database name. Max length: 128 chars. | |
enabled | boolean | 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. | 1 |
GET https://cloud.appwrite.io/v1/databases/{databaseId}
** Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. |
PUT https://cloud.appwrite.io/v1/databases/{databaseId}
** Update a database by its unique ID. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
name | string | Database name. Max length: 128 chars. | |
enabled | boolean | 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. | 1 |
DELETE https://cloud.appwrite.io/v1/databases/{databaseId}
** Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. |
GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections
** Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
queries | 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, enabled, documentSecurity | [] |
search | string | Search term to filter your list results. Max length: 256 chars. |
POST https://cloud.appwrite.io/v1/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. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | 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. |
|
name | string | Collection name. Max length: 128 chars. | |
permissions | array | An array of permissions strings. By default, no user is granted with any permissions. Learn more about permissions. | |
documentSecurity | boolean | Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. Learn more about permissions. | |
enabled | boolean | 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. | 1 |
GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}
** Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. |
PUT https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}
** Update a collection by its unique ID. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. | |
name | string | Collection name. Max length: 128 chars. | |
permissions | array | An array of permission strings. By default, the current permissions are inherited. Learn more about permissions. | |
documentSecurity | boolean | Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. Learn more about permissions. | |
enabled | boolean | 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. | 1 |
DELETE https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}
** Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. |
GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes
** List attributes in the collection. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
queries | 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: key, type, size, required, array, status, error | [] |
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/boolean
** Create a boolean attribute. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Attribute Key. | |
required | boolean | Is attribute required? | |
default | boolean | Default value for attribute when not provided. Cannot be set when attribute is required. | |
array | boolean | Is attribute an array? |
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}
** Update a boolean attribute. Changing the default
value will not update already existing documents. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Attribute Key. | |
required | boolean | Is attribute required? | |
default | boolean | Default value for attribute when not provided. Cannot be set when attribute is required. |
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/datetime
** Create a date time attribute according to the ISO 8601 standard. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Attribute Key. | |
required | boolean | Is attribute required? | |
default | string | Default value for the attribute in ISO 8601 format. Cannot be set when attribute is required. | |
array | boolean | Is attribute an array? |
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}
** Update a date time attribute. Changing the default
value will not update already existing documents. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Attribute Key. | |
required | boolean | Is attribute required? | |
default | string | Default value for attribute when not provided. Cannot be set when attribute is required. |
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/email
** Create an email attribute. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Attribute Key. | |
required | boolean | Is attribute required? | |
default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
array | boolean | Is attribute an array? |
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}
** Update an email attribute. Changing the default
value will not update already existing documents.
**
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Attribute Key. | |
required | boolean | Is attribute required? | |
default | string | Default value for attribute when not provided. Cannot be set when attribute is required. |
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/enum
** Create an enumeration attribute. The elements
param acts as a white-list of accepted values for this attribute.
**
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Attribute Key. | |
elements | array | 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 | boolean | Is attribute required? | |
default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
array | boolean | Is attribute an array? |
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}
** Update an enum attribute. Changing the default
value will not update already existing documents.
**
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Attribute Key. | |
elements | array | 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 | boolean | Is attribute required? | |
default | string | Default value for attribute when not provided. Cannot be set when attribute is required. |
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/float
** Create a float attribute. Optionally, minimum and maximum values can be provided. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Attribute Key. | |
required | boolean | Is attribute required? | |
min | number | Minimum value to enforce on new documents | |
max | number | Maximum value to enforce on new documents | |
default | number | Default value for attribute when not provided. Cannot be set when attribute is required. | |
array | boolean | Is attribute an array? |
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}
** Update a float attribute. Changing the default
value will not update already existing documents.
**
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Attribute Key. | |
required | boolean | Is attribute required? | |
min | number | Minimum value to enforce on new documents | |
max | number | Maximum value to enforce on new documents | |
default | number | Default value for attribute when not provided. Cannot be set when attribute is required. |
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/integer
** Create an integer attribute. Optionally, minimum and maximum values can be provided. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Attribute Key. | |
required | boolean | Is attribute required? | |
min | integer | Minimum value to enforce on new documents | |
max | integer | Maximum value to enforce on new documents | |
default | integer | Default value for attribute when not provided. Cannot be set when attribute is required. | |
array | boolean | Is attribute an array? |
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}
** Update an integer attribute. Changing the default
value will not update already existing documents.
**
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Attribute Key. | |
required | boolean | Is attribute required? | |
min | integer | Minimum value to enforce on new documents | |
max | integer | Maximum value to enforce on new documents | |
default | integer | Default value for attribute when not provided. Cannot be set when attribute is required. |
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/ip
** Create IP address attribute. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Attribute Key. | |
required | boolean | Is attribute required? | |
default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
array | boolean | Is attribute an array? |
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}
** Update an ip attribute. Changing the default
value will not update already existing documents.
**
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Attribute Key. | |
required | boolean | Is attribute required? | |
default | string | Default value for attribute when not provided. Cannot be set when attribute is required. |
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/relationship
** Create relationship attribute. Learn more about relationship attributes. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
relatedCollectionId | string | Related Collection ID. You can create a new collection using the Database service server integration. | |
type | string | Relation type | |
twoWay | boolean | Is Two Way? | |
key | string | Attribute Key. | |
twoWayKey | string | Two Way Attribute Key. | |
onDelete | string | Constraints option | restrict |
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/string
** Create a string attribute. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Attribute Key. | |
size | integer | Attribute size for text attributes, in number of characters. | |
required | boolean | Is attribute required? | |
default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
array | boolean | Is attribute an array? | |
encrypt | boolean | Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. |
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}
** Update a string attribute. Changing the default
value will not update already existing documents.
**
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Attribute Key. | |
required | boolean | Is attribute required? | |
default | string | Default value for attribute when not provided. Cannot be set when attribute is required. |
POST https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/url
** Create a URL attribute. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Attribute Key. | |
required | boolean | Is attribute required? | |
default | string | Default value for attribute when not provided. Cannot be set when attribute is required. | |
array | boolean | Is attribute an array? |
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}
** Update an url attribute. Changing the default
value will not update already existing documents.
**
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Attribute Key. | |
required | boolean | Is attribute required? | |
default | string | Default value for attribute when not provided. Cannot be set when attribute is required. |
GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/{key}
** Get attribute by ID. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Attribute Key. |
DELETE https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/{key}
** Deletes an attribute. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Attribute Key. |
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship
** Update relationship attribute. Learn more about relationship attributes. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Attribute Key. | |
onDelete | string | Constraints option |
GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents
** Get a list of all the user's documents in a given collection. You can use the query params to filter your results. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
queries | 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. | [] |
POST https://cloud.appwrite.io/v1/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. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. Make sure to define attributes before creating documents. | |
documentId | string | 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. |
|
data | object | Document data as JSON object. | {} |
permissions | array | An array of permissions strings. By default, only the current user is granted all permissions. Learn more about permissions. |
GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}
** Get a document by its unique ID. This endpoint response returns a JSON object with the document data. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
documentId | string | Required Document ID. | |
queries | 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. | [] |
PATCH https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}
** Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. | |
documentId | string | Required Document ID. | |
data | object | Document data as JSON object. Include only attribute and value pairs to be updated. | {} |
permissions | array | An array of permissions strings. By default, the current permissions are inherited. Learn more about permissions. |
DELETE https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/documents/{documentId}
** Delete a document by its unique ID. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
documentId | string | Required Document ID. |
GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/indexes
** List indexes in the collection. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
queries | 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: key, type, status, attributes, error | [] |
POST https://cloud.appwrite.io/v1/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
. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Index Key. | |
type | string | Index type. | |
attributes | array | Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. | |
orders | array | Array of index orders. Maximum of 100 orders are allowed. | [] |
GET https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/indexes/{key}
** Get index by ID. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Index Key. |
DELETE https://cloud.appwrite.io/v1/databases/{databaseId}/collections/{collectionId}/indexes/{key}
** Delete an index. **
Field Name | Type | Description | Default |
---|---|---|---|
databaseId | string | Required Database ID. | |
collectionId | string | Required Collection ID. You can create a new collection using the Database service server integration. | |
key | string | Required Index Key. |