Skip to content
Closed
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
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor/
composer.lock
10 changes: 0 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# Change Log

## 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

## 18.0.1

* Fix `TablesDB` service to use correct file name
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors.
Copyright (c) 2026 Appwrite (https://appwrite.io) and individual contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Appwrite PHP SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?style=flat-square&v=1)
![Version](https://img.shields.io/badge/api%20version-1.8.0-blue.svg?style=flat-square&v=1)
![Version](https://img.shields.io/badge/api%20version-1.8.1-blue.svg?style=flat-square&v=1)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**
**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**

Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the PHP SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the PHP SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)

![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "appwrite/appwrite",
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
"description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
"type": "library",
"license": "BSD-3-Clause",
"support": {
Expand All @@ -16,13 +16,13 @@
}
},
"require": {
"php": ">=7.1.0",
"php": ">=8.0.0",
"ext-curl": "*",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^10",
"mockery/mockery": "^1.6.12"
"mockery/mockery": "1.6.12"
},
"minimum-stability": "dev"
}
78 changes: 77 additions & 1 deletion docs/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,82 @@ POST https://cloud.appwrite.io/v1/account/jwts

** Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. **
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Update the description to reflect configurable JWT duration.

The description states the JWT is valid for "15 minutes" as a fixed value, but the new duration parameter (lines 76-81) allows customization up to 3600 seconds (1 hour). Consider revising to indicate that the duration is configurable with a default of 15 minutes.

📝 Suggested revision
-** Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. **
+** Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for the specified duration (default 15 minutes, maximum 1 hour) from its creation and will be invalid if the user will logout in that time frame. **
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

74-74: Spaces inside emphasis markers

(MD037, no-space-in-emphasis)


74-74: Spaces inside emphasis markers

(MD037, no-space-in-emphasis)

🤖 Prompt for AI Agents
In `@docs/account.md` at line 74, The description incorrectly states a fixed
15-minute JWT lifetime; update the text to state that the JWT lifetime is
configurable via the duration parameter (named "duration") with a default of 15
minutes and a maximum of 3600 seconds (1 hour), so change the sentence
mentioning "15 minutes" to reflect that it's the default and can be extended up
to 3600 seconds using the duration parameter.


### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| 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'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 @@ -559,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'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. | |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix unmatched backtick in description.

The description has an unmatched backtick: "Choose a custom ID`." This should be either "Choose a custom ID." or properly paired backticks if code formatting is intended.

📝 Proposed fix
-| 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. |  |
+| 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. |  |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| 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. | |
| 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. | |
🤖 Prompt for AI Agents
In `@docs/backups.md` at line 41, The table cell for the archiveId field contains
an unmatched backtick in the description ("Choose a custom ID`."); edit the
archiveId description to remove the stray backtick or properly wrap the phrase
in paired backticks if you intended inline code (e.g., change to "Choose a
custom ID." or "`Choose a custom ID`."), ensuring the sentence punctuation
remains correct and the allowed-chars sentence is unchanged.



```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. | |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Incorrect parameter description - copy-paste error.

The description for the archiveId parameter incorrectly states "Policy ID" when it should state "Archive ID". This endpoint deletes an archive, not a policy.

📝 Proposed fix
-| 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. |  |
+| archiveId | string | **Required** Archive 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. |  |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| 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. | |
| archiveId | string | **Required** Archive 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. | |
🤖 Prompt for AI Agents
In `@docs/backups.md` at line 54, The table row for the parameter archiveId
incorrectly describes it as a "Policy ID"; update the description for archiveId
to say "Archive ID" (e.g., "Required Archive ID. Choose a custom ID or generate
a random ID with `ID.unique()`. Valid chars are...") so the docs correctly state
this endpoint deletes an archive; adjust only the human-readable label in the
archiveId row in docs/backups.md.



```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'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. | |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix unmatched backtick in description.

Same issue as line 41: "Choose a custom ID`." has an unmatched backtick.

📝 Proposed fix
-| 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. |  |
+| 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. |  |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| 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. | |
| 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. | |
🤖 Prompt for AI Agents
In `@docs/backups.md` at line 99, The "policyId" table row contains an unmatched
backtick in the description ("Choose a custom ID`."); remove the stray backtick
so the sentence reads "Choose a custom ID." and ensure punctuation spacing
remains correct; update the description for the policyId field (policyId) to
match the same corrected wording used earlier (line 41) so there are no stray
backticks in the docs.



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

** Update an existing policy using it'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. | |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix unmatched backtick in description.

Same issue as lines 41 and 99: "Choose a custom ID`." has an unmatched backtick.

📝 Proposed fix
-| 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. |  |
+| 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. |  |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| 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. | |
| 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. | |
🤖 Prompt for AI Agents
In `@docs/backups.md` at line 112, The "policyId" table row contains an unmatched
backtick in the description ("Choose a custom ID`."); locate the "policyId" cell
in the docs/backups.md table (same pattern as the occurrences referenced at
lines 41 and 99) and remove the stray backtick so the sentence reads "Choose a
custom ID." (or adjust to proper inline code fencing if that was intended),
ensuring no unmatched backticks remain in that cell.

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

Loading