You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**
9
+
**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).**
10
10
11
11
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)
Copy file name to clipboardExpand all lines: docs/account.md
+101-5Lines changed: 101 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,6 +112,33 @@ POST https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
112
112
| type | string |**Required** Type of authenticator. Must be `totp`||
113
113
114
114
115
+
```http request
116
+
POST https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
117
+
```
118
+
119
+
** Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. **
120
+
121
+
### Parameters
122
+
123
+
| Field Name | Type | Description | Default |
124
+
| --- | --- | --- | --- |
125
+
| type | string |**Required** Type of authenticator. Must be `totp`||
126
+
127
+
128
+
```http request
129
+
PUT https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
130
+
```
131
+
132
+
** Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. **
133
+
134
+
### Parameters
135
+
136
+
| Field Name | Type | Description | Default |
137
+
| --- | --- | --- | --- |
138
+
| type | string |**Required** Type of authenticator. ||
139
+
| otp | string | Valid verification token. ||
140
+
141
+
115
142
```http request
116
143
PUT https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
| type | string |**Required** Type of authenticator. ||
180
+
181
+
182
+
```http request
183
+
POST https://cloud.appwrite.io/v1/account/mfa/challenge
184
+
```
185
+
186
+
** Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. **
187
+
188
+
### Parameters
189
+
190
+
| Field Name | Type | Description | Default |
191
+
| --- | --- | --- | --- |
192
+
| factor | string | Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. ||
193
+
194
+
142
195
```http request
143
196
POST https://cloud.appwrite.io/v1/account/mfa/challenge
144
197
```
@@ -166,6 +219,27 @@ PUT https://cloud.appwrite.io/v1/account/mfa/challenge
166
219
| otp | string | Valid verification token. ||
167
220
168
221
222
+
```http request
223
+
PUT https://cloud.appwrite.io/v1/account/mfa/challenge
224
+
```
225
+
226
+
** 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](/docs/references/cloud/client-web/account#createMfaChallenge) method. **
227
+
228
+
### Parameters
229
+
230
+
| Field Name | Type | Description | Default |
231
+
| --- | --- | --- | --- |
232
+
| challengeId | string | ID of the challenge. ||
233
+
| otp | string | Valid verification token. ||
234
+
235
+
236
+
```http request
237
+
GET https://cloud.appwrite.io/v1/account/mfa/factors
238
+
```
239
+
240
+
** List the factors available on the account to be used as a MFA challange. **
241
+
242
+
169
243
```http request
170
244
GET https://cloud.appwrite.io/v1/account/mfa/factors
171
245
```
@@ -180,6 +254,20 @@ GET https://cloud.appwrite.io/v1/account/mfa/recovery-codes
180
254
** Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. **
181
255
182
256
257
+
```http request
258
+
GET https://cloud.appwrite.io/v1/account/mfa/recovery-codes
259
+
```
260
+
261
+
** Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. **
262
+
263
+
264
+
```http request
265
+
POST https://cloud.appwrite.io/v1/account/mfa/recovery-codes
266
+
```
267
+
268
+
** Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. **
269
+
270
+
183
271
```http request
184
272
POST https://cloud.appwrite.io/v1/account/mfa/recovery-codes
** Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes. **
** Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes. **
POST https://cloud.appwrite.io/v1/account/tokens/email
416
511
```
417
512
418
-
** Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
513
+
** Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
419
514
420
-
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). **
515
+
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
516
+
**
421
517
422
518
### Parameters
423
519
424
520
| Field Name | Type | Description | Default |
425
521
| --- | --- | --- | --- |
426
-
| userId | 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. ||
522
+
| userId | 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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. ||
427
523
| email | string | User email. ||
428
524
| phrase | boolean | 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. ||
429
525
@@ -441,7 +537,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
441
537
442
538
| Field Name | Type | Description | Default |
443
539
| --- | --- | --- | --- |
444
-
| userId | 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. ||
540
+
| userId | 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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. ||
445
541
| email | string | User email. ||
446
542
| url | string | 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. ||
447
543
| phrase | boolean | 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. ||
@@ -479,7 +575,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
479
575
480
576
| Field Name | Type | Description | Default |
481
577
| --- | --- | --- | --- |
482
-
| userId | 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. ||
578
+
| userId | 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. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored. ||
483
579
| phone | string | Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. ||
0 commit comments