Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 6 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
# Change Log

## 20.0.0
## 20.0.1

* Add array-based enum parameters (e.g., `permissions: array<BrowserPermission>`).
* Breaking change: `Output` enum has been removed; use `ImageFormat` instead.
* Add `getQueueAudits` support to `Health` service.
* Add longtext/mediumtext/text/varchar attribute and column helpers to `Databases` and `TablesDB` services.

## 19.1.0

* Added ability to create columns and indexes synchronously while creating a table

## 19.0.0

* Rename `VCSDeploymentType` enum to `VCSReferenceType`
* Change `createTemplateDeployment` method signature: replace `version` parameter with `type` (TemplateReferenceType) and `reference` parameters
* Add `Theme`, `Timezone` and `Output` enums
* Update SDK as per latest server specs, these include -
* Introduces Backups module for managing Database backups
* Introduces Organization module
* Introduce Account level keys, Backup Service & Models

## 18.0.1

Expand Down Expand Up @@ -48,4 +38,4 @@
* Add `dart38` and `flutter332` support to runtime models
* Add `gif` support to `ImageFormat` enum
* Add `upsertDocument` support to `Databases` service
* Add `sequence` support to `Document` model
* Add `sequence` support to `Document` model
72 changes: 71 additions & 1 deletion docs/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,76 @@ POST https://cloud.appwrite.io/v1/account/jwts
| duration | integer | Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. | 900 |


```http request
GET https://cloud.appwrite.io/v1/account/keys
```

** Get a list of all API keys from the current account. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 |


```http request
POST https://cloud.appwrite.io/v1/account/keys
```

** Create a new account API key. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| name | string | Key name. Max length: 128 chars. | |
| scopes | array | Key scopes list. Maximum of 100 scopes are allowed. | |
| expire | string | Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. | |


```http request
GET https://cloud.appwrite.io/v1/account/keys/{keyId}
```

** Get a key by its unique ID. This endpoint returns details about a specific API key in your account including it&#039;s scopes. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| keyId | string | **Required** Key unique ID. | |


```http request
PUT https://cloud.appwrite.io/v1/account/keys/{keyId}
```

** Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| keyId | string | **Required** Key unique ID. | |
| name | string | Key name. Max length: 128 chars. | |
| scopes | array | Key scopes list. Maximum of 100 scopes are allowed. | |
| expire | string | Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. | |


```http request
DELETE https://cloud.appwrite.io/v1/account/keys/{keyId}
```

** Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| keyId | string | **Required** Key unique ID. | |


```http request
GET https://cloud.appwrite.io/v1/account/logs
```
Expand Down Expand Up @@ -565,7 +635,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. | |
| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine. | |
| success | string | URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's 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. | |
| failure | string | URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's 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. | |
| scopes | array | A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. | [] |
Expand Down
172 changes: 172 additions & 0 deletions docs/backups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# Backups Service


```http request
GET https://cloud.appwrite.io/v1/backups/archives
```

** List all archives for a project. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] |


```http request
POST https://cloud.appwrite.io/v1/backups/archives
```

** Create a new archive asynchronously for a project. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| services | array | Array of services to backup | |
| resourceId | string | Resource ID. When set, only this single resource will be backed up. | |


```http request
GET https://cloud.appwrite.io/v1/backups/archives/{archiveId}
```

** Get a backup archive using it&#039;s ID. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| archiveId | string | **Required** Archive ID. Choose a custom ID`. 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. | |


```http request
DELETE https://cloud.appwrite.io/v1/backups/archives/{archiveId}
```

** Delete an existing archive for a project. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| archiveId | string | **Required** Policy 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. | |


```http request
GET https://cloud.appwrite.io/v1/backups/policies
```

** List all policies for a project. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] |


```http request
POST https://cloud.appwrite.io/v1/backups/policies
```

** Create a new backup policy. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| policyId | string | Policy 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 | Policy name. Max length: 128 chars. | |
| services | array | Array of services to backup | |
| resourceId | string | Resource ID. When set, only this single resource will be backed up. | |
| enabled | boolean | Is policy enabled? When set to 'disabled', no backups will be taken | 1 |
| retention | integer | Days to keep backups before deletion | |
| schedule | string | Schedule CRON syntax. | |


```http request
GET https://cloud.appwrite.io/v1/backups/policies/{policyId}
```

** Get a backup policy using it&#039;s ID. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| policyId | string | **Required** Policy ID. Choose a custom ID`. 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. | |


```http request
PATCH https://cloud.appwrite.io/v1/backups/policies/{policyId}
```

** Update an existing policy using it&#039;s ID. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| policyId | string | **Required** Policy ID. Choose a custom ID`. 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 | Policy name. Max length: 128 chars. | |
| retention | integer | Days to keep backups before deletion | |
| schedule | string | Cron expression | |
| enabled | boolean | Is Backup enabled? When set to 'disabled', No backup will be taken | |


```http request
DELETE https://cloud.appwrite.io/v1/backups/policies/{policyId}
```

** Delete a policy using it&#039;s ID. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| policyId | string | **Required** Policy 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. | |


```http request
POST https://cloud.appwrite.io/v1/backups/restoration
```

** Create and trigger a new restoration for a backup on a project. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| archiveId | string | Backup archive ID to restore | |
| services | array | Array of services to restore | |
| newResourceId | 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. | |
| newResourceName | string | Database name. Max length: 128 chars. | |


```http request
GET https://cloud.appwrite.io/v1/backups/restorations
```

** List all backup restorations for a project. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] |


```http request
GET https://cloud.appwrite.io/v1/backups/restorations/{restorationId}
```

** Get the current status of a backup restoration. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| restorationId | string | **Required** Restoration ID. Choose a custom ID`. 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. | |

2 changes: 2 additions & 0 deletions docs/examples/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -11,3 +12,4 @@ $client = (new Client())
$account = new Account($client);

$result = $account->createAnonymousSession();
```
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -13,4 +14,4 @@ $account = new Account($client);
$result = $account->createEmailPasswordSession(
email: 'email@example.com',
password: 'password'
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-token.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -14,4 +15,4 @@ $result = $account->createEmailToken(
userId: '<USER_ID>',
email: 'email@example.com',
phrase: false // optional
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-verification.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -12,4 +13,4 @@ $account = new Account($client);

$result = $account->createEmailVerification(
url: 'https://example.com'
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-jwt.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -12,4 +13,4 @@ $account = new Account($client);

$result = $account->createJWT(
duration: 0 // optional
);
);```
19 changes: 19 additions & 0 deletions docs/examples/account/create-key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```php
<?php

use Appwrite\Client;
use Appwrite\Services\Account;
use Appwrite\Enums\Scopes;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with

$account = new Account($client);

$result = $account->createKey(
name: '<NAME>',
scopes: [Scopes::ACCOUNT()],
expire: '' // optional
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-magic-url-token.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -15,4 +16,4 @@ $result = $account->createMagicURLToken(
email: 'email@example.com',
url: 'https://example.com', // optional
phrase: false // optional
);
);```
3 changes: 2 additions & 1 deletion docs/examples/account/create-mfa-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```php
<?php

use Appwrite\Client;
Expand All @@ -13,4 +14,4 @@ $account = new Account($client);

$result = $account->createMFAAuthenticator(
type: AuthenticatorType::TOTP()
);
);```
Loading