POST/admin/v1/organizations/{organizationId}:disconnect

Disconnect external account

Disconnect specified organization 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

  • organizationId

    string

    Required

    The organization 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 organization.

  • state

    enum

    The current state of the organization.

    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 organization account.

  • displayName

    string

    The human-readable display name of the organization.

  • email

    string

    The email address of the organization.

  • emailVerified

    boolean

    Whether the organization's email address has been verified.

  • phoneNumber

    string

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

  • phoneNumberVerified

    boolean

    Whether the organization's phone number has been verified.

  • imageUrl

    string

    The photo/avatar URL of the organization.

  • currencyCode

    string

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

  • languageCode

    string

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

  • regionCode

    string

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

  • timeZone

    string

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

  • address

    Address

    The address for the organization.

  • accountConnections

    AccountConnection[]

    The connected accounts.

  • subscription

    AccountSubscription

    The organization's default active subscription.

  • signupTime

    date-time

    The sign-up time for the organization.

  • memberCount

    int32

    The number of members in the organization.

    This includes disabled users, but does not include user's marked for deletion.

  • disabled

    boolean

    Whether the organization is disabled.

  • createTime

    date-time

    The creation time of the organization.

  • updateTime

    date-time

    The last update time of the organization.

curl https://api.userhub.com/admin/v1/organizations/org_28seyVGVL1got6:disconnect \
  -H "Authorization: Bearer $ADMIN_API_KEY" \
  --json '{
    "connectionId": "conn_4HdRKnTvPmmjYK"
  }'
Response bodyJSON
{
  "id": "org_28seyVGVL1got6",
  "state": "ACTIVE",
  "displayName": "Acme Inc",
  "email": "[email protected]",
  "emailVerified": true,
  "imageUrl": "https://example.com/acme.jpg",
  "address": null,
  "accountConnections": [],
  "subscription": null,
  "signupTime": "2024-06-15T13:00:00Z",
  "memberCount": 0,
  "createTime": "2024-06-15T13:00:00Z",
  "updateTime": "2024-06-15T13:00:00Z"
}
PreviousConnect external account
NextList members

Turn users intorevenue
$

Subscribe to monthly product updates

© 2024 UserHub

Integrations

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