Auth

Delete User Account

Changed on

Delete the current user's account and all associated data.

Always: deletes API keys, user record (cascades: wallet_links, chats, etc.). Cognito: only in production (ENVIRONMENT in production|prod|prd) do we delete the Cognito user. In dev/test/non-prod we leave the Cognito identity intact so "Delete account" in TEST cannot accidentally nuke the user's real identity.

Requires JWT Bearer authentication.

delete/api/v1/auth/register

Request

  • The document declares no server URL.
  • Auth
    • OAuth 2
      Authorization codehttps://auth.mor.org/oauth2/authorize
      Token URLhttps://auth.mor.org/oauth2/token
      Scopesaws.cognito.signin.user.admin, openid, email, profile
    • or HTTP bearer

Response

Successful Response

messagestring required
deleted_dataobject required
cognito_deletionobject required
user_idinteger required
deleted_atstring date-time required

Example response

{
  "cognito_deletion": {
    "cognito_user_id": "abc123-def456-ghi789",
    "message": "User successfully deleted from Cognito",
    "success": true
  },
  "deleted_at": "2024-01-01T12:00:00Z",
  "deleted_data": {
    "api_keys": 3,
    "automation_settings": true,
    "delegations": 0,
    "private_key": true,
    "sessions": 2
  },
  "message": "User account successfully deleted",
  "user_id": 123
}

Changes