/v1/apps/{app_id}/end-users/{user_id}AuthUpdate end-user display name, primary email, or metadata keys (merged).
Path parameters
app_id*stringId of the app.
user_id*stringId of the user.
Request body
display_namestringNew display name
Example: "Ada Lovelace"
emailstringNew primary email
metadataobjectKeys to merge into the end-user's metadata (shallow; a key set to null is removed; at most 8 KB stored). Set `app_active: true` to mark someone who uses your app: the unverified-account expiry never deletes an account carrying it.
Example: {"app_active":true}
Response · 200
id*stringUnique identifier of the end user.
username*stringThe end user's username, unique within the app.
display_name*stringHuman-readable name of the end user.
status*objectAccount status: `active`, `suspended` or `deactivated`.
role*stringApp-level role name of the user, or `null` for none.
joined_at*string · date-timeWhen the member joined the tenant (ISO 8601).
created_at*string · date-timeWhen the end user was created (ISO 8601).
email*stringEmail address.
email_verified_at*string · date-timeWhen the primary email was verified, or `null` until it is.
active_session_count*numberSessions of the user that are currently active.
last_used_at*string · date-timeWhen the end user was last used (ISO 8601), or `null` if never.
last_activity_at*string · date-timeMost recent audit-log entry with this user as the actor. Null means we have never recorded them doing anything — which is a different fact from "no session", and the one that tells you whether they ever got in.
failed_signins*numberFailed sign-ins in the last 30 days. Flagged at 3.
mfa_factor_count*numberEnabled auth factors (TOTP, email OTP).
verified_email_count*numberVerified email contacts, primary or not. Distinct from `emailVerifiedAt`, which is the primary contact only — the `unverified` filter accepts any verified email, so a renderer branching on `emailVerifiedAt` would disagree with it.
auth_providers*arrayHow this person can sign in: `password` when a credential exists, plus each linked OAuth provider (`google`, `apple`, …). Empty means neither — an admin-created account that has not been sent a password reset cannot get in at all, and that is a real state rather than missing data.
Example: ["password","google"]
step_up_locked_until*string · date-timeSet while a live session is locked out of step-up verification.
Example
Request
PATCH https://api.auth.productcraft.co/v1/apps/{app_id}/end-users/{user_id}
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"display_name": "Ada Lovelace",
"email": "string",
"metadata": {
"app_active": true
}
}import { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const endUserSummary = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { display_name: "Ada Lovelace" });auth.admin.app(…).endUsers.update(userId, params?, options?): Auth.EndUserSummary
Response
{
"id": "string",
"username": "string",
"display_name": "string",
"status": {},
"role": "string",
"joined_at": "2026-01-01T00:00:00.000Z",
"created_at": "2026-01-01T00:00:00.000Z",
"email": "string",
"email_verified_at": "2026-01-01T00:00:00.000Z",
"active_session_count": 0,
"last_used_at": "2026-01-01T00:00:00.000Z",
"last_activity_at": "2026-01-01T00:00:00.000Z",
"failed_signins": 0,
"mfa_factor_count": 0,
"verified_email_count": 0,
"auth_providers": [
"password",
"google"
],
"step_up_locked_until": "2026-01-01T00:00:00.000Z"
}