Docs/Admin API/Users/Disconnect

Disconnect external account

POST/admin/v1/users/{userId}:disconnect

Disconnect specified user from external account. This will delete all the data associated with the connected account, including payment methods, invoices, and subscriptions. If the delete external account option is enabled it will also attempt to delete the external account (e.g. Stripe Customer object). WARNING: This can irreversibly destroy data and should be used with extreme caution.

path parameters

  • userId

    string

    Required

    The user identifier.

body parameters

  • connectionId

    string

    Required

    The identifier of the connection.

  • deleteExternalAccount

    boolean

    Whether to attempt to delete the external account and all it's associated data (e.g. Stripe Customer object).

Returns

  • id

    string

    The system-assigned identifier of the user.

  • state

    enum

    The current state of the user.

    Possible values:
    ACTIVEDISABLEDARCHIVEDPENDING_DELETION
  • stateReason

    string

    The code that best describes the reason for the state.

  • uniqueId

    string

    The client defined unique identifier of the user account.

  • displayName

    string

    The human-readable display name of the user.

  • email

    string

    The email address of the user.

  • emailVerified

    boolean

    Whether the user's email address has been verified.

  • phoneNumber

    string

    The E164 phone number for the user (e.g. +12125550123).

  • phoneNumberVerified

    boolean

    Whether the user's phone number has been verified.

  • imageUrl

    string

    The photo/avatar URL of the user.

  • currencyCode

    string

    The default ISO-4217 currency code for the user (e.g. USD).

  • languageCode

    string

    The IETF BCP-47 language code for the user (e.g. en).

  • regionCode

    string

    The country/region code for the user (e.g. US).

  • timeZone

    string

    The IANA time zone for the user (e.g. America/New_York).

  • address

    Address

    The default address for the user.

  • accountConnections

    AccountConnection[]

    The connected accounts.

  • subscription

    AccountSubscription

    The user's default active individual subscription.

    See memberships for organization subscription and seat information.

  • memberships

    Membership[]

    The user's organization memberships.

  • signupTime

    date-time

    The sign-up time for the user.

  • disabled

    boolean

    Whether the user is disabled.

  • createTime

    date-time

    The creation time of the user.

  • updateTime

    date-time

    The last update time of the user.

curl https://api.userhub.com/admin/v1/users/usr_MKFxzgJaAH8JQ4:disconnect \
  -H "Authorization: Bearer $USERHUB_ADMIN_KEY" \
  --json '{
    "connectionId": "conn_4HdRKnTvPmmjYK"
  }'
Response bodyJSON
{
  "id": "usr_MKFxzgJaAH8JQ4",
  "state": "ACTIVE",
  "displayName": "Jane Doe",
  "email": "[email protected]",
  "emailVerified": true,
  "phoneNumber": "+12125550123",
  "phoneNumberVerified": false,
  "imageUrl": "https://example.com/jane.jpg",
  "currencyCode": "USD",
  "languageCode": "en",
  "regionCode": "US",
  "timeZone": "America/New_York",
  "address": {
    "lines": [
      "42 West St"
    ],
    "city": "Brooklyn",
    "state": "NY",
    "postalCode": "11222",
    "country": "US"
  },
  "accountConnections": [],
  "subscription": null,
  "memberships": [],
  "signupTime": "2024-11-15T13:00:00Z",
  "createTime": "2024-11-15T13:00:00Z",
  "updateTime": "2024-11-15T13:00:00Z"
}
PreviousConnect external account
NextImport external user

Build software thatmonetizes
$

Subscribe to monthly product updates

© 2025 UserHub

Integrations

    UserHub & Auth0UserHub & Stripe BillingUserHub & Google CloudUserHub & FirebaseUserHub & custom auth