---
title: Username retrieval
description: Configure PingIDM self-service username retrieval so registered users can recover a forgotten username by email or display
component: pingidm
version: 7.5
page_id: pingidm:self-service-reference:username-retrieval
canonical_url: https://docs.pingidentity.com/pingidm/7.5/self-service-reference/username-retrieval.html
llms_txt: https://docs.pingidentity.com/pingidm/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
keywords: ["JSON", "Rest", "Configuration", "Authentication", "Self-Service", "User Self-Service"]
---

# Username retrieval

Username retrieval lets registered users retrieve a forgotten username, based on the provision of alternative information in the user record, such as email address, last name, or given name. Depending on how this process is configured, the retrieved username can be emailed to the user or displayed directly.

The REST requests in this section assume that the username is emailed to the user, and that the configuration is similar to that in the example configuration file (`samples/example-configurations/self-service/selfservice-username.json`):

> **Collapse: Example username retrieval configuration**
>
> ```json
> {
>     "stageConfigs" : [
>         {
>             "name" : "userQuery",
>             "validQueryFields" : [
>                 "mail",
>                 "givenName",
>                 "sn"
>             ],
>             "identityIdField" : "_id",
>             "identityEmailField" : "mail",
>             "identityUsernameField" : "userName",
>             "identityServiceUrl" : "managed/user"
>         },
>         {
>             "name" : "emailUsername",
>             "emailServiceUrl" : "external/email",
>             "emailServiceParameters" : {
>                 "waitForCompletion" : false
>             },
>             "from" : "info@admin.org",
>             "mimeType" : "text/html",
>             "subjectTranslations" : {
>                 "en" : "Account Information - username"
>             },
>             "messageTranslations" : {
>                 "en" : "<h3>Username is:</h3><br />%username%"
>             },
>             "usernameToken" : "%username%"
>         },
>         {
>             "name" : "retrieveUsername"
>         }
>     ],
>     "storage" : "stateless"
> }
> ```
