django-allauth: Headless API (1)

Download OpenAPI specification:

E-mail: info@allauth.org License: MIT

Introduction

Welcome to the django-allauth API specification. This API is intended to be consumed by two different kind of clients:

  • Web applications running in a browser context. For example, a single-page React application, to which the end user can navigate using a web browser.

  • Applications, apps for short, executing in non-browser contexts. For example, a mobile Android or iOS application.

The security considerations for these two usage types are different. In a browser context, cookies play a role. Without taking special precautions, your web application may be vulnerable to Cross-Site Request Forgery attacks. For mobile applications, this does not apply.

The API can be used for both use cases. Differences in handling of security is automatically adjusted for, based on the request path used to make the API call. For example, signing up can either be done using the /_allauth/browser/v1/auth/signup or the /_allauth/app/v1/auth/signup endpoint. For the browser usage, session cookies and CSRF protection applies. For the app usage, cookies play no role, instead, a session token is used. The paths of all endpoints are documented in the form of /_allauth/{client}/v1/auth/signup. Depending on the client type ({client}), there may be slight differences in request/response handling. This is documented where applicable.

Scope

The following functionality is all in scope and handled as part of this API:

  • Regular accounts:
    • Login
    • Signup
    • Password forgotten
    • Manage email (add, remove, verify, select a different primary)
    • Change password.
    • Verification of email addresses.
  • Two-Factor Authentication:
    • Authentication using an authenticator code
    • (De)activate TOTP
    • (Re)generate recovery codes
    • "Trust this browser"
  • Third-party providers:
    • Authenticate by performing a browser-level redirect (synchronous request).
    • Authenticate by means of a provider token.
    • Connect additional provider accounts.
    • Disconnect existing provider accounts.
    • Setting a password in case no password was set, yet.
    • Querying additional information before signing up.
  • Session management:
    • Listing all sessions for a user.
    • Signing out of any of those sessions.

Browser Usage

For web applications running in a browser, routing needs to be setup correctly such that the sessions initiated at the backend are accessible in the frontend.

Routing

When using the API in a browser context, regular Django sessions are used, along with the usual session cookies. There are several options for setting up the routing of your application.

Single Domain Routing

With single domain, path-based routing, both your frontend and backend are served from the same domain, for example https://app.org. You will have to make sure that some paths are served by the frontend, and others by the backend.

Sub-domain Routing

With sub-domain based routing, the frontend and backend are served from different domains. However, as session cookies are used, these different domains must share common main domain.

For example, you may use app.project.org for the frontend, which interfaces with the backend over at backend.project.org. In this setup, Django will need to be configured with:

SESSION_COOKIE_DOMAIN = "project.org"
CSRF_COOKIE_DOMAIN = "project.org"

If your organization hosts unrelated applications, for example, a CMS for marketing purposes, on the top level domain (project.org), it is not advisable to set the session cookie domain to project.org, as those other applications could get access to the session cookie. In that case, it is advised to use backend.app.project.org for the backend, and set the session cookie domain to app.project.org.

App Usage

For app based usage, cookies play no role, yet, sessions are still used. When a user walks through the authentication flow, a session is created. Having an authenticated session is proof that the user is allowed to further interact with the backend. Unauthenticated sessions are also needed to remember state while the user proceeds to go over the required steps necessary to authenticate.

Session Tokens

Given that there is no cookie to point to the session, the header X-Session-Token is used instead. The way of working is as follows:

  • If you do not have a session token yet, do not send the X-Session-Token header.

  • When making requests, session tokens can appear in the metadata (meta.session_token) of authentication related responses. If a session token appears, store it (overwriting any previous session token), and ensure to add the token to the X-Session-Token header of all subsequent requests.

  • When receiving an authentication related response with status code 410 (Gone), that is meant to indicate that the session is no longer valid. Remove the session token and start clean.

Access Tokens

While session tokens are required to handle the authentication process, depending on your requirements, a different type of token may be needed once authenticated.

For example, your app likely needs access to other APIs as well. These APIs may even be implemented using different technologies, in which case having a stateless token, possibly a JWT encoding the user ID, might be a good fit.

