Debian Codegraph @

allauth/headless/spec/doc/openapi.yaml

raw
1 openapi: 3.0.3
2 info:
3 version: "1"
4 title: "django-allauth: Headless API"
5 description:
6 $ref: "./description.md"
7 contact:
8 email: [email protected]
9 license:
10 name: MIT
11 url: https://opensource.org/license/mit
12 externalDocs:
13 description: The django-allauth project.
14 url: http://allauth.org
15 tags:
16 - name: Configuration
17 description: |
18 Exposes information on the configuration of django-allauth.
19 - name: "Authentication: Account"
20 description: |
21 All functionality related towards authenticating regular
22 username/email-password based accounts.
23 - name: "Account: Email"
24 description: |
25 The API used for manipulating the email addresses attached to a given
26 account. This is intentionally modeled as one endpoint, representing the
27 collection of all the email addresses. Note that manipulating one email
28 address may affect another. For example, marking one email address as
29 primary implies the previous primary email address is changed as
30 well. Also, if django-allauth is configured with `ACCOUNT_CHANGE_EMAIL =
31 True`, verifying the email address the user is changing to will cause the
32 previous email addres to be removed.
33 - name: "Account: Phone"
34 description: |
35 The API used for manipulating the phone number attached to a given
36 account.
37 - name: "Account: Password"
38 description: |
39 Endpoints that can be used to alter the password for a given account.
40 - name: "Account: Providers"
41 description: |
42 Management of third-party provider accounts that are connected to the
43 authenticated account.
44 - name: "Authentication: 2FA"
45 description: |
46 Endpoints related towards completing the Two-Factor Authentication stage
47 during the authentication cycle.
48 x-tagGroups:
49 - name: Overall
50 tags:
51 - "Configuration"
52 - name: Authentication
53 tags:
54 - "Authentication: Current Session"
55 - "Authentication: Account"
56 - "Authentication: Password Reset"
57 - "Authentication: Providers"
58 - "Authentication: 2FA"
59 - "Authentication: Login By Code"
60 - "Authentication: WebAuthn: Login"
61 - "Authentication: WebAuthn: Signup"
62 - name: Account
63 tags:
64 - "Account: Email"
65 - "Account: Password"
66 - "Account: Phone"
67 - "Account: Providers"
68 - "Account: 2FA"
69 - "Account: WebAuthn"
70 - name: Sessions
71 tags:
72 - "Sessions"
73 - name: Tokens
74 tags:
75 - "Tokens"
76 paths:
77 ######################################################################
78 # Base
79 ######################################################################
80 /_allauth/{client}/v1/config:
81 get:
82 summary: Get configuration
83 tags:
84 - Configuration
85 description: |
86 There are many configuration options that alter the functionality
87 and behavior of django-allauth, some of which can also impact the
88 frontend. Therefore, relevant configuration options are exposed via
89 this endpoint. The data returned is not user/authentication
90 dependent. Hence, it suffices to only fetch this data once at boot
91 time of your application.
92 parameters:
93 - $ref: "#/components/parameters/Client"
94 responses:
95 "200":
96 $ref: "#/components/responses/Configuration"
97 ######################################################################
98 # Authentication: Account
99 ######################################################################
100 /_allauth/{client}/v1/auth/login:
101 post:
102 tags:
103 - "Authentication: Account"
104 summary: Login
105 description: |
106 Login using a username-password or email-password combination.
107 parameters:
108 - $ref: "#/components/parameters/Client"
109 requestBody:
110 $ref: "#/components/requestBodies/Login"
111 responses:
112 "200":
113 $ref: "#/components/responses/AuthenticatedByPassword"
114 "400":
115 description: An input error occurred.
116 content:
117 application/json:
118 schema:
119 $ref: "#/components/schemas/ErrorResponse"
120 examples:
121 invalid_email:
122 $ref: "#/components/examples/InvalidEmail"
123 password_mismatch:
124 $ref: "#/components/examples/PasswordMismatch"
125 "401":
126 description: |
127 Not authenticated.
128 content:
129 application/json:
130 schema:
131 $ref: "#/components/schemas/AuthenticationResponse"
132 examples:
133 pending_email:
134 $ref: "#/components/examples/UnauthenticatedPendingEmailVerification"
135 pending_2fa:
136 $ref: "#/components/examples/UnauthenticatedPending2FA"
137 "409":
138 description: |
139 Conflict. For example, when logging in when a user is already logged in.
140 content:
141 application/json:
142 schema:
143 $ref: "#/components/schemas/ConflictResponse"
144 /_allauth/{client}/v1/auth/signup:
145 post:
146 tags:
147 - "Authentication: Account"
148 summary: Signup
149 description: |
150 Whether or not `username`, `email`, `phone` or combination of those are
151 required depends on the configuration of django-allauth. Additionally,
152 if a custom signup form is used there may be other custom properties
153 required.
154 parameters:
155 - $ref: "#/components/parameters/Client"
156 requestBody:
157 $ref: "#/components/requestBodies/Signup"
158 responses:
159 "200":
160 $ref: "#/components/responses/AuthenticatedByPassword"
161 "400":
162 description: |
163 An input error occurred.
164 content:
165 application/json:
166 schema:
167 $ref: "#/components/schemas/ErrorResponse"
168 examples:
169 invalid_email:
170 $ref: "#/components/examples/InvalidEmail"
171 "401":
172 description: |
173 Not authenticated.
174 content:
175 application/json:
176 schema:
177 $ref: "#/components/schemas/AuthenticationResponse"
178 examples:
179 pending_email:
180 $ref: "#/components/examples/UnauthenticatedPendingEmailVerification"
181 "403":
182 description: |
183 Forbidden. For example, when signup is closed.
184 content:
185 application/json:
186 schema:
187 $ref: "#/components/schemas/ForbiddenResponse"
188 "409":
189 description: |
190 Conflict. For example, when signing up while user is logged in.
191 content:
192 application/json:
193 schema:
194 $ref: "#/components/schemas/ConflictResponse"
195 /_allauth/{client}/v1/auth/email/verify:
196 get:
197 tags:
198 - "Authentication: Account"
199 summary: Get email verification information
200 description: |
201 Obtain email verification information, given the token that was sent to
202 the user by email.
203 parameters:
204 - $ref: "#/components/parameters/EmailVerificationKey"
205 - $ref: "#/components/parameters/Client"
206 responses:
207 "200":
208 $ref: "#/components/responses/EmailVerificationInfo"
209 "400":
210 description: |
211 An input error occurred.
212 content:
213 application/json:
214 schema:
215 $ref: "#/components/schemas/ErrorResponse"
216 examples:
217 invalid_email:
218 $ref: "#/components/examples/InvalidEmailVerificationKey"
219 "409":
220 description: |
221 Conflict. The email verification (by code) flow is not pending.
222 content:
223 application/json:
224 schema:
225 $ref: "#/components/schemas/ConflictResponse"
226 post:
227 tags:
228 - "Authentication: Account"
229 summary: Verify an email
230 description: |
231 Complete the email verification process. Depending on the configuration,
232 email addresses are either verified by opening a link that is sent to
233 their email address, or, by inputting a code that is sent. On the API,
234 both cases are handled identically. Meaning, the required key is either
235 the one from the link, or, the code itself.
236
237 Note that a status code of 401 does not imply failure. It indicates that
238 the email verification was successful, yet, the user is still not signed
239 in. For example, in case `ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION` is set to
240 `False`, a 401 is returned when verifying as part of login/signup.
241 parameters:
242 - $ref: "#/components/parameters/Client"
243 - $ref: "#/components/parameters/SessionToken"
244 requestBody:
245 $ref: "#/components/requestBodies/VerifyEmail"
246 responses:
247 "200":
248 $ref: "#/components/responses/Authenticated"
249 "400":
250 description: |
251 An input error occurred.
252 content:
253 application/json:
254 schema:
255 $ref: "#/components/schemas/ErrorResponse"
256 examples:
257 invalid_email:
258 $ref: "#/components/examples/InvalidEmailVerificationKey"
259 "401":
260 $ref: "#/components/responses/Unauthenticated"
261 "409":
262 description: |
263 Conflict. The email verification (by code) flow is not pending.
264 content:
265 application/json:
266 schema:
267 $ref: "#/components/schemas/ConflictResponse"
268 /_allauth/{client}/v1/auth/email/verify/resend:
269 post:
270 tags:
271 - "Authentication: Account"
272 summary: Resend email verification code
273 description: |
274 Requests a new email verification code.
275 Requires `ACCOUNT_EMAIL_VERIFICATION_SUPPORTS_RESEND = True`.
276 parameters:
277 - $ref: "#/components/parameters/Client"
278 - $ref: "#/components/parameters/SessionToken"
279 responses:
280 "200":
281 $ref: "#/components/responses/StatusOK"
282 "409":
283 description: |
284 Conflict. The email verification (by code) flow is not pending.
285 content:
286 application/json:
287 schema:
288 $ref: "#/components/schemas/ConflictResponse"
289 "429":
290 $ref: "#/components/responses/TooManyRequests"
291 /_allauth/{client}/v1/auth/phone/verify:
292 post:
293 tags:
294 - "Authentication: Account"
295 summary: Verify a phone number
296 description: |
297 Complete the phone number verification process. Note that a status code
298 of 401 does not imply failure. It merely indicates that the phone number
299 verification was successful, yet, the user is still not signed in.
300 parameters:
301 - $ref: "#/components/parameters/Client"
302 - $ref: "#/components/parameters/SessionToken"
303 requestBody:
304 $ref: "#/components/requestBodies/VerifyPhone"
305 responses:
306 "200":
307 $ref: "#/components/responses/Authenticated"
308 "400":
309 description: |
310 An input error occurred.
311 content:
312 application/json:
313 schema:
314 $ref: "#/components/schemas/ErrorResponse"
315 "401":
316 $ref: "#/components/responses/Unauthenticated"
317 "409":
318 description: |
319 Conflict. The phone verification flow is not pending.
320 content:
321 application/json:
322 schema:
323 $ref: "#/components/schemas/ConflictResponse"
324 /_allauth/{client}/v1/auth/phone/verify/resend:
325 post:
326 tags:
327 - "Authentication: Account"
328 summary: Resend phone number verification code
329 description: |
330 Requests a new phone number verification code.
331 Requires `ACCOUNT_PHONE_VERIFICATION_SUPPORTS_RESEND = True`.
332 parameters:
333 - $ref: "#/components/parameters/Client"
334 - $ref: "#/components/parameters/SessionToken"
335 responses:
336 "200":
337 $ref: "#/components/responses/StatusOK"
338 "409":
339 description: |
340 Conflict. The phone verification flow is not pending.
341 content:
342 application/json:
343 schema:
344 $ref: "#/components/schemas/ConflictResponse"
345 "429":
346 $ref: "#/components/responses/TooManyRequests"
347 /_allauth/{client}/v1/auth/reauthenticate:
348 post:
349 tags:
350 - "Authentication: Account"
351 summary: Reauthenticate
352 description: |
353 In order to safeguard the account, some actions require the user to be
354 recently authenticated. If you try to perform such an action without
355 having been recently authenticated, a `401` status is returned, listing
356 flows that can be performed to reauthenticate. One such flow is the flow
357 with ID `reauthenticate`, which allows for the user to input the
358 password. This is the endpoint related towards that flow.
359 parameters:
360 - $ref: "#/components/parameters/Client"
361 - $ref: "#/components/parameters/SessionToken"
362 requestBody:
363 $ref: "#/components/requestBodies/Reauthenticate"
364 responses:
365 "200":
366 $ref: "#/components/responses/AuthenticatedByPassword"
367 "400":
368 description: An input error occurred.
369 content:
370 application/json:
371 schema:
372 $ref: "#/components/schemas/ErrorResponse"
373 examples:
374 invalid_email:
375 $ref: "#/components/examples/IncorrectPassword"
376 ######################################################################
377 # Authentication: Password
378 ######################################################################
379 /_allauth/{client}/v1/auth/password/request:
380 post:
381 summary: Request password
382 description: |
383 Initiates the password reset procedure. Depending on whether or not
384 `ACCOUNT_PASSWORD_RESET_BY_CODE_ENABLED` is `True`, the procedure is
385 either stateless or stateful.
386
387 In case codes are used, it is stateful, and a new
388 `password_reset_by_code` flow is started. In this case, on a successful
389 password reset request, you will receive a 401 indicating the pending
390 status of this flow.
391
392 In case password reset is configured to use (stateless) links, you will
393 receive a 200 on a successful password reset request.
394 tags:
395 - "Authentication: Password Reset"
396 parameters:
397 - $ref: "#/components/parameters/Client"
398 requestBody:
399 $ref: "#/components/requestBodies/RequestPassword"
400 responses:
401 "200":
402 $ref: "#/components/responses/StatusOK"
403 "400":
404 description: |
405 An input error occurred.
406 content:
407 application/json:
408 schema:
409 $ref: "#/components/schemas/ErrorResponse"
410 examples:
411 invalid_email:
412 $ref: "#/components/examples/InvalidEmail"
413 "401":
414 $ref: "#/components/responses/Authentication"
415 /_allauth/{client}/v1/auth/password/reset:
416 get:
417 summary: Get password reset information
418 description: |
419 Used to obtain information on and validate a password reset key. The
420 key passed is either the key encoded in the password reset URL that the
421 user has received per email, or, the password reset code in case of
422 `ACCOUNT_PASSWORD_RESET_BY_CODE_ENABLED`. Note that in case of a code,
423 the number of requests you can make is limited (by
424 `ACCOUNT_PASSWORD_RESET_BY_CODE_MAX_ATTEMPTS`).
425 tags:
426 - "Authentication: Password Reset"
427 parameters:
428 - $ref: "#/components/parameters/Client"
429 - $ref: "#/components/parameters/PasswordResetKey"
430 responses:
431 "200":
432 $ref: "#/components/responses/PasswordResetInfo"
433 "400":
434 description: |
435 An input error occurred.
436 content:
437 application/json:
438 schema:
439 $ref: "#/components/schemas/ErrorResponse"
440 examples:
441 password_reset_key_invalid:
442 $ref: "#/components/examples/InvalidPasswordResetKey"
443 "409":
444 description: |
445 Conflict. There is no password reset (by code) flow pending.
446 content:
447 application/json:
448 schema:
449 $ref: "#/components/schemas/ConflictResponse"
450 post:
451 summary: Reset password
452 description: |
453 Perform the password reset, by handing over the password reset key and
454 the new password. After successfully completing the password reset, the
455 user is either logged in (in case `ACCOUNT_LOGIN_ON_PASSWORD_RESET` is
456 `True`), or, the user will need to proceed to the login page. In case
457 of the former, a `200` status code is returned, in case of the latter a
458 401.
459 tags:
460 - "Authentication: Password Reset"
461 parameters:
462 - $ref: "#/components/parameters/Client"
463 requestBody:
464 $ref: "#/components/requestBodies/ResetPassword"
465 responses:
466 "200":
467 $ref: "#/components/responses/AuthenticatedByPassword"
468 "400":
469 description: An input error occurred.
470 content:
471 application/json:
472 schema:
473 $ref: "#/components/schemas/ErrorResponse"
474 examples:
475 invalid_email:
476 $ref: "#/components/examples/InvalidEmail"
477 "401":
478 $ref: "#/components/responses/Authentication"
479 "409":
480 description: |
481 Conflict. There is no password reset (by code) flow pending.
482 content:
483 application/json:
484 schema:
485 $ref: "#/components/schemas/ConflictResponse"
486 ######################################################################
487 # Authentication: Providers
488 ######################################################################
489 /_allauth/browser/v1/auth/provider/redirect:
490 post:
491 tags:
492 - "Authentication: Providers"
493 summary: Provider redirect
494 description: |
495 Initiates the third-party provider authentication redirect flow. As calling
496 this endpoint results in a user facing redirect (302), this call is only
497 available in a browser, and must be called in a synchronous (non-XHR)
498 manner.
499 requestBody:
500 $ref: "#/components/requestBodies/ProviderRedirect"
501 responses:
502 "302":
503 description: The provider authorization URL to which the client should be redirected.
504 headers:
505 location:
506 schema:
507 type: string
508 description: The redirect URL.
509 /_allauth/{client}/v1/auth/provider/token:
510 post:
511 tags:
512 - "Authentication: Providers"
513 summary: Provider token
514 description: |
515 Authenticates with a third-party provider using provider tokens received
516 by other means. For example, in case of a mobile app, the authentication
517 flow runs completely on the device itself, without any interaction with
518 the API. Then, when the (device) authentication completes and the mobile
519 app receives an access and/or ID token, it can hand over these tokens
520 via this endpoint to authenticate on the server.
521 parameters:
522 - $ref: "#/components/parameters/Client"
523 - $ref: "#/components/parameters/SessionToken"
524 requestBody:
525 $ref: "#/components/requestBodies/ProviderToken"
526 responses:
527 "200":
528 $ref: "#/components/responses/Authenticated"
529 "400":
530 description: An input error occurred.
531 content:
532 application/json:
533 schema:
534 $ref: "#/components/schemas/ErrorResponse"
535 examples:
536 invalid_token:
537 $ref: "#/components/examples/InvalidProviderToken"
538 "401":
539 description: Not authenticated, more steps are required to be completed.
540 content:
541 application/json:
542 schema:
543 $ref: "#/components/schemas/AuthenticationResponse"
544 examples:
545 unauthenticated_pending_2fa:
546 $ref: "#/components/examples/UnauthenticatedPending2FA"
547 unauthenticated_pending_email_verification:
548 $ref: "#/components/examples/UnauthenticatedPendingEmailVerification"
549 "403":
550 description: |
551 Forbidden. For example, when signup is closed.
552 content:
553 application/json:
554 schema:
555 $ref: "#/components/schemas/ForbiddenResponse"
556 /_allauth/{client}/v1/auth/provider/signup:
557 get:
558 tags:
559 - "Authentication: Providers"
560 summary: Provider signup information
561 description: |
562 If, while signing up using a third-party provider account, there is
563 insufficient information received from the provider to automatically
564 complete the signup process, an additional step is needed to complete
565 the missing data before the user is fully signed up and authenticated.
566 The information available so far, such as the pending provider account,
567 can be retrieved via this endpoint.
568 parameters:
569 - $ref: "#/components/parameters/Client"
570 responses:
571 "200":
572 $ref: "#/components/responses/ProviderSignup"
573 "409":
574 description: |
575 Conflict. The provider signup flow is not pending.
576 content:
577 application/json:
578 schema:
579 $ref: "#/components/schemas/ConflictResponse"
580 post:
581 tags:
582 - "Authentication: Providers"
583 summary: Provider signup
584 description: |
585 If, while signing up using a third-party provider account, there is
586 insufficient information received from the provider to automatically
587 complete the signup process, an additional step is needed to complete
588 the missing data before the user is fully signed up and authenticated.
589 parameters:
590 - $ref: "#/components/parameters/Client"
591 requestBody:
592 $ref: "#/components/requestBodies/ProviderSignup"
593 responses:
594 "200":
595 $ref: "#/components/responses/Authenticated"
596 "400":
597 description: An input error occurred.
598 content:
599 application/json:
600 schema:
601 $ref: "#/components/schemas/ErrorResponse"
602 examples:
603 invalid_email:
604 $ref: "#/components/examples/InvalidEmail"
605 "401":
606 description: Not authenticated, more steps are required to be completed.
607 content:
608 application/json:
609 schema:
610 $ref: "#/components/schemas/AuthenticationResponse"
611 examples:
612 unauthenticated_pending_email_verification:
613 $ref: "#/components/examples/UnauthenticatedPendingEmailVerification"
614 "403":
615 description: |
616 Forbidden. For example, when signup is closed.
617 content:
618 application/json:
619 schema:
620 $ref: "#/components/schemas/ForbiddenResponse"
621 "409":
622 description: |
623 Conflict. The provider signup flow is not pending.
624 content:
625 application/json:
626 schema:
627 $ref: "#/components/schemas/ConflictResponse"
628 ######################################################################
629 # Authentication: 2FA
630 ######################################################################
631 /_allauth/{client}/v1/auth/2fa/authenticate:
632 post:
633 tags:
634 - "Authentication: 2FA"
635 summary: Two-factor authentication
636 description: |
637 If, during authentication, a response with status 401 is encountered where one of the pending
638 flows has ID `mfa_authenticate`, that indicates that the Two-Factor Authentication stage needs to
639 be completed.
640 parameters:
641 - $ref: "#/components/parameters/Client"
642 - $ref: "#/components/parameters/SessionToken"
643 requestBody:
644 $ref: "#/components/requestBodies/MFAAuthenticate"
645 responses:
646 "200":
647 $ref: "#/components/responses/AuthenticatedByPasswordAnd2FA"
648 "400":
649 description: An input error occurred.
650 content:
651 application/json:
652 schema:
653 $ref: "#/components/schemas/ErrorResponse"
654 examples:
655 invalid_code:
656 $ref: "#/components/examples/InvalidAuthenticatorCode"
657 "401":
658 $ref: "#/components/responses/Authentication"
659 /_allauth/{client}/v1/auth/2fa/reauthenticate:
660 post:
661 tags:
662 - "Authentication: 2FA"
663 summary: Reauthenticate using 2FA
664 description: |
665 In order to safeguard the account, some actions require the user to be
666 recently authenticated. If you try to perform such an action without
667 having been recently authenticated, a `401` status is returned, listing
668 flows that can be performed to reauthenticate. One such flow is the flow
669 with ID `mfa_reauthenticate`, which allows for the user to input an
670 authenticator code (e.g. TOTP or recovery code). This is the endpoint
671 related towards that flow.
672 parameters:
673 - $ref: "#/components/parameters/Client"
674 - $ref: "#/components/parameters/SessionToken"
675 requestBody:
676 $ref: '#/components/requestBodies/MFAAuthenticate'
677 responses:
678 "200":
679 $ref: "#/components/responses/AuthenticatedByPasswordAnd2FA"
680 "400":
681 description: An input error occurred.
682 content:
683 application/json:
684 schema:
685 $ref: "#/components/schemas/ErrorResponse"
686 examples:
687 invalid_code:
688 $ref: "#/components/examples/InvalidAuthenticatorCode"
689 /_allauth/browser/v1/auth/2fa/trust:
690 post:
691 tags:
692 - "Authentication: 2FA"
693 summary: Trust this browser
694 description: |
695 If "Trust this browser?" is enabled (`MFA_TRUST_ENABLED`), the
696 `mfa_trust` flow activates after the user completes the MFA
697 authentication flow, offering to skip MFA for this particular
698 browser. This endpoint is used to complete the `mfa_trust` flow.
699 parameters:
700 - $ref: "#/components/parameters/SessionToken"
701 requestBody:
702 $ref: "#/components/requestBodies/MFATrust"
703 responses:
704 "200":
705 $ref: "#/components/responses/AuthenticatedByPasswordAnd2FA"
706 "400":
707 description: An input error occurred.
708 content:
709 application/json:
710 schema:
711 $ref: "#/components/schemas/ErrorResponse"
712 ######################################################################
713 # Authentication: WebAuthn
714 ######################################################################
715 /_allauth/{client}/v1/auth/webauthn/authenticate:
716 get:
717 tags:
718 - "Authentication: WebAuthn: Login"
719 summary: Get WebAuthn credential request options for 2FA
720 parameters:
721 - $ref: "#/components/parameters/Client"
722 - $ref: "#/components/parameters/SessionToken"
723 description: |
724 Returns the WebAuthn credential request options, that can be
725 processed using `parseRequestOptionsFromJSON()` on the frontend.
726 responses:
727 "200":
728 $ref: "#/components/responses/WebAuthnRequestOptionsResponse"
729 post:
730 tags:
731 - "Authentication: WebAuthn: Login"
732 summary: Perform 2FA using WebAuthn
733 parameters:
734 - $ref: "#/components/parameters/Client"
735 - $ref: "#/components/parameters/SessionToken"
736 description: |
737 Perform Two-Factor Authentication using a WebAuthn credential.
738 requestBody:
739 $ref: "#/components/requestBodies/AuthenticateWebAuthn"
740 responses:
741 "200":
742 $ref: "#/components/responses/Authenticated"
743 "400":
744 description: An input error occurred.
745 content:
746 application/json:
747 schema:
748 $ref: "#/components/schemas/ErrorResponse"
749 /_allauth/{client}/v1/auth/webauthn/reauthenticate:
750 get:
751 tags:
752 - "Authentication: WebAuthn: Login"
753 summary: Get WebAuthn credential request options for reauthentication
754 parameters:
755 - $ref: "#/components/parameters/Client"
756 - $ref: "#/components/parameters/SessionToken"
757 description: |
758 Returns the WebAuthn credential request options, that can be
759 processed using `parseRequestOptionsFromJSON()` on the frontend.
760 responses:
761 "200":
762 $ref: "#/components/responses/WebAuthnRequestOptionsResponse"
763 post:
764 tags:
765 - "Authentication: WebAuthn: Login"
766 summary: Reauthenticate using WebAuthn
767 parameters:
768 - $ref: "#/components/parameters/Client"
769 - $ref: "#/components/parameters/SessionToken"
770 description: |
771 Reauthenticate the user using a WebAuthn credential.
772 requestBody:
773 $ref: "#/components/requestBodies/ReauthenticateWebAuthn"
774 responses:
775 "200":
776 $ref: "#/components/responses/Authenticated"
777 "400":
778 description: An input error occurred.
779 content:
780 application/json:
781 schema:
782 $ref: "#/components/schemas/ErrorResponse"
783 /_allauth/{client}/v1/auth/webauthn/login:
784 get:
785 tags:
786 - "Authentication: WebAuthn: Login"
787 summary: Get WebAuthn credential request options for login
788 parameters:
789 - $ref: "#/components/parameters/Client"
790 - $ref: "#/components/parameters/SessionToken"
791 description: |
792 Returns the WebAuthn credential request options, that can be
793 processed using `parseRequestOptionsFromJSON()` on the frontend.
794 responses:
795 "200":
796 $ref: "#/components/responses/WebAuthnRequestOptionsResponse"
797 post:
798 tags:
799 - "Authentication: WebAuthn: Login"
800 summary: Login using WebAuthn
801 parameters:
802 - $ref: "#/components/parameters/Client"
803 - $ref: "#/components/parameters/SessionToken"
804 description: |
805 Login using a WebAuthn credential (Passkey). Both 200 and 401 can be
806 expected after a successful request. The 401 can, for example, occur
807 when the credential passed was valid, but the email attached to the
808 account still requires verification.
809 requestBody:
810 $ref: "#/components/requestBodies/LoginWebAuthn"
811 responses:
812 "200":
813 $ref: "#/components/responses/Authenticated"
814 "400":
815 description: An input error occurred.
816 content:
817 application/json:
818 schema:
819 $ref: "#/components/schemas/ErrorResponse"
820 "401":
821 description: |
822 Not authenticated.
823 content:
824 application/json:
825 schema:
826 $ref: "#/components/schemas/AuthenticationResponse"
827 examples:
828 pending_email:
829 $ref: "#/components/examples/UnauthenticatedPendingEmailVerification"
830 /_allauth/{client}/v1/auth/webauthn/signup:
831 post:
832 tags:
833 - "Authentication: WebAuthn: Signup"
834 summary: Initiate the passkey signup flow
835 parameters:
836 - $ref: "#/components/parameters/Client"
837 - $ref: "#/components/parameters/SessionToken"
838 description: |
839 You initiate the passkey signup flow by inputting (`POST`) the required properties (e.g. email)
840 similar to the regular account signup, except that the `password` is to be left out.
841 The user will then be required to verify the email address, after which WebAuthn credential
842 creation options can be retrieved (`GET`) and used to actually complete (`PUT`) the flow.
843 requestBody:
844 $ref: "#/components/requestBodies/PasskeySignup"
845 responses:
846 "400":
847 description: |
848 An input error occurred.
849 content:
850 application/json:
851 schema:
852 $ref: "#/components/schemas/ErrorResponse"
853 examples:
854 invalid_email:
855 $ref: "#/components/examples/InvalidEmail"
856 "401":
857 description: |
858 Not authenticated, email verification pending.
859 content:
860 application/json:
861 schema:
862 $ref: "#/components/schemas/AuthenticationResponse"
863 examples:
864 pending_email:
865 $ref: "#/components/examples/UnauthenticatedPendingEmailVerification"
866 "403":
867 description: |
868 Forbidden. For example, when signup is closed.
869 content:
870 application/json:
871 schema:
872 $ref: "#/components/schemas/ForbiddenResponse"
873 "409":
874 description: |
875 Conflict. For example, when signing up while user is logged in.
876 content:
877 application/json:
878 schema:
879 $ref: "#/components/schemas/ConflictResponse"
880 get:
881 tags:
882 - "Authentication: WebAuthn: Signup"
883 summary: Get passkey credential request options
884 parameters:
885 - $ref: "#/components/parameters/Client"
886 - $ref: "#/components/parameters/SessionToken"
887 description: |
888 Returns the WebAuthn credential request options, that can be
889 processed using `parseRequestOptionsFromJSON()` on the frontend.
890 responses:
891 "200":
892 $ref: "#/components/responses/WebAuthnRequestOptionsResponse"
893 "409":
894 description: |
895 Conflict. For example, when the passkey signup flow is not pending.
896 content:
897 application/json:
898 schema:
899 $ref: "#/components/schemas/ConflictResponse"
900 put:
901 tags:
902 - "Authentication: WebAuthn: Signup"
903 summary: Complete the passkey signup flow
904 parameters:
905 - $ref: "#/components/parameters/Client"
906 - $ref: "#/components/parameters/SessionToken"
907 description: |
908 Complete the passkey signup flow by handing over the WebAuthn credential.
909 requestBody:
910 $ref: "#/components/requestBodies/AddWebAuthnAuthenticator"
911 responses:
912 "200":
913 $ref: "#/components/responses/Authenticated"
914 "400":
915 description: An input error occurred.
916 content:
917 application/json:
918 schema:
919 $ref: "#/components/schemas/ErrorResponse"
920 "401":
921 description: |
922 Not authenticated.
923 content:
924 application/json:
925 schema:
926 $ref: "#/components/schemas/AuthenticationResponse"
927 examples:
928 pending_email:
929 $ref: "#/components/examples/UnauthenticatedPendingEmailVerification"
930 "409":
931 description: |
932 Conflict. For example, when the passkey signup flow is not pending.
933 content:
934 application/json:
935 schema:
936 $ref: "#/components/schemas/ConflictResponse"
937 ######################################################################
938 # Authentication: Login by Code
939 ######################################################################
940 /_allauth/{client}/v1/auth/code/request:
941 post:
942 tags:
943 - "Authentication: Login By Code"
944 summary: Request login code
945 description: |
946 Request a "special" login code that is sent to the user by email.
947 parameters:
948 - $ref: "#/components/parameters/Client"
949 requestBody:
950 $ref: "#/components/requestBodies/RequestLoginCode"
951 responses:
952 "400":
953 description: An input error occurred.
954 content:
955 application/json:
956 schema:
957 $ref: "#/components/schemas/ErrorResponse"
958 examples:
959 invalid_email:
960 $ref: "#/components/examples/InvalidEmail"
961 "401":
962 description: |
963 Not authenticated.
964 content:
965 application/json:
966 schema:
967 $ref: "#/components/schemas/AuthenticationResponse"
968 examples:
969 pending_login_by_code:
970 $ref: "#/components/examples/UnauthenticatedPendingLoginByCode"
971
972 /_allauth/{client}/v1/auth/code/confirm:
973 post:
974 tags:
975 - "Authentication: Login By Code"
976 summary: Confirm login code
977 description: |
978 Use this endpoint to pass along the received "special" login code.
979 parameters:
980 - $ref: "#/components/parameters/Client"
981 requestBody:
982 $ref: "#/components/requestBodies/ConfirmLoginCode"
983 responses:
984 "200":
985 $ref: "#/components/responses/AuthenticatedByCode"
986 "400":
987 description: An input error occurred.
988 content:
989 application/json:
990 schema:
991 $ref: "#/components/schemas/ErrorResponse"
992 examples:
993 invalid_code:
994 $ref: "#/components/examples/InvalidAuthenticatorCode"
995 "401":
996 description: |
997 Not authenticated.
998 content:
999 application/json:
1000 schema:
1001 $ref: "#/components/schemas/AuthenticationResponse"
1002 examples:
1003 unauthenticated_pending_2fa:
1004 $ref: "#/components/examples/UnauthenticatedPending2FA"
1005 "409":
1006 description: |
1007 Conflict. The "login by code" flow is not pending.
1008 content:
1009 application/json:
1010 schema:
1011 $ref: "#/components/schemas/ConflictResponse"
1012
1013 /_allauth/{client}/v1/auth/code/resend:
1014 post:
1015 tags:
1016 - "Authentication: Login By Code"
1017 summary: Resend login code
1018 description: |
1019 Requests a new login code.
1020 Requires `ACCOUNT_LOGIN_BY_CODE_SUPPORTS_RESEND = True`.
1021 parameters:
1022 - $ref: "#/components/parameters/Client"
1023 - $ref: "#/components/parameters/SessionToken"
1024 responses:
1025 "200":
1026 $ref: "#/components/responses/StatusOK"
1027 "409":
1028 description: |
1029 Conflict. The login verification (by code) flow is not pending.
1030 content:
1031 application/json:
1032 schema:
1033 $ref: "#/components/schemas/ConflictResponse"
1034 "429":
1035 $ref: "#/components/responses/TooManyRequests"
1036
1037 ######################################################################
1038 # Account: Providers
1039 ######################################################################
1040 /_allauth/{client}/v1/account/providers:
1041 get:
1042 tags:
1043 - "Account: Providers"
1044 summary: List the connected third-party provider accounts
1045 parameters:
1046 - $ref: "#/components/parameters/Client"
1047 - $ref: "#/components/parameters/SessionToken"
1048 responses:
1049 "200":
1050 $ref: "#/components/responses/ProviderAccounts"
1051 delete:
1052 tags:
1053 - "Account: Providers"
1054 summary: |
1055 Disconnect a third-party provider account
1056 description: |
1057 Disconnect a third-party provider account, returning the remaining
1058 accounts that are still connected. The disconnect is not allowed if it
1059 would leave the account unusable. For example, if no password was
1060 set up yet.
1061 parameters:
1062 - $ref: "#/components/parameters/Client"
1063 - $ref: "#/components/parameters/SessionToken"
1064 requestBody:
1065 $ref: "#/components/requestBodies/ProviderAccount"
1066 responses:
1067 "200":
1068 $ref: "#/components/responses/ProviderAccounts"
1069 "400":
1070 description: An input error occurred.
1071 content:
1072 application/json:
1073 schema:
1074 $ref: "#/components/schemas/ErrorResponse"
1075 examples:
1076 no_password:
1077 $ref: "#/components/examples/DisconnectNotAllowedNoPassword"
1078 no_email:
1079 $ref: "#/components/examples/DisconnectNotAllowedNoVerifiedEmail"
1080 ######################################################################
1081 # Account: Email
1082 ######################################################################
1083 /_allauth/{client}/v1/account/email:
1084 get:
1085 tags:
1086 - "Account: Email"
1087 summary: List email addresses
1088 description: |
1089 Retrieves the list of email addresses of the account.
1090 parameters:
1091 - $ref: "#/components/parameters/Client"
1092 - $ref: "#/components/parameters/SessionToken"
1093 responses:
1094 "200":
1095 $ref: "#/components/responses/EmailAddresses"
1096 "401":
1097 $ref: "#/components/responses/Authentication"
1098 post:
1099 tags:
1100 - "Account: Email"
1101 summary: |
1102 Add/Change email address
1103 description: |
1104 The following functionality is available:
1105
1106 - Adding a new email address for an already signed in user (`ACCOUNT_CHANGE_EMAIL = False`).
1107 - Change to a new email address for an already signed in user (`ACCOUNT_CHANGE_EMAIL = True`).
1108 - Change to a new email address during the email verification process at signup (`ACCOUNT_EMAIL_VERIFICATION_SUPPORTS_CHANGE = True`).
1109
1110 In all cases, an email verification mail will be sent containing a link or code that needs to be verified.
1111 parameters:
1112 - $ref: "#/components/parameters/Client"
1113 - $ref: "#/components/parameters/SessionToken"
1114 requestBody:
1115 $ref: "#/components/requestBodies/Email"
1116 responses:
1117 "200":
1118 $ref: "#/components/responses/EmailAddresses"
1119 "400":
1120 description: An input error occurred.
1121 content:
1122 application/json:
1123 schema:
1124 $ref: "#/components/schemas/ErrorResponse"
1125 examples:
1126 invalid_code:
1127 $ref: "#/components/examples/InvalidEmail"
1128 "401":
1129 $ref: "#/components/responses/AuthenticationOrReauthentication"
1130 "409":
1131 description: |
1132 Conflict. For example, when no user is authenticated and no email verification flow is pending.
1133 content:
1134 application/json:
1135 schema:
1136 $ref: "#/components/schemas/ConflictResponse"
1137 put:
1138 tags:
1139 - "Account: Email"
1140 summary: Request email verification
1141 description: |
1142 Requests for (another) email verification email to be sent. Note that
1143 sending emails is rate limited, so when you send too many requests the
1144 email will not be sent.
1145 parameters:
1146 - $ref: "#/components/parameters/Client"
1147 - $ref: "#/components/parameters/SessionToken"
1148 requestBody:
1149 $ref: "#/components/requestBodies/Email"
1150 responses:
1151 "200":
1152 $ref: "#/components/responses/StatusOK"
1153 "400":
1154 description: An input error occurred.
1155 content:
1156 application/json:
1157 schema:
1158 $ref: "#/components/schemas/ErrorResponse"
1159 examples:
1160 invalid_code:
1161 $ref: "#/components/examples/InvalidEmail"
1162 "403":
1163 description: |
1164 Too many email verification mails were already sent.
1165 content:
1166 application/json:
1167 schema:
1168 $ref: "#/components/schemas/ForbiddenResponse"
1169 patch:
1170 tags:
1171 - "Account: Email"
1172 summary: Change primary email address
1173 description: |
1174 Used to change primary email address to a different one. Note that only verified email addresses
1175 can be marked as primary.
1176 parameters:
1177 - $ref: "#/components/parameters/Client"
1178 - $ref: "#/components/parameters/SessionToken"
1179 requestBody:
1180 $ref: "#/components/requestBodies/MarkPrimaryEmail"
1181 responses:
1182 "200":
1183 $ref: "#/components/responses/EmailAddresses"
1184 "400":
1185 description: An input error occurred.
1186 content:
1187 application/json:
1188 schema:
1189 $ref: "#/components/schemas/ErrorResponse"
1190 examples:
1191 invalid_code:
1192 $ref: "#/components/examples/InvalidEmail"
1193 delete:
1194 tags:
1195 - "Account: Email"
1196 summary: Remove an email address
1197 description: |
1198 Used to remove an email address.
1199 parameters:
1200 - $ref: "#/components/parameters/Client"
1201 - $ref: "#/components/parameters/SessionToken"
1202 requestBody:
1203 $ref: "#/components/requestBodies/Email"
1204 responses:
1205 "200":
1206 $ref: "#/components/responses/EmailAddresses"
1207 "400":
1208 description: An input error occurred.
1209 content:
1210 application/json:
1211 schema:
1212 $ref: "#/components/schemas/ErrorResponse"
1213 examples:
1214 invalid_code:
1215 $ref: "#/components/examples/InvalidEmail"
1216 ######################################################################
1217 # Account: Phone
1218 ######################################################################
1219 /_allauth/{client}/v1/account/phone:
1220 get:
1221 tags:
1222 - "Account: Phone"
1223 summary: Get the phone number
1224 description: |
1225 Retrieves the phone number of the account, if any. Note that while the
1226 endpoint returns a list of phone numbers, at most one entry is returned.
1227 parameters:
1228 - $ref: "#/components/parameters/Client"
1229 - $ref: "#/components/parameters/SessionToken"
1230 responses:
1231 "200":
1232 $ref: "#/components/responses/PhoneNumbers"
1233 "401":
1234 $ref: "#/components/responses/Authentication"
1235 post:
1236 tags:
1237 - "Account: Phone"
1238 summary: |
1239 Change the phone number
1240 description: |
1241 The following functionality is available:
1242
1243 - Initiate the phone number change process for signed in users.
1244 - Change to a new phone number during the phone number verification
1245 process at signup for unauthenticated users. Note that this requires:
1246 `ACCOUNT_PHONE_VERIFICATION_SUPPORTS_CHANGE = True`.
1247
1248 In both cases, after posting a new phone number, proceed with the phone
1249 verification endpoint to confirm the change of the phone number by
1250 posting the verification code.
1251 parameters:
1252 - $ref: "#/components/parameters/Client"
1253 - $ref: "#/components/parameters/SessionToken"
1254 requestBody:
1255 $ref: "#/components/requestBodies/Phone"
1256 responses:
1257 "202":
1258 description: Phone number change process initiated.
1259 content:
1260 application/json:
1261 schema:
1262 $ref: "#/components/schemas/PhoneNumberChangeResponse"
1263 "400":
1264 description: An input error occurred.
1265 content:
1266 application/json:
1267 schema:
1268 $ref: "#/components/schemas/ErrorResponse"
1269 "401":
1270 $ref: "#/components/responses/AuthenticationOrReauthentication"
1271 "409":
1272 description: |
1273 Conflict. For example, when no user is authenticated and no phone verification flow is pending.
1274 content:
1275 application/json:
1276 schema:
1277 $ref: "#/components/schemas/ConflictResponse"
1278 ######################################################################
1279 # Account: 2FA
1280 ######################################################################
1281 /_allauth/{client}/v1/account/authenticators:
1282 get:
1283 tags:
1284 - "Account: 2FA"
1285 summary: List authenticators
1286 parameters:
1287 - $ref: "#/components/parameters/Client"
1288 - $ref: "#/components/parameters/SessionToken"
1289 responses:
1290 "200":
1291 $ref: "#/components/responses/Authenticators"
1292 "401":
1293 $ref: "#/components/responses/Authentication"
1294 "410":
1295 $ref: "#/components/responses/SessionGone"
1296 /_allauth/{client}/v1/account/authenticators/totp:
1297 get:
1298 tags:
1299 - "Account: 2FA"
1300 summary: TOTP authenticator status
1301 description: |
1302 Retrieve the information about the current TOTP authenticator, if any.
1303 parameters:
1304 - $ref: "#/components/parameters/Client"
1305 - $ref: "#/components/parameters/SessionToken"
1306 responses:
1307 "404":
1308 $ref: "#/components/responses/TOTPAuthenticatorNotFound"
1309 "200":
1310 $ref: "#/components/responses/TOTPAuthenticator"
1311 "409":
1312 $ref: "#/components/responses/AddAuthenticatorConflict"
1313 post:
1314 tags:
1315 - "Account: 2FA"
1316 summary: Activate TOTP
1317 description: |
1318 The code should be provided from the consuming TOTP authenticator
1319 application which was generated using the TOTP authenticator secret
1320 retrieved from the TOTP authenticator status endpoint.
1321 parameters:
1322 - $ref: "#/components/parameters/Client"
1323 - $ref: "#/components/parameters/SessionToken"
1324 requestBody:
1325 $ref: "#/components/requestBodies/SetupTOTP"
1326 responses:
1327 "200":
1328 $ref: "#/components/responses/TOTPAuthenticator"
1329 "400":
1330 description: An input error occurred.
1331 content:
1332 application/json:
1333 schema:
1334 $ref: "#/components/schemas/ErrorResponse"
1335 examples:
1336 invalid_code:
1337 $ref: "#/components/examples/InvalidAuthenticatorCode"
1338 "401":
1339 $ref: "#/components/responses/ReauthenticationRequired"
1340 "409":
1341 $ref: "#/components/responses/AddAuthenticatorConflict"
1342 delete:
1343 tags:
1344 - "Account: 2FA"
1345 summary: Deactivate TOTP
1346 description: |
1347 Deactivates TOTP authentication. If the user authentication is not
1348 sufficiently recent, a reauthentication flow (`401`) will is presented.
1349 parameters:
1350 - $ref: "#/components/parameters/Client"
1351 - $ref: "#/components/parameters/SessionToken"
1352 responses:
1353 "200":
1354 $ref: "#/components/responses/StatusOK"
1355 "401":
1356 $ref: "#/components/responses/ReauthenticationRequired"
1357 /_allauth/{client}/v1/account/authenticators/recovery-codes:
1358 get:
1359 tags:
1360 - "Account: 2FA"
1361 summary: List recovery codes
1362 description: |
1363 List recovery codes.
1364 parameters:
1365 - $ref: "#/components/parameters/Client"
1366 - $ref: "#/components/parameters/SessionToken"
1367 responses:
1368 "200":
1369 $ref: "#/components/responses/RecoveryCodes"
1370 "401":
1371 $ref: "#/components/responses/ReauthenticationRequired"
1372 "404":
1373 $ref: "#/components/responses/NotFound"
1374 post:
1375 tags:
1376 - "Account: 2FA"
1377 summary: Regenerate recovery codes
1378 parameters:
1379 - $ref: "#/components/parameters/Client"
1380 - $ref: "#/components/parameters/SessionToken"
1381 responses:
1382 "400":
1383 description: An input error occurred.
1384 content:
1385 application/json:
1386 schema:
1387 $ref: "#/components/schemas/ErrorResponse"
1388 examples:
1389 invalid_code:
1390 $ref: "#/components/examples/CannotGenerateRecoveryCodes"
1391 "401":
1392 $ref: "#/components/responses/ReauthenticationRequired"
1393 ######################################################################
1394 # Account: WebAuthn
1395 ######################################################################
1396 /_allauth/{client}/v1/account/authenticators/webauthn:
1397 get:
1398 tags:
1399 - "Account: WebAuthn"
1400 summary: |
1401 Get WebAuthn credential creation options
1402 parameters:
1403 - $ref: "#/components/parameters/Client"
1404 - $ref: "#/components/parameters/SessionToken"
1405 - $ref: "#/components/parameters/PasswordLess"
1406 description: |
1407 Returns the WebAuthn credential creation options, that can be
1408 processed using `parseCreationOptionsFromJSON()` on the frontend.
1409 responses:
1410 "200":
1411 $ref: "#/components/responses/WebAuthnCreationOptionsResponse"
1412 "401":
1413 $ref: "#/components/responses/ReauthenticationRequired"
1414 "409":
1415 $ref: "#/components/responses/AddAuthenticatorConflict"
1416 put:
1417 tags:
1418 - "Account: WebAuthn"
1419 summary: |
1420 Rename a WebAuthn credential
1421 description: |
1422 You can alter the name of a WebAuthn credential by PUT'ting the ID and
1423 name of the authenticator representing that credential. You can obtain
1424 the credentials via the "List authenticators" endpoint.
1425 parameters:
1426 - $ref: "#/components/parameters/Client"
1427 - $ref: "#/components/parameters/SessionToken"
1428 requestBody:
1429 $ref: "#/components/requestBodies/UpdateWebAuthn"
1430 responses:
1431 "200":
1432 $ref: "#/components/responses/WebAuthnAuthenticator"
1433 "401":
1434 $ref: "#/components/responses/ReauthenticationRequired"
1435 delete:
1436 tags:
1437 - "Account: WebAuthn"
1438 summary: |
1439 Delete a WebAuthn credential
1440 parameters:
1441 - $ref: "#/components/parameters/Client"
1442 - $ref: "#/components/parameters/SessionToken"
1443 requestBody:
1444 $ref: "#/components/requestBodies/DeleteWebAuthn"
1445 responses:
1446 "200":
1447 $ref: "#/components/responses/StatusOK"
1448 "401":
1449 $ref: "#/components/responses/ReauthenticationRequired"
1450 post:
1451 tags:
1452 - "Account: WebAuthn"
1453 summary: |
1454 Add a WebAuthn credential
1455 parameters:
1456 - $ref: "#/components/parameters/Client"
1457 - $ref: "#/components/parameters/SessionToken"
1458 requestBody:
1459 $ref: "#/components/requestBodies/AddWebAuthnAuthenticator"
1460 responses:
1461 "200":
1462 $ref: "#/components/responses/AddWebAuthnAuthenticator"
1463 "401":
1464 $ref: "#/components/responses/ReauthenticationRequired"
1465 "409":
1466 $ref: "#/components/responses/AddAuthenticatorConflict"
1467 ######################################################################
1468 # Sessions
1469 ######################################################################
1470 /_allauth/{client}/v1/auth/session:
1471 get:
1472 tags:
1473 - "Authentication: Current Session"
1474 summary: |
1475 Get authentication status
1476 description: |
1477 Retrieve information about the authentication status for the current
1478 session.
1479 parameters:
1480 - $ref: "#/components/parameters/Client"
1481 - $ref: "#/components/parameters/SessionToken"
1482 responses:
1483 "200":
1484 $ref: "#/components/responses/Authenticated"
1485 "401":
1486 $ref: "#/components/responses/Authentication"
1487 "410":
1488 $ref: "#/components/responses/SessionGone"
1489 delete:
1490 tags:
1491 - "Authentication: Current Session"
1492 summary: Logout
1493 description: |
1494 Logs out the user from the current session.
1495 parameters:
1496 - $ref: "#/components/parameters/Client"
1497 - $ref: "#/components/parameters/SessionToken"
1498 responses:
1499 "401":
1500 $ref: "#/components/responses/Unauthenticated"
1501 ######################################################################
1502 # Tokens
1503 ######################################################################
1504 /_allauth/app/v1/tokens/refresh:
1505 post:
1506 tags:
1507 - "Tokens"
1508 summary: |
1509 Refresh the access token
1510 description: |
1511 Used to retrieve a new access token. Depending on `settings.HEADLESS_JWT_ROTATE_REFRESH_TOKEN`,
1512 a new refresh token is returned as well.
1513 requestBody:
1514 $ref: "#/components/requestBodies/RefreshToken"
1515 responses:
1516 "200":
1517 $ref: "#/components/responses/RefreshToken"
1518 "400":
1519 description: The refresh token is invalid or expired.
1520 content:
1521 application/json:
1522 schema:
1523 $ref: "#/components/schemas/ErrorResponse"
1524 ######################################################################
1525 # Account: Password
1526 ######################################################################
1527 /_allauth/{client}/v1/account/password/change:
1528 post:
1529 tags:
1530 - "Account: Password"
1531 summary: Change password
1532 description: |
1533 In order to change the password of an account, the current and new
1534 password must be provider. However, accounts that were created by
1535 signing up using a third-party provider do not have a password set. In
1536 that case, the current password is not required.
1537 parameters:
1538 - $ref: "#/components/parameters/Client"
1539 - $ref: "#/components/parameters/SessionToken"
1540 requestBody:
1541 $ref: "#/components/requestBodies/ChangePassword"
1542 responses:
1543 "400":
1544 $ref: "#/components/responses/Error"
1545 "401":
1546 $ref: "#/components/responses/Authentication"
1547 ######################################################################
1548 # Authentication: Current Sessions
1549 ######################################################################
1550 /_allauth/{client}/v1/auth/sessions:
1551 get:
1552 tags:
1553 - "Sessions"
1554 summary: List sessions
1555 parameters:
1556 - $ref: "#/components/parameters/Client"
1557 - $ref: "#/components/parameters/SessionToken"
1558 responses:
1559 "200":
1560 $ref: "#/components/responses/Sessions"
1561 delete:
1562 tags:
1563 - "Sessions"
1564 summary: End one or more sessions
1565 parameters:
1566 - $ref: "#/components/parameters/Client"
1567 - $ref: "#/components/parameters/SessionToken"
1568 requestBody:
1569 $ref: "#/components/requestBodies/EndSessions"
1570 responses:
1571 "200":
1572 $ref: "#/components/responses/Sessions"
1573 "401":
1574 $ref: "#/components/responses/Authentication"
1575 components:
1576 ######################################################################
1577 # Components: Examples
1578 ######################################################################
1579 examples:
1580 User:
1581 value: &user-example
1582 id: 123
1583 display: Magic Wizard
1584 has_usable_password: true
1585 email: [email protected]
1586 username: wizard
1587 AuthenticatedByPassword:
1588 summary: |
1589 Authenticated by password.
1590 value:
1591 status: 200
1592 data:
1593 user: *user-example
1594 methods:
1595 - method: password
1596 at: 1711555057.065702
1597 email: [email protected]
1598 meta:
1599 is_authenticated: true
1600 session_token: ufwcig0zen9skyd545jc0fkq813ghar2
1601 access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdW
1602 AuthenticatedByCode:
1603 summary: |
1604 Authenticated by code.
1605 value:
1606 status: 200
1607 data:
1608 user: *user-example
1609 methods:
1610 - method: code
1611 at: 1711555057.065702
1612 email: [email protected]
1613 meta:
1614 is_authenticated: true
1615 session_token: ufwcig0zen9skyd545jc0fkq813ghar2
1616 access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdW
1617 AuthenticatedByPasswordAnd2FA:
1618 summary: |
1619 Fully authenticated using by password and 2FA.
1620 value:
1621 status: 200
1622 data:
1623 user: *user-example
1624 methods:
1625 - method: password
1626 at: 1711555057.065702
1627 email: [email protected]
1628 - method: mfa
1629 at: 1711555060.9375854
1630 id: 66
1631 type: totp
1632 meta:
1633 is_authenticated: true
1634 session_token: ufwcig0zen9skyd545jc0fkq813ghar2
1635 access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdW
1636
1637 CannotGenerateRecoveryCodes:
1638 summary: |
1639 Unable to generate recovery codes.
1640 value:
1641 status: 400
1642 errors:
1643 - message: |
1644 You cannot deactivate two-factor authentication.
1645 code: cannot_generate_recovery_codes
1646 DisconnectNotAllowedNoPassword:
1647 summary: Account without a password.
1648 value:
1649 status: 400
1650 errors:
1651 - message: Your account has no password set up.
1652 code: no_password
1653 param: account
1654 DisconnectNotAllowedNoVerifiedEmail:
1655 summary: Account without a verified email.
1656 value:
1657 status: 400
1658 errors:
1659 - message: Your account has no verified email address.
1660 code: no_verified_email
1661 param: account
1662 InvalidAuthenticatorCode:
1663 summary: |
1664 An error response indicating that the provided code is incorrect.
1665 value:
1666 status: 400
1667 errors:
1668 - message: Incorrect code.
1669 code: incorrect_code
1670 param: code
1671 InvalidEmailVerificationKey:
1672 summary: |
1673 Email verification key invalid.
1674 value:
1675 status: 400
1676 errors:
1677 - message: Invalid or expired key.
1678 code: invalid
1679 param: key
1680 InvalidEmail:
1681 value:
1682 status: 400
1683 errors:
1684 - message: Enter a valid email address.
1685 code: invalid
1686 param: email
1687 IncorrectPassword:
1688 value:
1689 status: 400
1690 errors:
1691 - message: Incorrect password.
1692 param: password
1693 code: incorrect_password
1694 InvalidPasswordResetKey:
1695 summary: |
1696 Password reset key invalid.
1697 value:
1698 status: 400
1699 errors:
1700 - message: The password reset token was invalid.
1701 code: token_invalid
1702 param: key
1703 InvalidProviderToken:
1704 summary: |
1705 Provider token invalid.
1706 value:
1707 status: 400
1708 errors:
1709 - message: The token was invalid.
1710 code: invalid
1711 param: token
1712 PasswordMismatch:
1713 value:
1714 status: 400
1715 errors:
1716 - message: The email address and/or password you specified are not correct.
1717 code: email_password_mismatch
1718 param: password
1719 UnauthenticatedInitial:
1720 summary: |
1721 Unauthenticated: Initial
1722 value:
1723 status: 401
1724 data:
1725 flows:
1726 - id: login
1727 - id: signup
1728 - id: provider_redirect
1729 providers:
1730 - facebook
1731 - google
1732 - telegram
1733 - id: provider_token
1734 providers:
1735 - google
1736 meta:
1737 is_authenticated: false
1738 UnauthenticatedPending2FA:
1739 summary: |
1740 Unauthenticated: pending 2FA
1741 value:
1742 status: 401
1743 data:
1744 flows:
1745 - id: login
1746 - id: signup
1747 - id: provider_redirect
1748 providers:
1749 - facebook
1750 - google
1751 - telegram
1752 - id: provider_token
1753 providers:
1754 - google
1755 - id: mfa_authenticate
1756 is_pending: true
1757 meta:
1758 is_authenticated: false
1759 UnauthenticatedPendingLoginByCode:
1760 summary: |
1761 Unauthenticated: pending login by code
1762 value:
1763 status: 401
1764 data:
1765 flows:
1766 - id: login
1767 - id: signup
1768 - id: provider_redirect
1769 providers:
1770 - facebook
1771 - google
1772 - telegram
1773 - id: provider_token
1774 providers:
1775 - google
1776 - id: mfa_authenticate
1777 - id: login_by_code
1778 is_pending: true
1779 meta:
1780 is_authenticated: false
1781 UnauthenticatedPendingProviderSignup:
1782 summary: |
1783 Unauthenticated: pending provider signup
1784 value:
1785 status: 401
1786 data:
1787 flows:
1788 - id: login
1789 - id: signup
1790 - id: provider_redirect
1791 providers:
1792 - facebook
1793 - google
1794 - telegram
1795 - id: provider_token
1796 providers:
1797 - google
1798 - id: provider_signup
1799 provider:
1800 id: google
1801 name: Google
1802 client_id: 123.apps.googleusercontent.com
1803 flows:
1804 - provider_redirect
1805 - provider_token
1806 is_pending: true
1807 meta:
1808 is_authenticated: false
1809 UnauthenticatedPendingEmailVerification:
1810 summary: |
1811 Unauthenticated: pending email verification
1812 value:
1813 status: 401
1814 data:
1815 flows:
1816 - id: login
1817 - id: signup
1818 - id: provider_redirect
1819 providers:
1820 - facebook
1821 - google
1822 - telegram
1823 - id: provider_token
1824 providers:
1825 - google
1826 - id: verify_email
1827 is_pending: true
1828 meta:
1829 is_authenticated: false
1830 ReauthenticationRequired:
1831 summary: |
1832 Reauthentication required
1833 value:
1834 status: 401
1835 data:
1836 user: *user-example
1837 methods:
1838 - method: password
1839 at: 1711555057.065702
1840 email: [email protected]
1841 - method: mfa
1842 at: 1711555060.9375854
1843 id: 66
1844 type: totp
1845 flows:
1846 - id: reauthenticate
1847 - id: mfa_reauthenticate
1848 meta:
1849 is_authenticated: true
1850 ######################################################################
1851 # Components: Request bodies
1852 ######################################################################
1853 requestBodies:
1854 Login:
1855 description: Login.
1856 required: true
1857 content:
1858 application/json:
1859 schema:
1860 $ref: "#/components/schemas/Login"
1861 LoginWebAuthn:
1862 description: Login using WebAuthn.
1863 required: true
1864 content:
1865 application/json:
1866 schema:
1867 type: object
1868 properties:
1869 credential:
1870 $ref: "#/components/schemas/WebAuthnCredential"
1871 required:
1872 - credential
1873 ReauthenticateWebAuthn:
1874 description: Reauthenticate using WebAuthn.
1875 required: true
1876 content:
1877 application/json:
1878 schema:
1879 type: object
1880 properties:
1881 credential:
1882 $ref: "#/components/schemas/WebAuthnCredential"
1883 required:
1884 - credential
1885 AuthenticateWebAuthn:
1886 description: Authenticate using WebAuthn.
1887 required: true
1888 content:
1889 application/json:
1890 schema:
1891 type: object
1892 properties:
1893 credential:
1894 $ref: "#/components/schemas/WebAuthnCredential"
1895 required:
1896 - credential
1897 MFAAuthenticate:
1898 required: true
1899 content:
1900 application/json:
1901 schema:
1902 $ref: "#/components/schemas/MFAAuthenticate"
1903 MFATrust:
1904 required: true
1905 content:
1906 application/json:
1907 schema:
1908 $ref: "#/components/schemas/MFATrust"
1909 ConfirmLoginCode:
1910 required: true
1911 content:
1912 application/json:
1913 schema:
1914 $ref: "#/components/schemas/ConfirmLoginCode"
1915 EndSessions:
1916 required: true
1917 content:
1918 application/json:
1919 schema:
1920 $ref: "#/components/schemas/EndSessions"
1921 PasskeySignup:
1922 description: Signup using a passkey
1923 required: true
1924 content:
1925 application/json:
1926 schema:
1927 $ref: "#/components/schemas/PasskeySignup"
1928 ProviderAccount:
1929 content:
1930 application/json:
1931 schema:
1932 type: object
1933 properties:
1934 provider:
1935 $ref: "#/components/schemas/ProviderID"
1936 account:
1937 $ref: "#/components/schemas/ProviderAccountID"
1938 required:
1939 - account
1940 - provider
1941 ProviderRedirect:
1942 required: true
1943 description: |
1944 Initiate the provider redirect flow.
1945 content:
1946 application/x-www-form-urlencoded:
1947 schema:
1948 $ref: "#/components/schemas/ProviderRedirect"
1949 ProviderSignup:
1950 description: Provider signup.
1951 required: true
1952 content:
1953 application/json:
1954 schema:
1955 $ref: "#/components/schemas/ProviderSignup"
1956 ProviderToken:
1957 required: true
1958 content:
1959 application/json:
1960 schema:
1961 $ref: "#/components/schemas/ProviderToken"
1962 Reauthenticate:
1963 description: Reauthenticate.
1964 required: true
1965 content:
1966 application/json:
1967 schema:
1968 $ref: "#/components/schemas/Reauthenticate"
1969 RefreshToken:
1970 content:
1971 application/json:
1972 schema:
1973 type: object
1974 properties:
1975 refresh_token:
1976 $ref: "#/components/schemas/RefreshToken"
1977 required:
1978 - refresh_token
1979 RequestPassword:
1980 description: Request password.
1981 required: true
1982 content:
1983 application/json:
1984 schema:
1985 $ref: "#/components/schemas/RequestPassword"
1986 RequestLoginCode:
1987 description: Request a login code.
1988 required: true
1989 content:
1990 application/json:
1991 schema:
1992 $ref: "#/components/schemas/RequestLoginCode"
1993 SetupTOTP:
1994 content:
1995 application/json:
1996 schema:
1997 type: object
1998 properties:
1999 code:
2000 $ref: "#/components/schemas/AuthenticatorCode"
2001 required:
2002 - code
2003 Signup:
2004 description: Signup
2005 required: true
2006 content:
2007 application/json:
2008 schema:
2009 $ref: "#/components/schemas/Signup"
2010 ChangePassword:
2011 content:
2012 application/json:
2013 schema:
2014 type: object
2015 properties:
2016 current_password:
2017 $ref: "#/components/schemas/Password"
2018 new_password:
2019 type: string
2020 description: |
2021 The current password.
2022 example: Aberto!
2023 required:
2024 - new_password
2025 Email:
2026 content:
2027 application/json:
2028 schema:
2029 type: object
2030 properties:
2031 email:
2032 $ref: '#/components/schemas/Email'
2033 required:
2034 - email
2035 MarkPrimaryEmail:
2036 content:
2037 application/json:
2038 schema:
2039 type: object
2040 properties:
2041 email:
2042 type: string
2043 description: |
2044 An email address.
2045 example: [email protected]
2046 primary:
2047 type: boolean
2048 enum:
2049 - true
2050 description: |
2051 Primary flag.
2052 required:
2053 - email
2054 - primary
2055 Phone:
2056 content:
2057 application/json:
2058 schema:
2059 type: object
2060 properties:
2061 phone:
2062 type: string
2063 example: "+314159265359"
2064 required:
2065 - phone
2066 ResetPassword:
2067 content:
2068 application/json:
2069 schema:
2070 $ref: "#/components/schemas/ResetPassword"
2071 VerifyEmail:
2072 content:
2073 application/json:
2074 schema:
2075 $ref: "#/components/schemas/VerifyEmail"
2076 VerifyPhone:
2077 content:
2078 application/json:
2079 schema:
2080 $ref: "#/components/schemas/VerifyPhone"
2081 UpdateWebAuthn:
2082 content:
2083 application/json:
2084 schema:
2085 type: object
2086 properties:
2087 id:
2088 $ref: "#/components/schemas/AuthenticatorID"
2089 name:
2090 type: string
2091 example: "Master key"
2092 AddWebAuthnAuthenticator:
2093 content:
2094 application/json:
2095 schema:
2096 type: object
2097 properties:
2098 name:
2099 type: string
2100 example: "Master key"
2101 credential:
2102 $ref: "#/components/schemas/WebAuthnCredential"
2103 required:
2104 - credential
2105 DeleteWebAuthn:
2106 content:
2107 application/json:
2108 schema:
2109 type: object
2110 properties:
2111 authenticators:
2112 description: |
2113 The IDs of the authenticator that are to be deleted.
2114 type: array
2115 items:
2116 $ref: "#/components/schemas/AuthenticatorID"
2117 required:
2118 - authenticators
2119
2120 ######################################################################
2121 # Components: Schemas
2122 ######################################################################
2123 schemas:
2124 Session:
2125 type: object
2126 properties:
2127 user_agent:
2128 type: string
2129 example: Mozilla Firefox
2130 ip:
2131 type: string
2132 example: 127.2.3.192
2133 created_at:
2134 $ref: "#/components/schemas/Timestamp"
2135 is_current:
2136 type: boolean
2137 id:
2138 type: integer
2139 example: 123
2140 last_seen_at:
2141 $ref: "#/components/schemas/Timestamp"
2142 required:
2143 - user_agent
2144 - ip
2145 - created_at
2146 - is_current
2147 - id
2148 AccountConfiguration:
2149 type: object
2150 description: |
2151 Configuration of the Django `allauth.account` app.
2152 properties:
2153 login_methods:
2154 type: array
2155 items:
2156 type: string
2157 enum:
2158 - email
2159 - username
2160 is_open_for_signup:
2161 type: boolean
2162 email_verification_by_code_enabled:
2163 type: boolean
2164 login_by_code_enabled:
2165 type: boolean
2166 password_reset_by_code_enabled:
2167 type: boolean
2168 required:
2169 - authentication_method
2170 - email_verification_by_code_enabled
2171 - is_open_for_signup
2172 - login_by_code_enabled
2173 AuthenticationResponse:
2174 type: object
2175 description: |
2176 An authentication related response.
2177 properties:
2178 status:
2179 type: integer
2180 enum:
2181 - 401
2182 data:
2183 type: object
2184 properties:
2185 flows:
2186 type: array
2187 items:
2188 $ref: "#/components/schemas/Flow"
2189 required:
2190 - flows
2191 meta:
2192 $ref: "#/components/schemas/AuthenticationMeta"
2193 required:
2194 - status
2195 - data
2196 - meta
2197 ForbiddenResponse:
2198 type: object
2199 properties:
2200 status:
2201 type: integer
2202 enum:
2203 - 403
2204 required:
2205 - status
2206 ConflictResponse:
2207 type: object
2208 properties:
2209 status:
2210 type: integer
2211 enum:
2212 - 409
2213 required:
2214 - status
2215 EndSessions:
2216 type: object
2217 properties:
2218 sessions:
2219 description: |
2220 The IDs of the sessions that are to be ended.
2221 type: array
2222 items:
2223 type: integer
2224 example: 123
2225 required:
2226 - sessions
2227 PhoneNumber:
2228 type: object
2229 description: |
2230 A phone number.
2231 properties:
2232 phone:
2233 type: string
2234 example: "+314159265359"
2235 verified:
2236 type: boolean
2237 required:
2238 - phone
2239 - verified
2240 PhoneNumbersResponse:
2241 type: object
2242 properties:
2243 status:
2244 $ref: "#/components/schemas/StatusOK"
2245 data:
2246 type: array
2247 items:
2248 $ref: "#/components/schemas/PhoneNumber"
2249 required:
2250 - status
2251 - data
2252 PhoneNumberChangeResponse:
2253 type: object
2254 properties:
2255 status:
2256 $ref: "#/components/schemas/StatusAccepted"
2257 data:
2258 type: array
2259 items:
2260 $ref: "#/components/schemas/PhoneNumber"
2261 required:
2262 - status
2263 - data
2264 example:
2265 status: 202
2266 data:
2267 - phone: "+314159265359"
2268 verified: false
2269 ReauthenticationResponse:
2270 type: object
2271 description: |
2272 A response indicating reauthentication is required.
2273 properties:
2274 status:
2275 type: integer
2276 enum:
2277 - 401
2278 data:
2279 $ref: "#/components/schemas/ReauthenticationRequired"
2280 meta:
2281 $ref: "#/components/schemas/AuthenticatedMeta"
2282 required:
2283 - status
2284 - data
2285 - meta
2286 SessionGoneResponse:
2287 type: object
2288 description: |
2289 The session is expired or invalid.
2290 properties:
2291 status:
2292 type: integer
2293 enum:
2294 - 410
2295 data:
2296 type: object
2297 meta:
2298 $ref: "#/components/schemas/AuthenticationMeta"
2299 required:
2300 - status
2301 - data
2302 - meta
2303 BaseAuthenticationMeta:
2304 type: object
2305 properties:
2306 session_token:
2307 type: string
2308 description: |
2309 The session token (`app` clients only).
2310 example: ufwcig0zen9skyd545jc0fkq813ghar2
2311 access_token:
2312 type: string
2313 description: |
2314 The access token (`app` clients only).
2315 example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdW
2316 AuthenticationMeta:
2317 allOf:
2318 - $ref: "#/components/schemas/BaseAuthenticationMeta"
2319 - type: object
2320 description: |
2321 Metadata available in an authentication related response.
2322 properties:
2323 is_authenticated:
2324 type: boolean
2325 required:
2326 - is_authenticated
2327 AuthenticatedMeta:
2328 allOf:
2329 - $ref: "#/components/schemas/BaseAuthenticationMeta"
2330 - type: object
2331 description: |
2332 Metadata available in an re-authentication related response.
2333 properties:
2334 is_authenticated:
2335 type: boolean
2336 enum:
2337 - true
2338 required:
2339 - is_authenticated
2340 Flow:
2341 type: object
2342 properties:
2343 id:
2344 type: string
2345 enum:
2346 - login
2347 - login_by_code
2348 - mfa_authenticate
2349 - mfa_reauthenticate
2350 - provider_redirect
2351 - provider_signup
2352 - provider_token
2353 - reauthenticate
2354 - signup
2355 - verify_email
2356 - verify_phone
2357 provider:
2358 $ref: "#/components/schemas/Provider"
2359 is_pending:
2360 type: boolean
2361 enum:
2362 - true
2363 types:
2364 type: array
2365 description: Matches `settings.MFA_SUPPORTED_TYPES`.
2366 items:
2367 $ref: "#/components/schemas/AuthenticatorType"
2368 required:
2369 - id
2370 Authenticated:
2371 type: object
2372 properties:
2373 user:
2374 $ref: "#/components/schemas/User"
2375 methods:
2376 type: array
2377 description: |
2378 A list of methods used to authenticate.
2379 items:
2380 $ref: "#/components/schemas/AuthenticationMethod"
2381 required:
2382 - user
2383 - methods
2384 ReauthenticationRequired:
2385 properties:
2386 flows:
2387 type: array
2388 items:
2389 $ref: '#/components/schemas/Flow'
2390 user:
2391 $ref: '#/components/schemas/User'
2392 methods:
2393 type: array
2394 description: |
2395 A list of methods used to authenticate.
2396 items:
2397 $ref: '#/components/schemas/AuthenticationMethod'
2398 required:
2399 - flows
2400 - user
2401 - methods
2402 type: object
2403 AuthenticationMethod:
2404 oneOf:
2405 - type: object
2406 title: |
2407 Authenticated by username/email login
2408 properties:
2409 method:
2410 type: string
2411 enum:
2412 - password
2413 at:
2414 $ref: "#/components/schemas/Timestamp"
2415 email:
2416 $ref: "#/components/schemas/Email"
2417 username:
2418 $ref: "#/components/schemas/Username"
2419 required:
2420 - method
2421 - at
2422 - type: object
2423 title: |
2424 Authenticated after password reset
2425 properties:
2426 method:
2427 type: string
2428 enum:
2429 - password_reset
2430 at:
2431 $ref: "#/components/schemas/Timestamp"
2432 email:
2433 $ref: "#/components/schemas/Email"
2434 required:
2435 - at
2436 - email
2437 - method
2438 - type: object
2439 title: |
2440 Authenticated by confirming a code sent by email.
2441 properties:
2442 method:
2443 type: string
2444 enum:
2445 - code
2446 at:
2447 $ref: "#/components/schemas/Timestamp"
2448 email:
2449 $ref: "#/components/schemas/Email"
2450 required:
2451 - at
2452 - email
2453 - method
2454 - type: object
2455 title: |
2456 Authenticated by confirming a code sent by phone.
2457 properties:
2458 method:
2459 type: string
2460 enum:
2461 - code
2462 at:
2463 $ref: "#/components/schemas/Timestamp"
2464 phone:
2465 $ref: "#/components/schemas/Phone"
2466 required:
2467 - at
2468 - method
2469 - phone
2470 - type: object
2471 title: |
2472 Reauthenticated by password
2473 properties:
2474 method:
2475 type: string
2476 enum:
2477 - password
2478 at:
2479 $ref: "#/components/schemas/Timestamp"
2480 reauthenticated:
2481 type: boolean
2482 enum:
2483 - true
2484 required:
2485 - method
2486 - reauthenticated
2487 - at
2488 - type: object
2489 title: |
2490 Authenticated by third-party provider
2491 properties:
2492 method:
2493 type: string
2494 enum:
2495 - socialaccount
2496 at:
2497 $ref: "#/components/schemas/Timestamp"
2498 provider:
2499 $ref: "#/components/schemas/ProviderID"
2500 uid:
2501 $ref: "#/components/schemas/ProviderAccountID"
2502 required:
2503 - method
2504 - reauthenticated
2505 - at
2506 - provider
2507 - uid
2508 - type: object
2509 title: |
2510 (Re)authenticated by 2FA
2511 properties:
2512 method:
2513 type: string
2514 enum:
2515 - mfa
2516 at:
2517 $ref: "#/components/schemas/Timestamp"
2518 type:
2519 $ref: "#/components/schemas/AuthenticatorType"
2520 reauthenticated:
2521 type: boolean
2522 required:
2523 - method
2524 - at
2525 - type
2526 AuthenticatedResponse:
2527 type: object
2528 properties:
2529 status:
2530 $ref: "#/components/schemas/StatusOK"
2531 data:
2532 $ref: "#/components/schemas/Authenticated"
2533 meta:
2534 $ref: "#/components/schemas/AuthenticationMeta"
2535 required:
2536 - status
2537 - data
2538 - meta
2539 MFAAuthenticate:
2540 type: object
2541 properties:
2542 code:
2543 $ref: "#/components/schemas/AuthenticatorCode"
2544 required:
2545 - code
2546 MFATrust:
2547 type: object
2548 properties:
2549 trust:
2550 type: boolean
2551 required:
2552 - trust
2553 ConfirmLoginCode:
2554 type: object
2555 properties:
2556 code:
2557 $ref: "#/components/schemas/Code"
2558 required:
2559 - code
2560 ClientID:
2561 type: string
2562 description: |
2563 The client ID (in case of OAuth2 or OpenID Connect based providers)
2564 example: 123.apps.googleusercontent.com
2565 ProviderToken:
2566 type: object
2567 properties:
2568 provider:
2569 $ref: "#/components/schemas/ProviderID"
2570 process:
2571 $ref: "#/components/schemas/Process"
2572 token:
2573 description: |
2574 The token.
2575 type: object
2576 properties:
2577 client_id:
2578 $ref: "#/components/schemas/ClientID"
2579 id_token:
2580 type: string
2581 description: |
2582 The ID token.
2583 example: eyJhbGciOiJI
2584 access_token:
2585 type: string
2586 description: |
2587 The access token.
2588 example: 36POk6yJV_adQs
2589 required:
2590 - client_id
2591 required:
2592 - provider
2593 - process
2594 - token
2595 ProviderRedirect:
2596 type: object
2597 properties:
2598 provider:
2599 $ref: "#/components/schemas/ProviderID"
2600 callback_url:
2601 type: string
2602 description: |
2603 The URL to return to after the redirect flow is complete.
2604
2605 Note that this is not to be mistaken with the callback URL that you
2606 configure over at the OAuth provider during the OAuth app/client
2607 setup. The flow is as follows:
2608
2609 1. Your frontend redirects to the headless provider redirect
2610 endpoint in a synchronous (non-XHR) manner, informing allauth
2611 (by means of `callback_url`) where to redirect to after the
2612 provider handshake is completed.
2613
2614 2. Headless will redirect to the (OAuth) identity provider to
2615 initiate the handshake, passing along a different callback URL
2616 to the provider: one that points to an allauth backend URL.
2617 This is the URL that you need to have setup at your OAuth
2618 app/client configuration. Note that this must be a backend URL
2619 as providers can use POST requests to perform their callbacks,
2620 which is something a frontend would not be able to handle.
2621
2622 3. After the authorization at the provider is completed, the
2623 provider redirects to the *backend* allauth callback URL, which
2624 will then redirect back to the *frontend* callback URL.
2625
2626 4. Your frontend is now expected to fetch the current session to
2627 determine what the next course of action is. The user could be
2628 authenticated at this point, or another flow is pending
2629 (e.g. email verification, or, provider signup). In case of
2630 errors a `?error=` is passed to the frontend callback URL.
2631 example: https://app.project.org/account/provider/callback
2632 process:
2633 $ref: "#/components/schemas/Process"
2634 required:
2635 - provider
2636 - process
2637 - callback_url
2638 RequestPassword:
2639 type: object
2640 properties:
2641 email:
2642 $ref: "#/components/schemas/Email"
2643 required:
2644 - email
2645 RequestLoginCode:
2646 type: object
2647 anyOf:
2648 - title: Request login code (phone)
2649 properties:
2650 phone:
2651 $ref: "#/components/schemas/Phone"
2652 required:
2653 - phone
2654 - title: Request login code (email)
2655 properties:
2656 email:
2657 $ref: "#/components/schemas/Email"
2658 required:
2659 - email
2660 Reauthenticate:
2661 type: object
2662 properties:
2663 password:
2664 $ref: "#/components/schemas/Password"
2665 required:
2666 - password
2667 ProviderSignup:
2668 allOf:
2669 - $ref: '#/components/schemas/BaseSignup'
2670 PasskeySignup:
2671 allOf:
2672 - $ref: '#/components/schemas/BaseSignup'
2673 BaseSignup:
2674 type: object
2675 properties:
2676 email:
2677 $ref: "#/components/schemas/Email"
2678 phone:
2679 $ref: "#/components/schemas/Phone"
2680 username:
2681 $ref: "#/components/schemas/Username"
2682 Signup:
2683 allOf:
2684 - $ref: '#/components/schemas/BaseSignup'
2685 - type: object
2686 properties:
2687 password:
2688 $ref: "#/components/schemas/Password"
2689 required:
2690 - password
2691 Username:
2692 type: string
2693 description: |
2694 The username.
2695 example: wizard
2696 Email:
2697 type: string
2698 description: |
2699 The email address.
2700 example: [email protected]
2701 Phone:
2702 type: string
2703 description: |
2704 The phone number.
2705 example: "+314159265359"
2706 AccessToken:
2707 type: string
2708 description: |
2709 The access token.
2710 example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdW
2711 RefreshToken:
2712 type: string
2713 description: |
2714 The refresh token.
2715 example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.QV30
2716 Login:
2717 allOf:
2718 - type: object
2719 properties:
2720 password:
2721 $ref: "#/components/schemas/Password"
2722 required:
2723 - password
2724 - anyOf:
2725 - title: Login by username
2726 properties:
2727 username:
2728 $ref: "#/components/schemas/Username"
2729 required:
2730 - username
2731 - title: Login by email
2732 properties:
2733 email:
2734 $ref: "#/components/schemas/Email"
2735 required:
2736 - email
2737 - title: Login by phone
2738 properties:
2739 phone:
2740 $ref: "#/components/schemas/Phone"
2741 required:
2742 - phone
2743 StatusOK:
2744 type: integer
2745 enum:
2746 - 200
2747 StatusAccepted:
2748 type: integer
2749 enum:
2750 - 202
2751 AuthenticatorID:
2752 type: integer
2753 description: |
2754 Authenticator ID.
2755 example: 123
2756 SocialAccountConfiguration:
2757 type: object
2758 description: |
2759 Configuration of the Django `allauth.socialaccount` app.
2760 properties:
2761 providers:
2762 $ref: "#/components/schemas/ProviderList"
2763 required:
2764 - providers
2765 MFAConfiguration:
2766 type: object
2767 description: |
2768 Configuration of the Django `allauth.mfa` app.
2769 properties:
2770 supported_types:
2771 type: array
2772 description: |
2773 Matches `settings.MFA_SUPPORTED_TYPES`.
2774 items:
2775 $ref: "#/components/schemas/AuthenticatorType"
2776 required:
2777 - supported_types
2778 UserSessionsConfiguration:
2779 type: object
2780 description: |
2781 Configuration of the Django `allauth.usersessions` app.
2782 properties:
2783 track_activity:
2784 type: boolean
2785 description: |
2786 Matches `settings.USERSESSIONS_TRACK_ACTIVITY`.
2787 required:
2788 - track_activity
2789 ConfigurationResponse:
2790 type: object
2791 properties:
2792 data:
2793 type: object
2794 properties:
2795 account:
2796 $ref: "#/components/schemas/AccountConfiguration"
2797 socialaccount:
2798 $ref: "#/components/schemas/SocialAccountConfiguration"
2799 mfa:
2800 $ref: "#/components/schemas/MFAConfiguration"
2801 usersessions:
2802 $ref: "#/components/schemas/UserSessionsConfiguration"
2803 required:
2804 - account
2805 status:
2806 $ref: "#/components/schemas/StatusOK"
2807 required:
2808 - status
2809 - data
2810 example:
2811 status: 200
2812 data:
2813 account:
2814 authentication_method: email
2815 socialaccount:
2816 providers:
2817 - id: "google"
2818 name: "Google"
2819 flows:
2820 - "provider_redirect"
2821 - "provider_token"
2822 client_id: "123.apps.googleusercontent.com"
2823 openid_configuration_url: https://accounts.google.com/.well-known/openid-configuration
2824 mfa:
2825 supported_types:
2826 - "recovery_codes"
2827 - "totp"
2828 usersessions:
2829 track_activity: false
2830 ResetPassword:
2831 type: object
2832 properties:
2833 key:
2834 type: string
2835 description: The password reset key
2836 example: 2f-c4nqd4-e07d9bc694f9f28cd4fe92569d495333
2837 password:
2838 $ref: "#/components/schemas/Password"
2839 required:
2840 - key
2841 - password
2842 VerifyEmail:
2843 type: object
2844 properties:
2845 key:
2846 type: string
2847 description: The email verification key
2848 example: 2f-c4nqd4-e07d9bc694f9f28cd4fe92569d495333
2849 required:
2850 - key
2851 VerifyPhone:
2852 type: object
2853 properties:
2854 code:
2855 type: string
2856 description: The phone verification code
2857 example: 4S3H82
2858 required:
2859 - code
2860 OptionalTimestamp:
2861 nullable: true
2862 $ref: "#/components/schemas/Timestamp"
2863 Timestamp:
2864 type: number
2865 description: |
2866 An epoch based timestamp (trivial to parse using: `new Date(value)*1000`)
2867 example: 1711555057.065702
2868 AuthenticatorCode:
2869 type: string
2870 description: |
2871 An authenticator code.
2872 example: "314159"
2873 Code:
2874 type: string
2875 description: |
2876 An one-time code.
2877 example: "NQ3TM5"
2878 AuthenticatorType:
2879 type: string
2880 enum:
2881 - recovery_codes
2882 - totp
2883 - webauthn
2884 description: |
2885 The type of authenticator.
2886 Password:
2887 type: string
2888 description: |
2889 The password.
2890 example: Alohomora!
2891 ErrorResponse:
2892 type: object
2893 properties:
2894 status:
2895 type: integer
2896 enum:
2897 - 400
2898 example: 400
2899 errors:
2900 type: array
2901 items:
2902 type: object
2903 properties:
2904 code:
2905 type: string
2906 example: invalid
2907 description: |
2908 An error code.
2909 param:
2910 type: string
2911 example: email
2912 description: |
2913 The name of the input parameter that was incorrect.
2914 message:
2915 type: string
2916 example: Enter a valid email address.
2917 description: |
2918 A human readable error message.
2919 required:
2920 - code
2921 - message
2922 Process:
2923 type: string
2924 description: |
2925 The process to be executed when the user successfully
2926 authenticates. When set to `login`, the user will be logged into the
2927 account to which the provider account is connected, or if no such
2928 account exists, a signup will occur. If set to `connect`, the provider
2929 account will be connected to the list of provider accounts for the
2930 currently authenticated user.
2931 enum:
2932 - login
2933 - connect
2934 example: login
2935 ProviderID:
2936 type: string
2937 description: |
2938 The provider ID.
2939 example: google
2940 ProviderAccountID:
2941 type: string
2942 description: |
2943 The provider specific account ID.
2944 example: goo12345
2945 User:
2946 type: object
2947 properties:
2948 id:
2949 description: |
2950 The user ID.
2951 oneOf:
2952 - type: integer
2953 example: 123
2954 - type: string
2955 example: 89d3f9a0-51a5-49dd-8b97-7536641958e9
2956 display:
2957 type: string
2958 description: |
2959 The display name for the user.
2960 example: Magic Wizard
2961 has_usable_password:
2962 type: boolean
2963 description: |
2964 Whether or not the account has a password set.
2965 example: true
2966 email:
2967 $ref: "#/components/schemas/Email"
2968 username:
2969 $ref: "#/components/schemas/Username"
2970 EmailAddress:
2971 type: object
2972 properties:
2973 email:
2974 $ref: "#/components/schemas/Email"
2975 primary:
2976 type: boolean
2977 example: true
2978 verified:
2979 type: boolean
2980 example: false
2981 required:
2982 - email
2983 - primary
2984 - verified
2985 BaseAuthenticator:
2986 type: object
2987 properties:
2988 last_used_at:
2989 $ref: "#/components/schemas/OptionalTimestamp"
2990 created_at:
2991 $ref: "#/components/schemas/Timestamp"
2992 required:
2993 - created_at
2994 - last_used_at
2995 TOTPAuthenticator:
2996 allOf:
2997 - $ref: "#/components/schemas/BaseAuthenticator"
2998 - type: object
2999 properties:
3000 type:
3001 type: string
3002 enum:
3003 - totp
3004 required:
3005 - type
3006 WebAuthnAuthenticator:
3007 allOf:
3008 - $ref: "#/components/schemas/BaseAuthenticator"
3009 - type: object
3010 properties:
3011 type:
3012 type: string
3013 enum:
3014 - webauthn
3015 id:
3016 $ref: "#/components/schemas/AuthenticatorID"
3017 name:
3018 type: string
3019 example: "Master key"
3020 is_passwordless:
3021 type: boolean
3022 description: |
3023 Whether or not this authenticator represents a passkey. Absent if it is not specified.
3024 required:
3025 - type
3026 - id
3027 - name
3028 RecoveryCodesAuthenticator:
3029 allOf:
3030 - $ref: "#/components/schemas/BaseAuthenticator"
3031 - type: object
3032 properties:
3033 type:
3034 type: string
3035 description: |
3036 The authenticator type.
3037 enum:
3038 - recovery_codes
3039 total_code_count:
3040 type: integer
3041 description: |
3042 The total number of recovery codes that initially were available.
3043 example: 10
3044 unused_code_count:
3045 type: integer
3046 description: |
3047 The number of recovery codes that are unused.
3048 example: 7
3049 required:
3050 - type
3051 - total_code_count
3052 - unused_code_count
3053 SensitiveRecoveryCodesAuthenticator:
3054 allOf:
3055 - $ref: "#/components/schemas/RecoveryCodesAuthenticator"
3056 - type: object
3057 properties:
3058 unused_codes:
3059 type: array
3060 description: |
3061 The list of unused codes.
3062 items:
3063 $ref: "#/components/schemas/AuthenticatorCode"
3064 required:
3065 - unused_codes
3066 AuthenticatorList:
3067 type: array
3068 items:
3069 oneOf:
3070 - $ref: "#/components/schemas/TOTPAuthenticator"
3071 - $ref: "#/components/schemas/RecoveryCodesAuthenticator"
3072 - $ref: "#/components/schemas/WebAuthnAuthenticator"
3073 ProviderList:
3074 type: array
3075 items:
3076 $ref: "#/components/schemas/Provider"
3077 Provider:
3078 type: object
3079 properties:
3080 id:
3081 type: string
3082 example: google
3083 description: |
3084 The provider ID.
3085 name:
3086 type: string
3087 description: |
3088 The name of the provider.
3089 example: Google
3090 client_id:
3091 type: string
3092 description: |
3093 The client ID (in case of OAuth2 or OpenID Connect based providers)
3094 example: 123.apps.googleusercontent.com
3095 openid_configuration_url:
3096 type: string
3097 description: |
3098 The OIDC discovery or well-known URL (in case of OAuth2 or OpenID Connect based providers)
3099 example: https://accounts.google.com/.well-known/openid-configuration
3100 flows:
3101 type: array
3102 description: |
3103 The authentication flows the provider integration supports.
3104 items:
3105 type: string
3106 enum:
3107 - provider_redirect
3108 - provider_token
3109 required:
3110 - id
3111 - name
3112 - flows
3113 ProviderAccount:
3114 type: object
3115 properties:
3116 uid:
3117 $ref: "#/components/schemas/ProviderAccountID"
3118 display:
3119 type: string
3120 description: |
3121 A name derived from the third-party provider account data.
3122 example: Wizzkid
3123 provider:
3124 $ref: "#/components/schemas/Provider"
3125 required:
3126 - uid
3127 - provider
3128 - display
3129 EmailVerificationInfo:
3130 type: object
3131 properties:
3132 status:
3133 $ref: "#/components/schemas/StatusOK"
3134 data:
3135 type: object
3136 properties:
3137 email:
3138 $ref: "#/components/schemas/Email"
3139 user:
3140 $ref: "#/components/schemas/User"
3141 required:
3142 - email
3143 - user
3144 meta:
3145 type: object
3146 properties:
3147 is_authenticating:
3148 type: boolean
3149 required:
3150 - is_authenticating
3151 required:
3152 - status
3153 - data
3154 - meta
3155 WebAuthnCredentialRequestOptions:
3156 type: object
3157 properties:
3158 request_options:
3159 type: object
3160 example: {"status": 200, "data": {"request_options": {"publicKey": {"challenge": "aOecJJtLA2e-Dj2WU-zbRoJewbQqSUPxoA9EzsUL72o", "rpId": "localhost", "allowCredentials": [], "userVerification": "preferred"}}}}
3161 required:
3162 - request_options
3163 WebAuthnCredentialCreationOptions:
3164 type: object
3165 properties:
3166 creation_options:
3167 type: object
3168 example: {"status": 200, "data": {"request_options": {"publicKey": {"challenge": "aOecJJtLA2e-Dj2WU-zbRoJewbQqSUPxoA9EzsUL72o", "rpId": "localhost", "allowCredentials": [], "userVerification": "preferred"}}}}
3169 required:
3170 - creation_options
3171 WebAuthnCredential:
3172 type: object
3173 example: {"credential":{"type":"public-key","id":"-J4JNfPfnLyRSMK4R...","rawId":"-J4JNfPfnLyRSMK4R...","authenticatorAttachment":"cross-platform","response":{"clientDataJSON":"eyJjaGFsbGVuZ2UiOi...","authenticatorData":"SZYN5YgO...","signature":"MEUCIE-7sqILygPqGbrRZ4j2nqeqUU...","userHandle":"Mg..."},"clientExtensionResults":{}}}
3174 ######################################################################
3175 # Components: Parameters
3176 ######################################################################
3177 parameters:
3178 Client:
3179 name: client
3180 in: path
3181 description: The type of client accessing the API.
3182 required: true
3183 schema:
3184 type: string
3185 enum:
3186 - app
3187 - browser
3188 EmailVerificationKey:
3189 in: header
3190 name: X-Email-Verification-Key
3191 schema:
3192 type: string
3193 required: true
3194 description: The email verification key
3195 PasswordResetKey:
3196 in: header
3197 name: X-Password-Reset-Key
3198 schema:
3199 type: string
3200 required: true
3201 description: The password reset key
3202 SessionToken:
3203 in: header
3204 name: X-Session-Token
3205 required: false
3206 description: |
3207 Session token. Only needed when `client` is equal to `app`.
3208 schema:
3209 type: string
3210 PasswordLess:
3211 in: query
3212 name: passwordless
3213 required: false
3214 schema:
3215 type: boolean
3216 allowEmptyValue: true
3217 description: |
3218 When present (regardless of its value), enables passwordless sign-in via a WebAuthn credential (Passkey),
3219 but may enforce additional multi-factor authentication (MFA) requirements. Omit the parameter to disable.
3220 ######################################################################
3221 # Components: Responses
3222 ######################################################################
3223 responses:
3224 AddAuthenticatorConflict:
3225 description: |
3226 The account prohibits adding an authenticator, e.g. because of an unverified email address.
3227 content:
3228 application/json:
3229 schema:
3230 $ref: "#/components/schemas/ConflictResponse"
3231 Authentication:
3232 description: Not authenticated.
3233 content:
3234 application/json:
3235 schema:
3236 $ref: "#/components/schemas/AuthenticationResponse"
3237 examples:
3238 unauthenticated_initial:
3239 $ref: "#/components/examples/UnauthenticatedInitial"
3240 unauthenticated_pending_2fa:
3241 $ref: "#/components/examples/UnauthenticatedPending2FA"
3242 unauthenticated_pending_provider_signup:
3243 $ref: "#/components/examples/UnauthenticatedPendingProviderSignup"
3244 unauthenticated_pending_email_verification:
3245 $ref: "#/components/examples/UnauthenticatedPendingEmailVerification"
3246 reauthentication_required:
3247 $ref: "#/components/examples/ReauthenticationRequired"
3248
3249 Authenticators:
3250 description: |
3251 List of authenticators.
3252 content:
3253 application/json:
3254 schema:
3255 type: object
3256 properties:
3257 status:
3258 $ref: "#/components/schemas/StatusOK"
3259 data:
3260 $ref: "#/components/schemas/AuthenticatorList"
3261 required:
3262 - status
3263 - data
3264 AuthenticatedByPassword:
3265 description: |
3266 Authenticated by password.
3267 content:
3268 application/json:
3269 schema:
3270 $ref: "#/components/schemas/AuthenticatedResponse"
3271 examples:
3272 authenticated:
3273 $ref: "#/components/examples/AuthenticatedByPassword"
3274 AuthenticatedByCode:
3275 description: |
3276 Authenticated by code.
3277 content:
3278 application/json:
3279 schema:
3280 $ref: "#/components/schemas/AuthenticatedResponse"
3281 examples:
3282 authenticated:
3283 $ref: "#/components/examples/AuthenticatedByCode"
3284 AuthenticatedByPasswordAnd2FA:
3285 description: |
3286 Authenticated by password and 2FA.
3287 content:
3288 application/json:
3289 schema:
3290 $ref: "#/components/schemas/AuthenticatedResponse"
3291 examples:
3292 authenticated:
3293 $ref: "#/components/examples/AuthenticatedByPasswordAnd2FA"
3294 AuthenticationOrReauthentication:
3295 description: |
3296 The response indicates authentication or re-authentication is required.
3297 content:
3298 application/json:
3299 schema:
3300 oneOf:
3301 - $ref: "#/components/schemas/AuthenticationResponse"
3302 - $ref: "#/components/schemas/ReauthenticationResponse"
3303 Configuration:
3304 description: |
3305 The django-allauth configuration.
3306 content:
3307 application/json:
3308 schema:
3309 $ref: "#/components/schemas/ConfigurationResponse"
3310 EmailAddresses:
3311 description: |
3312 List of email addresses.
3313 content:
3314 application/json:
3315 schema:
3316 type: object
3317 properties:
3318 status:
3319 $ref: "#/components/schemas/StatusOK"
3320 data:
3321 type: array
3322 items:
3323 $ref: "#/components/schemas/EmailAddress"
3324 required:
3325 - status
3326 - data
3327 EmailVerificationInfo:
3328 description: Email verification information.
3329 content:
3330 application/json:
3331 schema:
3332 $ref: "#/components/schemas/EmailVerificationInfo"
3333 Error:
3334 description: An input error occurred.
3335 content:
3336 application/json:
3337 schema:
3338 $ref: "#/components/schemas/ErrorResponse"
3339 Forbidden:
3340 description: |
3341 A forbidden response.
3342 content:
3343 application/json:
3344 schema:
3345 $ref: "#/components/schemas/ForbiddenResponse"
3346 NotFound:
3347 description: |
3348 Not found.
3349 content:
3350 application/json:
3351 schema:
3352 type: object
3353 properties:
3354 status:
3355 type: integer
3356 enum:
3357 - 404
3358 required:
3359 - status
3360 PasswordResetInfo:
3361 description: Information about the password reset key.
3362 content:
3363 application/json:
3364 schema:
3365 type: object
3366 properties:
3367 status:
3368 $ref: "#/components/schemas/StatusOK"
3369 data:
3370 type: object
3371 properties:
3372 user:
3373 $ref: "#/components/schemas/User"
3374 required:
3375 - status
3376 - data
3377 PhoneNumbers:
3378 description: |
3379 List of phone numbers.
3380 content:
3381 application/json:
3382 schema:
3383 $ref: "#/components/schemas/PhoneNumbersResponse"
3384 ProviderAccounts:
3385 description: |
3386 List of third-party provider accounts.
3387 content:
3388 application/json:
3389 schema:
3390 type: object
3391 properties:
3392 status:
3393 $ref: "#/components/schemas/StatusOK"
3394 data:
3395 type: array
3396 items:
3397 $ref: "#/components/schemas/ProviderAccount"
3398 required:
3399 - status
3400 - data
3401 ProviderSignup:
3402 description: |
3403 Information relating to the pending provider signup.
3404 content:
3405 application/json:
3406 schema:
3407 type: object
3408 properties:
3409 status:
3410 $ref: "#/components/schemas/StatusOK"
3411 data:
3412 type: object
3413 properties:
3414 email:
3415 type: array
3416 items:
3417 $ref: "#/components/schemas/EmailAddress"
3418 account:
3419 $ref: "#/components/schemas/ProviderAccount"
3420 user:
3421 $ref: "#/components/schemas/User"
3422 required:
3423 - email
3424 - account
3425 - user
3426 required:
3427 - status
3428 - data
3429 ReauthenticationRequired:
3430 description: |
3431 The response indicates reauthentication is required.
3432 content:
3433 application/json:
3434 schema:
3435 $ref: "#/components/schemas/ReauthenticationResponse"
3436 examples:
3437 reauthentication_required:
3438 summary: |
3439 Reauthentication required
3440 value:
3441 status: 401
3442 data:
3443 user: *user-example
3444 methods:
3445 - method: password
3446 at: 1711555057.065702
3447 email: [email protected]
3448 - method: mfa
3449 at: 1711555060.9375854
3450 id: 66
3451 type: totp
3452 flows:
3453 - id: reauthenticate
3454 - id: mfa_reauthenticate
3455 meta:
3456 is_authenticated: true
3457 RecoveryCodes:
3458 description: |
3459 Information on the recovery codes.
3460 content:
3461 application/json:
3462 schema:
3463 type: object
3464 properties:
3465 status:
3466 $ref: "#/components/schemas/StatusOK"
3467 data:
3468 $ref: "#/components/schemas/SensitiveRecoveryCodesAuthenticator"
3469 required:
3470 - status
3471 - data
3472 RefreshToken:
3473 description: A new access token (and optionally new refresh token).
3474 content:
3475 application/json:
3476 schema:
3477 type: object
3478 properties:
3479 status:
3480 $ref: "#/components/schemas/StatusOK"
3481 data:
3482 type: object
3483 properties:
3484 access_token:
3485 $ref: "#/components/schemas/AccessToken"
3486 refresh_token:
3487 $ref: "#/components/schemas/RefreshToken"
3488 required:
3489 - access_token
3490 required:
3491 - data
3492 - status
3493 Sessions:
3494 description: |
3495 List of sessions.
3496 content:
3497 application/json:
3498 schema:
3499 type: object
3500 properties:
3501 status:
3502 $ref: "#/components/schemas/StatusOK"
3503 data:
3504 type: array
3505 items:
3506 $ref: "#/components/schemas/Session"
3507 required:
3508 - status
3509 - data
3510 SessionGone:
3511 description: |
3512 The response indicates session is invalid or no longer exists.
3513 content:
3514 application/json:
3515 schema:
3516 $ref: "#/components/schemas/SessionGoneResponse"
3517 examples:
3518 unauth:
3519 $ref: "#/components/examples/UnauthenticatedInitial"
3520 StatusOK:
3521 description: |
3522 A success response.
3523 content:
3524 application/json:
3525 schema:
3526 type: object
3527 properties:
3528 status:
3529 $ref: "#/components/schemas/StatusOK"
3530 required:
3531 - status
3532 TooManyRequests:
3533 description: |
3534 Too many requests.
3535 content:
3536 application/json:
3537 schema:
3538 type: object
3539 properties:
3540 status:
3541 type: integer
3542 enum:
3543 - 429
3544 required:
3545 - status
3546 TOTPAuthenticator:
3547 description: |
3548 Information on the TOTP authenticator.
3549 content:
3550 application/json:
3551 schema:
3552 type: object
3553 properties:
3554 status:
3555 $ref: "#/components/schemas/StatusOK"
3556 meta:
3557 properties:
3558 recovery_codes_generated:
3559 description: Whether or not recovery codes where generated automatically.
3560 type: boolean
3561 type: object
3562 data:
3563 $ref: "#/components/schemas/TOTPAuthenticator"
3564 required:
3565 - status
3566 - data
3567 TOTPAuthenticatorNotFound:
3568 description: |
3569 No TOTP authenticator has been set up.
3570 content:
3571 application/json:
3572 schema:
3573 type: object
3574 properties:
3575 status:
3576 type: integer
3577 enum:
3578 - 404
3579 meta:
3580 type: object
3581 properties:
3582 secret:
3583 type: string
3584 description: |
3585 A TOTP secret that can be used to setup a new authenticator.
3586 example: J4ZKKXTK7NOVU7EPUVY23LCDV4T2QZYM
3587 totp_url:
3588 type: string
3589 description: |
3590 otpauth URI from which a QR code can be generated and scanned by OTP clients.
3591 example: otpauth://totp/Example:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=Example
3592 required:
3593 - secret
3594 - totp_url
3595 required:
3596 - status
3597 - meta
3598 Unauthenticated:
3599 description: |
3600 There is no authenticated session.
3601 content:
3602 application/json:
3603 schema:
3604 $ref: "#/components/schemas/AuthenticationResponse"
3605 examples:
3606 unauth:
3607 $ref: "#/components/examples/UnauthenticatedInitial"
3608 Authenticated:
3609 description: The user is authenticated.
3610 content:
3611 application/json:
3612 schema:
3613 $ref: "#/components/schemas/AuthenticatedResponse"
3614 WebAuthnRequestOptionsResponse:
3615 description: WebAuthn credential request options.
3616 content:
3617 application/json:
3618 schema:
3619 type: object
3620 properties:
3621 status:
3622 $ref: "#/components/schemas/StatusOK"
3623 data:
3624 $ref: "#/components/schemas/WebAuthnCredentialRequestOptions"
3625 required:
3626 - status
3627 - data
3628 WebAuthnCreationOptionsResponse:
3629 description: WebAuthn credential creation options.
3630 content:
3631 application/json:
3632 schema:
3633 type: object
3634 properties:
3635 status:
3636 $ref: "#/components/schemas/StatusOK"
3637 data:
3638 $ref: "#/components/schemas/WebAuthnCredentialCreationOptions"
3639 required:
3640 - status
3641 - data
3642 WebAuthnAuthenticator:
3643 description: A WebAuthn authenticator.
3644 content:
3645 application/json:
3646 schema:
3647 type: object
3648 properties:
3649 status:
3650 $ref: "#/components/schemas/StatusOK"
3651 data:
3652 $ref: "#/components/schemas/WebAuthnAuthenticator"
3653 required:
3654 - status
3655 - data
3656 AddWebAuthnAuthenticator:
3657 description: A WebAuthn authenticator.
3658 content:
3659 application/json:
3660 schema:
3661 type: object
3662 properties:
3663 status:
3664 $ref: "#/components/schemas/StatusOK"
3665 data:
3666 $ref: "#/components/schemas/WebAuthnAuthenticator"
3667 meta:
3668 type: object
3669 properties:
3670 recovery_codes_generated:
3671 type: boolean
3672 description: |
3673 Whether or not recovery codes where generated automatically.
3674 required:
3675 - status
3676 - data
3677 - meta