Unlink Account

Remove an OAuth provider account from the current user.

Unlink Account

Removes an OAuth provider account link from the currently authenticated user.

Endpoint

POST /auth/accounts/{id}/unlink

This is a protected route that requires an active session.

Request

The account ID is passed as a path parameter. No request body is required.

Response

Returns a JSON object on success:

{
  "success": true
}

On success, the server returns HTTP 204 No Content.

Behavior

  • The OAuth provider link is removed from the user's account
  • The account record is deleted from the database
Last auth method protection

Unlinking the last remaining authentication method is not allowed. This ensures users cannot lock themselves out of their accounts.

Errors

StatusDescription
400Cannot unlink last auth method (would lock out user)
401No active session or invalid session
404Account not found or does not belong to current user

On this page