In this API and its implementation no assumptions, and no (limiting) design decisions are made in this regard. The token strategy of django-allauth is pluggable, such that you can expose your own access token when the user authenticates. As for as the API specification is concerned, the access token will appear in the response of metadata (meta.access_token) of a successful authentication request. How you can customize the token strategy can be found over at the documentation of the allauth.headless Django application.

Responses

Unless documented otherwise, responses are objects with the following properties:

  • The status, matching the HTTP status code.
  • Data, if any, is returned as part of the data key.
  • Metadata, if any, is returned as part of the meta key.
  • Errors, if any, are listed in the errors key.

Authentication Flows

In order to become authenticated, the user must complete a flow, potentially consisting of several steps. For example:

  • A login, after which the user is authenticated.
  • A Login, followed by two-factor authentication, after which the user is authenticated.
  • A signup, followed by mandatory email verification, after which the user is authenticated.

The API signals to the client that (re)authentication is required by means of a 401 or 410 status code:

  • Not authenticated: status 401.
  • Re-authentication required: status 401, with meta.is_authenticated = true.
  • Invalid session: status 410. This only occurs for clients of type app.

All authentication related responses have status 401 or 410, and, meta.is_authenticated indicating whether authentication, or re-authentication is required.

The flows the client can perform to initiate or complete the authentication are communicates as part of authentication related responses. The authentication can be initiated by means of these flows:

  • Login using a local account (login).
  • Signup for a local account (signup).
  • Login or signup using the third-party provider redirect flow (provider_redirect).
  • Login or signup by handing over a third-party provider retrieved elsewhere (provider_token).
  • Login using a special code (login_by_code).
  • Login using a passkey (mfa_login_webauthn).
  • Signup using a passkey (mfa_signup_webauthn).

Depending on the state of the account, and the configuration of django-allauth, the flows above can either lead to becoming directly authenticated, or, to followup flows:

  • Provider signup (provider_signup).
  • Email verification (verify_email).
  • Phone verification (phone_email).
  • Two-factor authentication required (TOTP, recovery codes, or WebAuthn) (mfa_authenticate).
  • Trust this browser (mfa_trust).

While authenticated, re-authentication may be required to safeguard the account when sensitive actions are performed. The re-authentication flows are the following:

  • Re-authenticate using password (reauthenticate).
  • Re-authenticate using a 2FA authenticator (TOTP, recovery codes, or WebAuthn) (mfa_reauthenticate).

Security Considerations

Input Sanitization

The Django framework, by design, does not perform input sanitization. For example, there is nothing preventing end users from signing up using <script> or Robert'); DROP TABLE students as a first name. Django relies on its template language for proper escaping of such values and mitigate any XSS attacks.

As a result, any allauth.headless client must have proper XSS protection in place as well. Be prepared that, for example, the WebAuthn endpoints could return authenticator names as follows:

{
  "name": "<script>alert(1)</script>",
  "credential": {
    "type": "public-key",
    ...
  }
}

Configuration

Exposes information on the configuration of django-allauth.

Get configuration

There are many configuration options that alter the functionality and behavior of django-allauth, some of which can also impact the frontend. Therefore, relevant configuration options are exposed via this endpoint. The data returned is not user/authentication dependent. Hence, it suffices to only fetch this data once at boot time of your application.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "status": 200
}

Authentication: Current Session

Logout

Logs out the user from the current session.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    },
  • "status": 401
}

Get authentication status

Retrieve information about the authentication status for the current session.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    },
  • "status": 200
}

Authentication: Account

All functionality related towards authenticating regular username/email-password based accounts.

Get email verification information

Obtain email verification information, given the token that was sent to the user by email.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Email-Verification-Key
required
string

The email verification key

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    },
  • "status": 200
}

Verify an email

Complete the email verification process. Depending on the configuration, email addresses are either verified by opening a link that is sent to their email address, or, by inputting a code that is sent. On the API, both cases are handled identically. Meaning, the required key is either the one from the link, or, the code itself.

Note that a status code of 401 does not imply failure. It indicates that the email verification was successful, yet, the user is still not signed in. For example, in case ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION is set to False, a 401 is returned when verifying as part of login/signup.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Request Body schema: application/json
key
required
string

The email verification key

Responses

Request samples

