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.
body parametersconnectionId
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 200 Error
The system-assigned identifier of the user.
The current state of the user.
Possible values: ACTIVE
DISABLED
ARCHIVED
PENDING_DELETION
The code that best describes the reason for the state.
The client defined unique identifier of the user account.
The human-readable display name of the user.
The email address of the user.
Whether the user's email address has been verified.
The E164 phone number for the user (e.g. +12125550123
).
phoneNumberVerified
boolean
Whether the user's phone number has been verified.
The photo/avatar URL of the user.
The default ISO-4217 currency code for the user (e.g. USD
).
The IETF BCP-47 language code for the user (e.g. en
).
The country/region code for the user (e.g. US
).
The IANA time zone for the user (e.g. America/New_York
).
The default address for the user.
Show propertiesThe city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
accountConnections
AccountConnection[]
Show properties Show propertiesThe system-assigned identifier of the connection.
The client defined unique identifier of the connection.
It is restricted to letters, numbers, underscores, and hyphens, with the first character a letter or a number, and a 255 character maximum.
ID's starting with conn_
are reserved.
The human-readable display name of the connection.
The maximum length is 200 characters.
The current status of the connection.
Possible values: PENDING_SETUP
ACTIVE
BROKEN
DISABLED
ARCHIVED
The code that best describes the reason for the state.
Possible values: AMAZON_COGNITO
AUTH0
BUILTIN_EMAIL
CUSTOM_USERS
GOOGLE_CLOUD_IDENTITY_PLATFORM
POSTMARK
STRIPE
WEBHOOK
delegate
ConnectionDelegate
The delegated connection.
Show propertiesThe delegated connection identifier.
The client defined unique identifier of the delegated connection.
The human-readable display name of the delegated connection.
The current status of the delegated connection.
Possible values: PENDING_SETUP
ACTIVE
BROKEN
DISABLED
ARCHIVED
The code that best describes the reason for the state.
The delegated connection type.
Possible values: AMAZON_COGNITO
AUTH0
BUILTIN_EMAIL
CUSTOM_USERS
GOOGLE_CLOUD_IDENTITY_PLATFORM
POSTMARK
STRIPE
WEBHOOK
providers
ConnectionProvider[]
The connection providers.
Show propertiesPossible values: ACCOUNT
BILLING
EMAIL
USER
Whether the connection is the default for the provider type.
The creation time of the connection.
The last update time of the connection.
amazonCognito
AmazonCognitoConnection
The Amazon Cognito connection data.
Show propertiesThe Amazon Cognito user pool ID.
The Amazon access key ID.
The Amazon access key secret.
OpenID Connect (OIDC) configuration.
If configured, this can be used instead of implementing a Portal callback.
The Auth0 connection data.
Show propertiesOpenID Connect (OIDC) configuration.
If configured, this can be used instead of implementing a Portal callback.
builtinEmail
BuiltinEmailConnection
The builtin email configuration data.
The Google Cloud Identity Platform (Firebase Auth) connection.
Show propertiesThe service account key in JSON format.
The Google Cloud Identity Platform/Firebase project ID.
This will default to the project ID in the service account key if not specified.
postmark
PostmarkConnection
The Postmark configuration data.
Show propertiesThe Postmark server token (e.g. 942faf79-bf10-4dc1-830a-dc7943f43f35
).
The Postmark server ID.
This is automatically populated when the server token is updated.
The from email address.
The Postmark account must be allowed to send from this email address.
Show propertiesThe email name (e.g. Jane Doe
).
The reply to email address.
Show propertiesThe email name (e.g. Jane Doe
).
The Stripe billing configuration data.
Show propertiesThe Stripe account ID (e.g. acct_1LcUvxQYGbxD2SPK
)
The live vs test status for the Stripe account.
The webhooks configuration data.
Show propertiesThe URL of the events webhook.
The headers sent with requests to the connection URL.
signingSecrets
SigningSecret[]
Show propertiesThe signing secret value.
The time the signing secret is set to expire.
The external identifier of the connected account.
The external admin URL for the connected account.
The status of the connected account.
Possible values: ACTIVE
BROKEN
DISABLED
The code that best describes the reason for the state.
The human-readable display name of the external account.
The email address of the external account.
Whether the external account's email address has been verified.
The E164 phone number for the external account (e.g. +12125550123
).
phoneNumberVerified
boolean
Whether the external account's phone number has been verified.
The billing address for the external account.
Show propertiesThe city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
The currency code for the account.
The balance amount for the account.
A negative value indicates an amount which will be subtracted from the next invoice (credit).
A positive value indicates an amount which will be added to the next invoice (debt).
paymentMethods
PaymentMethod[]
The payment methods for connections that support it.
Show propertiesThe system-assigned identifier of the payment method.
The external identifier of the connected payment method.
The status of the connected payment method.
Possible values: ACTIVE
BROKEN
ARCHIVED
The code that best describes the reason for the state.
Possible values: CARD
UNKNOWN
A human-readable description of the payment method.
This can be used to show a description of the payment method when the type is UNKNOWN or not explicitly handled.
The full name of the owner of the payment method.
The address for the payment method.
Show propertiesThe city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
Whether the payment method is the default for the connected account.
The last payment error.
This will be unset if the payment method is updated or if a payment succeeds.
Show propertiesThe general error code (e.g. INVALID_ARGUMENT
).
Possible values: OK
CANCELLED
UNKNOWN
INVALID_ARGUMENT
DEADLINE_EXCEEDED
NOT_FOUND
ALREADY_EXISTS
PERMISSION_DENIED
UNAUTHENTICATED
RESOURCE_EXHAUSTED
FAILED_PRECONDITION
ABORTED
OUT_OF_RANGE
UNIMPLEMENTED
INTERNAL
UNAVAILABLE
DATA_LOSS
A developer-facing error message.
A reason code for the error (e.g. USER_PENDING_DELETION
).
The parameter path related to the error (e.g. member.userId
).
Additional metadata related to the error.
A user-facing error message.
The last time the payment method was pulled from the connection.
The creation time of the payment method connection.
The last update time of the payment method connection.
Card payment method (e.g. Visa credit card).
Show propertiesThe brand of the card (e.g. VISA
).
Possible values: AMERICAN_EXPRESS
DINERS_CLUB
DISCOVER
JCB
MASTERCARD
UNIONPAY
VISA
The last for digits of the card.
The funding method for the card (e.g. DEBIT
).
Possible values: CREDIT
DEBIT
PREPAID
The last time the account was pulled from the connection.
The last time the account was pushed to the connection.
The creation time of the account connection.
The last update time of the account connection.
subscription
AccountSubscription
The user's default active individual subscription.
See memberships for organization subscription and seat information.
Show propertiesThe system-assigned identifier of the subscription.
The state of the subscription.
Possible values: TRIALING
CHECKOUT_ISSUE
ACTIVE
PAST_DUE
PAUSED
The anchor time of the billing cycle.
plan
AccountSubscriptionPlan
Show propertiesThe identifier of the plan.
The human-readable display name of the plan.
product
AccountSubscriptionProduct
Show propertiesThe system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
The user's organization memberships.
Show properties Show propertiesThe system-assigned identifier of the organization.
The current state of the organization.
Possible values: ACTIVE
DISABLED
ARCHIVED
PENDING_DELETION
The code that best describes the reason for the state.
The client defined unique identifier of the organization account.
The human-readable display name of the organization.
The email address of the organization.
Whether the organization's email address has been verified.
The E164 phone number for the organization (e.g. +12125550123
).
phoneNumberVerified
boolean
Whether the organization's phone number has been verified.
The photo/avatar URL of the organization.
The default ISO-4217 currency code for the organization (e.g. USD
).
The IETF BCP-47 language code for the organization (e.g. en
).
The country/region code for the organization (e.g. US
).
The IANA time zone for the organization (e.g. America/New_York
).
The default address for the organization.
Show propertiesThe city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
accountConnections
AccountConnection[]
Show properties Show propertiesThe system-assigned identifier of the connection.
The client defined unique identifier of the connection.
It is restricted to letters, numbers, underscores, and hyphens, with the first character a letter or a number, and a 255 character maximum.
ID's starting with conn_
are reserved.
The human-readable display name of the connection.
The maximum length is 200 characters.
The current status of the connection.
Possible values: PENDING_SETUP
ACTIVE
BROKEN
DISABLED
ARCHIVED
The code that best describes the reason for the state.
Possible values: AMAZON_COGNITO
AUTH0
BUILTIN_EMAIL
CUSTOM_USERS
GOOGLE_CLOUD_IDENTITY_PLATFORM
POSTMARK
STRIPE
WEBHOOK
delegate
ConnectionDelegate
The delegated connection.
Show propertiesThe delegated connection identifier.
The client defined unique identifier of the delegated connection.
The human-readable display name of the delegated connection.
The current status of the delegated connection.
Possible values: PENDING_SETUP
ACTIVE
BROKEN
DISABLED
ARCHIVED
The code that best describes the reason for the state.
The delegated connection type.
Possible values: AMAZON_COGNITO
AUTH0
BUILTIN_EMAIL
CUSTOM_USERS
GOOGLE_CLOUD_IDENTITY_PLATFORM
POSTMARK
STRIPE
WEBHOOK
providers
ConnectionProvider[]
The connection providers.
Show propertiesPossible values: ACCOUNT
BILLING
EMAIL
USER
Whether the connection is the default for the provider type.
The creation time of the connection.
The last update time of the connection.
amazonCognito
AmazonCognitoConnection
The Amazon Cognito connection data.
Show propertiesThe Amazon Cognito user pool ID.
The Amazon access key ID.
The Amazon access key secret.
OpenID Connect (OIDC) configuration.
If configured, this can be used instead of implementing a Portal callback.
The Auth0 connection data.
Show propertiesOpenID Connect (OIDC) configuration.
If configured, this can be used instead of implementing a Portal callback.
builtinEmail
BuiltinEmailConnection
The builtin email configuration data.
The Google Cloud Identity Platform (Firebase Auth) connection.
Show propertiesThe service account key in JSON format.
The Google Cloud Identity Platform/Firebase project ID.
This will default to the project ID in the service account key if not specified.
postmark
PostmarkConnection
The Postmark configuration data.
Show propertiesThe Postmark server token (e.g. 942faf79-bf10-4dc1-830a-dc7943f43f35
).
The Postmark server ID.
This is automatically populated when the server token is updated.
The from email address.
The Postmark account must be allowed to send from this email address.
Show propertiesThe email name (e.g. Jane Doe
).
The reply to email address.
Show propertiesThe email name (e.g. Jane Doe
).
The Stripe billing configuration data.
Show propertiesThe Stripe account ID (e.g. acct_1LcUvxQYGbxD2SPK
)
The live vs test status for the Stripe account.
The webhooks configuration data.
Show propertiesThe URL of the events webhook.
The headers sent with requests to the connection URL.
signingSecrets
SigningSecret[]
Show propertiesThe signing secret value.
The time the signing secret is set to expire.
The external identifier of the connected account.
The external admin URL for the connected account.
The status of the connected account.
Possible values: ACTIVE
BROKEN
DISABLED
The code that best describes the reason for the state.
The human-readable display name of the external account.
The email address of the external account.
Whether the external account's email address has been verified.
The E164 phone number for the external account (e.g. +12125550123
).
phoneNumberVerified
boolean
Whether the external account's phone number has been verified.
The billing address for the external account.
Show propertiesThe city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
The currency code for the account.
The balance amount for the account.
A negative value indicates an amount which will be subtracted from the next invoice (credit).
A positive value indicates an amount which will be added to the next invoice (debt).
paymentMethods
PaymentMethod[]
The payment methods for connections that support it.
Show propertiesThe system-assigned identifier of the payment method.
The external identifier of the connected payment method.
The status of the connected payment method.
Possible values: ACTIVE
BROKEN
ARCHIVED
The code that best describes the reason for the state.
Possible values: CARD
UNKNOWN
A human-readable description of the payment method.
This can be used to show a description of the payment method when the type is UNKNOWN or not explicitly handled.
The full name of the owner of the payment method.
The address for the payment method.
Show propertiesThe city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
Whether the payment method is the default for the connected account.
The last payment error.
This will be unset if the payment method is updated or if a payment succeeds.
Show propertiesThe general error code (e.g. INVALID_ARGUMENT
).
Possible values: OK
CANCELLED
UNKNOWN
INVALID_ARGUMENT
DEADLINE_EXCEEDED
NOT_FOUND
ALREADY_EXISTS
PERMISSION_DENIED
UNAUTHENTICATED
RESOURCE_EXHAUSTED
FAILED_PRECONDITION
ABORTED
OUT_OF_RANGE
UNIMPLEMENTED
INTERNAL
UNAVAILABLE
DATA_LOSS
A developer-facing error message.
A reason code for the error (e.g. USER_PENDING_DELETION
).
The parameter path related to the error (e.g. member.userId
).
Additional metadata related to the error.
A user-facing error message.
The last time the payment method was pulled from the connection.
The creation time of the payment method connection.
The last update time of the payment method connection.
Card payment method (e.g. Visa credit card).
Show propertiesThe brand of the card (e.g. VISA
).
Possible values: AMERICAN_EXPRESS
DINERS_CLUB
DISCOVER
JCB
MASTERCARD
UNIONPAY
VISA
The last for digits of the card.
The funding method for the card (e.g. DEBIT
).
Possible values: CREDIT
DEBIT
PREPAID
The last time the account was pulled from the connection.
The last time the account was pushed to the connection.
The creation time of the account connection.
The last update time of the account connection.
subscription
AccountSubscription
The organization's default active subscription.
Show propertiesThe system-assigned identifier of the subscription.
The state of the subscription.
Possible values: TRIALING
CHECKOUT_ISSUE
ACTIVE
PAST_DUE
PAUSED
The anchor time of the billing cycle.
plan
AccountSubscriptionPlan
Show propertiesThe identifier of the plan.
The human-readable display name of the plan.
product
AccountSubscriptionProduct
Show propertiesThe system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
The sign-up time for the organization.
The number of members in the organization.
This includes disabled users, but does not include user's marked for deletion.
Whether the organization is disabled.
The creation time of the organization.
The last update time of the organization.
The user's role within the organization.
Show propertiesThe system-assigned identifier of the role.
The client defined unique identifier of the role.
It is restricted to letters, numbers, underscores, and hyphens, with the first character a letter or a number, and a 255 character maximum.
ID's starting with role_
are reserved.
The human-readable display name of the role.
Possible values: OWNER
MEMBER
GUEST
The description of the role.
The maximum length is 1000 characters.
The additional permissions allowed by the role.
Whether the role is the default for the tenant.
The archived status of the role.
The creation time of the role.
The last update time of the role.
seat
AccountSubscriptionSeat
The seat associated with the membership.
This will be absent if there is no active default subscription for the organization or the user has not been assigned a seat.
Show propertiesproduct
AccountSubscriptionProduct
Show propertiesThe system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
The creation time of the membership.
The last update time of the membership.
The sign-up time for the user.
Whether the user is disabled.
The creation time of the user.
The last update time of the user.
The general error code (e.g. INVALID_ARGUMENT
).
Possible values: OK
CANCELLED
UNKNOWN
INVALID_ARGUMENT
DEADLINE_EXCEEDED
NOT_FOUND
ALREADY_EXISTS
PERMISSION_DENIED
UNAUTHENTICATED
RESOURCE_EXHAUSTED
FAILED_PRECONDITION
ABORTED
OUT_OF_RANGE
UNIMPLEMENTED
INTERNAL
UNAVAILABLE
DATA_LOSS
A developer-facing error message.
A reason code for the error (e.g. USER_PENDING_DELETION
).
The parameter path related to the error (e.g. member.userId
).
Additional metadata related to the error.
A user-facing error message.
cURL TypeScript Go PHP Python
curl https://api.userhub.com/admin/v1/users/usr_MKFxzgJaAH8JQ4:disconnect \
-H "Authorization: Bearer $USERHUB_ADMIN_KEY " \
--json '{
"connectionId": "conn_4HdRKnTvPmmjYK"
}'
const res = await adminApi . users . disconnect (
"usr_MKFxzgJaAH8JQ4" ,
{
connectionId : "conn_4HdRKnTvPmmjYK" ,
},
) ;
res , err := adminApi . Users (). Disconnect (
context . Background (),
"usr_MKFxzgJaAH8JQ4" ,
& adminapi . UserDisconnectInput {
ConnectionId : "conn_4HdRKnTvPmmjYK" ,
},
)
$res = $adminApi -> users -> disconnect (
userId : 'usr_MKFxzgJaAH8JQ4' ,
connectionId : 'conn_4HdRKnTvPmmjYK' ,
);
res = admin_api . users . disconnect (
user_id = "usr_MKFxzgJaAH8JQ4" ,
connection_id = "conn_4HdRKnTvPmmjYK" ,
)
Response body JSON
{
" 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"
}