Skip to content

Update user profile
Stable

Request

Updates the authenticated user's own profile details.

Use this endpoint when the currently authenticated user needs to update their own display name. This endpoint is scoped to self-service profile edits only and cannot be used to modify another user's account or change role and group assignments.

About Update User Profile

This endpoint allows a user to update their own profile via the authn2 identity service. The request body accepts only first_name — role changes, group reassignments, and other administrative updates must be performed by an Enterprise Admin via PUT /authz2/v1/users/{user_id}. The user_id parameter expects the UUID-format authn_user_id, not the integer id from GET /user/.

Key Fields / Request Body

first_name — (required) the updated first name for the authenticated user

Common Use Cases

Allowing a user to correct or update their display name after account creation

Best Practices

Use GET /user_info/ to confirm the current user's authn_user_id before calling this endpoint

For role or group changes, use PUT /authz2/v1/users/{user_id} — this endpoint cannot modify access permissions

Workflow

Call GET /user_info/ to retrieve the authenticated user's authn_user_id

PUT to this endpoint with the updated first_name

Confirm the change in the returned User object

Security
esper_cloud_api_apiKey
Path
enterprise_idstring, (uuid)required

Enterprise ID

user_idstring, (uuid)required

AuthN User Id. The authn_user_id from the Get Users response.

Bodyapplication/jsonrequired
first_namestring(first name)required
cURL
curl -i -X PUT \
  'https://api.esper.io/_mock/openapi/authn2/v0/user/{user_id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "first_name": "string"
  }'

Responses

User Updated Successfully

Bodyapplication/json
idinteger(ID)
usernamestring(User name)
emailstring, (email)(Email)
first_namestring(First name)
last_namestring(Last name)
full_namestring(Last name)
is_staffbooleanread-only
is_superuserbooleanread-only
is_activeboolean(Is user active)
profileobject(User Profile)
emmobject(EMM details)read-only
last_loginstring(Last login)
tokenstring(Token)
has_emmboolean(Has EMM)
is_email_verifiedboolean(Is Email Verified)
Response
{ "id": 0, "username": "string", "email": "user@example.com", "first_name": "string", "last_name": "string", "full_name": "string", "is_staff": true, "is_superuser": true, "is_active": true, "profile": { "id": 0, "enterprise_user_id": "string", "authn_user_id": "77ba949a-db0b-4544-a77c-b27f70fe06cd", "authn_connection_id": "500f8424-a17b-4138-9b34-dcf4c445232c", "authz_role_id": "c85d5e04-56ba-49f9-8ef1-94165471fa4c", "role": "Shoonya Admin", "enterprise": "796caaf9-a7de-4817-9ffa-39d04bf83de9", "is_customer": true, "is_endpoint_creator": true, "created_on": "2019-08-24T14:15:22Z", "updated_on": "2019-08-24T14:15:22Z", "setup_wizard_complete": true, "default_password_changed": true, "is_developer": true, "can_factory_reset": true, "groups": [] }, "emm": { "id": 0, "user": 0, "account_identifier": "string", "account_type": "string", "display_name": "string", "google_user_id": "string", "google_enterprise": 0, "is_active": true, "created_on": "2019-08-24T14:15:22Z", "updated_on": "2019-08-24T14:15:22Z", "authentication_token": {} }, "last_login": "string", "token": "string", "has_emm": true, "is_email_verified": true }