Content type
application/json
{
  • "key": "2f-c4nqd4-e07d9bc694f9f28cd4fe92569d495333"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    },
  • "status": 200
}

Resend email verification code

Requests a new email verification code. Requires ACCOUNT_EMAIL_VERIFICATION_SUPPORTS_RESEND = True.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Responses

Response samples

Content type
application/json
{
  • "status": 200
}

Login

Login using a username-password or email-password combination.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

Request Body schema: application/json
required

Login.

Any of
username
required
string (Username)

The username.

password
required
string (Password)

The password.

Responses

Request samples

Content type
application/json
Example
{
  • "username": "wizard",
  • "password": "Alohomora!"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    },
  • "status": 200
}

Verify a phone number

Complete the phone number verification process. Note that a status code of 401 does not imply failure. It merely indicates that the phone number verification was successful, yet, the user is still not signed in.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Request Body schema: application/json
code
required
string

The phone verification code

Responses

Request samples

Content type
application/json
{
  • "code": "4S3H82"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    },
  • "status": 200
}

Resend phone number verification code

Requests a new phone number verification code. Requires ACCOUNT_PHONE_VERIFICATION_SUPPORTS_RESEND = True.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Responses

Response samples

Content type
application/json
{
  • "status": 200
}

Reauthenticate

In order to safeguard the account, some actions require the user to be recently authenticated. If you try to perform such an action without having been recently authenticated, a 401 status is returned, listing flows that can be performed to reauthenticate. One such flow is the flow with ID reauthenticate, which allows for the user to input the password. This is the endpoint related towards that flow.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Request Body schema: application/json
required

Reauthenticate.

password
required
string (Password)

The password.

Responses

Request samples

Content type
application/json
{
  • "password": "Alohomora!"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    },
  • "status": 200
}

Signup

Whether or not username, email, phone or combination of those are required depends on the configuration of django-allauth. Additionally, if a custom signup form is used there may be other custom properties required.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

Request Body schema: application/json
required

Signup

email
required
string (Email)

The email address.

username
required
string (Username)

The username.

password
required
string (Password)

The password.

Responses

Request samples

Content type
application/json
{
  • "email": "email@domain.org",
  • "username": "wizard",
  • "password": "Alohomora!"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    },
  • "status": 200
}

Authentication: Password Reset

Request password

Initiates the password reset procedure. Depending on whether or not ACCOUNT_PASSWORD_RESET_BY_CODE_ENABLED is True, the procedure is either stateless or stateful.

In case codes are used, it is stateful, and a new password_reset_by_code flow is started. In this case, on a successful password reset request, you will receive a 401 indicating the pending status of this flow.

In case password reset is configured to use (stateless) links, you will receive a 200 on a successful password reset request.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

Request Body schema: application/json
required

Request password.

email
required
string (Email)

The email address.

Responses

Request samples

Content type
application/json
{
  • "email": "email@domain.org"
}

Response samples

Content type
application/json
{
  • "status": 200
}

Get password reset information

Used to obtain information on and validate a password reset key. The key passed is either the key encoded in the password reset URL that the user has received per email, or, the password reset code in case of ACCOUNT_PASSWORD_RESET_BY_CODE_ENABLED. Note that in case of a code, the number of requests you can make is limited (by ACCOUNT_PASSWORD_RESET_BY_CODE_MAX_ATTEMPTS).

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Password-Reset-Key
required
string

The password reset key

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "status": 200
}

Reset password

Perform the password reset, by handing over the password reset key and the new password. After successfully completing the password reset, the user is either logged in (in case ACCOUNT_LOGIN_ON_PASSWORD_RESET is True), or, the user will need to proceed to the login page. In case of the former, a 200 status code is returned, in case of the latter a 401.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

Request Body schema: application/json
key
required
string

The password reset key

password
required
string (Password)

The password.

Responses

Request samples

Content type
application/json
{
  • "key": "2f-c4nqd4-e07d9bc694f9f28cd4fe92569d495333",
  • "password": "Alohomora!"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    },
  • "status": 200
}

Authentication: Providers

Provider redirect

Initiates the third-party provider authentication redirect flow. As calling this endpoint results in a user facing redirect (302), this call is only available in a browser, and must be called in a synchronous (non-XHR) manner.

