PATCH/admin/v1/users/{userId}

Update a user

Updates specified user.

path parameters

  • userId

    string

    Required

    The identifier of the user.

query parameters

  • allowMissing

    boolean

    If set to true, and the user is not found, a new user will be created.

    You must use the unique identifier for the identifier when this is true.

body parameters

  • uniqueId

    string

    The client defined unique identifier of the user account.

    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 usr_ are reserved.

  • displayName

    string

    The human-readable display name of the user.

    The maximum length is 200 characters.

  • email

    string

    The email address of the user.

    The maximum length is 320 characters.

  • 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.

    The maximum length is 2000 characters.

  • 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 billing address for the user.

  • signupTime

    date-time

    The sign-up time for the user.

  • disabled

    boolean

    Whether the user is disabled.

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 billing 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 \
  -H "Authorization: Bearer $ADMIN_API_KEY" \
  -X PATCH \
  --json '{
    "uniqueId": "jane",
    "displayName": "Jane Smith"
  }'
Response bodyJSON
{
  "id": "usr_MKFxzgJaAH8JQ4",
  "state": "ACTIVE",
  "uniqueId": "jane",
  "displayName": "Jane Smith",
  "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": "New York",
    "postalCode": "11222",
    "country": "US"
  },
  "accountConnections": [],
  "subscription": null,
  "memberships": [],
  "signupTime": "2024-06-15T13:00:00Z",
  "createTime": "2024-06-15T13:00:00Z",
  "updateTime": "2024-06-15T13:00:00Z"
}
PreviousGet a user
NextDelete a user

Turn users intorevenue
$

Subscribe to monthly product updates

© 2024 UserHub

Integrations

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