Update a user's external account.
Update an external account
PreviewPATCH
/admin/v1/users/{userId}:updateConnectionbody parameters
Returns
curl https://api.userhub.com/admin/v1/users/usr_MKFxzgJaAH8JQ4:updateConnection \
-H "Authorization: Bearer $USERHUB_ADMIN_KEY" \
-X PATCH \
--json '{
"connectionId": "conn_4HdRKnTvPmmjYK",
"displayName": "Jane Doe"
}'
const res = await adminApi.users.updateConnection(
"usr_MKFxzgJaAH8JQ4",
{
connectionId: "conn_4HdRKnTvPmmjYK",
displayName: "Jane Doe",
},
);
res, err := adminApi.Users().UpdateConnection(
context.Background(),
"usr_MKFxzgJaAH8JQ4",
&adminapi.UserUpdateConnectionInput{
ConnectionId: "conn_4HdRKnTvPmmjYK",
DisplayName: adminapi.Some[string]("Jane Doe"),
},
)
$res = $adminApi->users->updateConnection(
userId: 'usr_MKFxzgJaAH8JQ4',
connectionId: 'conn_4HdRKnTvPmmjYK',
displayName: 'Jane Doe',
);
res = admin_api.users.update_connection(
user_id="usr_MKFxzgJaAH8JQ4",
connection_id="conn_4HdRKnTvPmmjYK",
display_name="Jane Doe",
)
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": [
{
"connection": {
"id": "conn_4HdRKnTvPmmjYK",
"displayName": "Stripe",
"state": "ACTIVE",
"type": "STRIPE",
"providers": [],
"view": "BASIC",
"createTime": "2025-05-15T13:00:00Z",
"updateTime": "2025-05-15T13:00:00Z"
},
"externalId": "cus_Fn7PABWZFFso",
"adminUrl": "https://dashboard.stripe.com/test/customers/cus_Fn7PABWZFFso",
"state": "ACTIVE",
"displayName": "Jane Doe",
"currencyCode": "USD",
"balanceAmount": "0",
"paymentMethods": [],
"createTime": "2025-05-15T13:00:00Z",
"updateTime": "2025-05-15T13:00:00Z"
}
],
"memberships": [],
"signupTime": "2025-05-15T13:00:00Z",
"view": "FULL",
"createTime": "2025-05-15T13:00:00Z",
"updateTime": "2025-05-15T13:00:00Z"
}