Request Body schema: application/x-www-form-urlencoded
required

Initiate the provider redirect flow.

callback_url
required
string

The URL to return to after the redirect flow is complete.

Note that this is not to be mistaken with the callback URL that you configure over at the OAuth provider during the OAuth app/client setup. The flow is as follows:

  1. Your frontend redirects to the headless provider redirect endpoint in a synchronous (non-XHR) manner, informing allauth (by means of callback_url) where to redirect to after the provider handshake is completed.

  2. Headless will redirect to the (OAuth) identity provider to initiate the handshake, passing along a different callback URL to the provider: one that points to an allauth backend URL. This is the URL that you need to have setup at your OAuth app/client configuration. Note that this must be a backend URL as providers can use POST requests to perform their callbacks, which is something a frontend would not be able to handle.

  3. After the authorization at the provider is completed, the provider redirects to the backend allauth callback URL, which will then redirect back to the frontend callback URL.

  4. Your frontend is now expected to fetch the current session to determine what the next course of action is. The user could be authenticated at this point, or another flow is pending (e.g. email verification, or, provider signup). In case of errors a ?error= is passed to the frontend callback URL.

process
required
string (Process)
Enum: "login" "connect"

The process to be executed when the user successfully authenticates. When set to login, the user will be logged into the account to which the provider account is connected, or if no such account exists, a signup will occur. If set to connect, the provider account will be connected to the list of provider accounts for the currently authenticated user.

provider
required
string (ProviderID)

The provider ID.

Responses

Provider signup information

If, while signing up using a third-party provider account, there is insufficient information received from the provider to automatically complete the signup process, an additional step is needed to complete the missing data before the user is fully signed up and authenticated. The information available so far, such as the pending provider account, can be retrieved via this endpoint.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "status": 200
}

Provider signup

If, while signing up using a third-party provider account, there is insufficient information received from the provider to automatically complete the signup process, an additional step is needed to complete the missing data before the user is fully signed up and authenticated.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

Request Body schema: application/json
required

Provider signup.

email
required
string (Email)

The email address.

username
required
string (Username)

The username.

Responses

Request samples

Content type
application/json
{
  • "email": "email@domain.org",
  • "username": "wizard"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    },
  • "status": 200
}

Provider token

Authenticates with a third-party provider using provider tokens received by other means. For example, in case of a mobile app, the authentication flow runs completely on the device itself, without any interaction with the API. Then, when the (device) authentication completes and the mobile app receives an access and/or ID token, it can hand over these tokens via this endpoint to authenticate on the server.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Request Body schema: application/json
required
process
required
string (Process)
Enum: "login" "connect"

The process to be executed when the user successfully authenticates. When set to login, the user will be logged into the account to which the provider account is connected, or if no such account exists, a signup will occur. If set to connect, the provider account will be connected to the list of provider accounts for the currently authenticated user.

provider
required
string (ProviderID)

The provider ID.

required
object

The token.

Responses

Request samples

Content type
application/json
{
  • "process": "login",
  • "provider": "google",
  • "token": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    },
  • "status": 200
}

Authentication: Login By Code

Confirm login code

Use this endpoint to pass along the received "special" login code.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

Request Body schema: application/json
required
code
required
string (Code)

An one-time code.

Responses

Request samples

Content type
application/json
{
  • "code": "NQ3TM5"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "meta": {
    },
  • "status": 200
}

Request login code

Request a "special" login code that is sent to the user by email.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

Request Body schema: application/json
required

Request a login code.

Any of
phone
required
string (Phone)

The phone number.

Responses

Request samples

Content type
application/json
Example
{
  • "phone": "+314159265359"
}

Response samples

Content type
application/json
{
  • "errors": [
    ],
  • "status": 400
}

Resend login code

Requests a new login code. Requires ACCOUNT_LOGIN_BY_CODE_SUPPORTS_RESEND = True.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Responses

Response samples

Content type
application/json
{
  • "status": 200
}

Account: Email

The API used for manipulating the email addresses attached to a given account. This is intentionally modeled as one endpoint, representing the collection of all the email addresses. Note that manipulating one email address may affect another. For example, marking one email address as primary implies the previous primary email address is changed as well. Also, if django-allauth is configured with ACCOUNT_CHANGE_EMAIL = True, verifying the email address the user is changing to will cause the previous email addres to be removed.

