Docs/Admin API/Users/Import account

Import external user

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

Import user from external identity provider if they don't already exist. If the user already exists in UserHub, this is a no-op.

path parameters

  • userId

    string

    Required

    The identifier of the user.

    This must be in the format <externalId>@<connectionId> where externalId is the identity provider user identifier and and connectionId is the User Provider connection identifier.

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/auth0%7C123456789@conn_26yEiYymqy6ZmG:import \
  -H "Authorization: Bearer $USERHUB_ADMIN_KEY" \
  -X POST
Response bodyJSON
{
  "id": "usr_MKFxzgJaAH8JQ4",
  "state": "ACTIVE",
  "displayName": "Jane Doe",
  "email": "[email protected]",
  "emailVerified": false,
  "address": null,
  "accountConnections": [
    {
      "connection": {
        "id": "conn_26yEiYymqy6ZmG",
        "displayName": "Auth0",
        "state": "ACTIVE",
        "type": "AUTH0",
        "delegate": null,
        "providers": [],
        "createTime": "2024-11-15T13:00:00Z",
        "updateTime": "2024-11-15T13:00:00Z"
      },
      "externalId": "auth0|123456789",
      "adminUrl": "https://manage.auth0.com/dashboard/us/test/users/auth0%7C123456789",
      "state": "ACTIVE",
      "displayName": "Jane Doe",
      "email": "[email protected]",
      "emailVerified": false,
      "paymentMethods": [],
      "pullTime": "2024-11-15T13:00:00Z",
      "pushTime": null,
      "createTime": "2024-11-15T13:00:00Z",
      "updateTime": "2024-11-15T13:00:00Z"
    }
  ],
  "subscription": null,
  "memberships": [],
  "signupTime": "2024-11-15T13:00:00Z",
  "createTime": "2024-11-15T13:00:00Z",
  "updateTime": "2024-11-15T13:00:00Z"
}
PreviousDisconnect external account
NextCreate API session

Build software thatmonetizes
$

Subscribe to monthly product updates

© 2025 UserHub

Integrations

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