Remove an email address

Used to remove an email address.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Request Body schema: application/json
email
required
string (Email)

The email address.

Responses

Request samples

Content type
application/json
{
  • "email": "email@domain.org"
}

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "status": 200
}

List email addresses

Retrieves the list of email addresses of the account.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "status": 200
}

Change primary email address

Used to change primary email address to a different one. Note that only verified email addresses can be marked as primary.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Request Body schema: application/json
email
required
string

An email address.

primary
required
boolean
Value: true

Primary flag.

Responses

Request samples

Content type
application/json
{
  • "email": "email@domain.org",
  • "primary": true
}

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "status": 200
}

Add/Change email address

The following functionality is available:

  • Adding a new email address for an already signed in user (ACCOUNT_CHANGE_EMAIL = False).
  • Change to a new email address for an already signed in user (ACCOUNT_CHANGE_EMAIL = True).
  • Change to a new email address during the email verification process at signup (ACCOUNT_EMAIL_VERIFICATION_SUPPORTS_CHANGE = True).

In all cases, an email verification mail will be sent containing a link or code that needs to be verified.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Request Body schema: application/json
email
required
string (Email)

The email address.

Responses

Request samples

Content type
application/json
{
  • "email": "email@domain.org"
}

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "status": 200
}

Request email verification

Requests for (another) email verification email to be sent. Note that sending emails is rate limited, so when you send too many requests the email will not be sent.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Request Body schema: application/json
email
required
string (Email)

The email address.

Responses

Request samples

Content type
application/json
{
  • "email": "email@domain.org"
}

Response samples

Content type
application/json
{
  • "status": 200
}

Account: Password

Endpoints that can be used to alter the password for a given account.

Change password

In order to change the password of an account, the current and new password must be provider. However, accounts that were created by signing up using a third-party provider do not have a password set. In that case, the current password is not required.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Request Body schema: application/json
current_password
string (Password)

The password.

new_password
required
string

The current password.

Responses

Request samples

Content type
application/json
{
  • "current_password": "Alohomora!",
  • "new_password": "Aberto!"
}

Response samples

Content type
application/json
{
  • "errors": [
    ],
  • "status": 400
}

Account: Phone

The API used for manipulating the phone number attached to a given account.

Get the phone number

Retrieves the phone number of the account, if any. Note that while the endpoint returns a list of phone numbers, at most one entry is returned.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "status": 200
}

Change the phone number

The following functionality is available:

  • Initiate the phone number change process for signed in users.
  • Change to a new phone number during the phone number verification process at signup for unauthenticated users. Note that this requires: ACCOUNT_PHONE_VERIFICATION_SUPPORTS_CHANGE = True.

In both cases, after posting a new phone number, proceed with the phone verification endpoint to confirm the change of the phone number by posting the verification code.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Request Body schema: application/json
phone
required
string

Responses

Request samples

Content type
application/json
{
  • "phone": "+314159265359"
}

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "status": 202
}

Account: Providers

Management of third-party provider accounts that are connected to the authenticated account.

Disconnect a third-party provider account

Disconnect a third-party provider account, returning the remaining accounts that are still connected. The disconnect is not allowed if it would leave the account unusable. For example, if no password was set up yet.

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Request Body schema: application/json
account
required
string (ProviderAccountID)

The provider specific account ID.

provider
required
string (ProviderID)

The provider ID.

Responses

Request samples

Content type
application/json
{
  • "account": "goo12345",
  • "provider": "google"
}

Response samples

Content type
application/json
{}

List the connected third-party provider accounts

path Parameters
client
required
string
Enum: "app" "browser"

The type of client accessing the API.

header Parameters
X-Session-Token
string

Session token. Only needed when client is equal to app.

Responses

Response samples

Content type
application/json
{}

Tokens

Refresh the access token

Used to retrieve a new access token. Depending on settings.HEADLESS_JWT_ROTATE_REFRESH_TOKEN, a new refresh token is returned as well.

Request Body schema: application/json
refresh_token
required
string (RefreshToken)

The refresh token.

Responses

Request samples

Content type
application/json
{
  • "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.QV30"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "status": 200
}