# Record the user-name prompt

Source: https://docs.musicnerd.net/api-reference/users/name-prompt

Record the user-name prompt

## POST /api/user/{id}/name-prompt

Full OpenAPI specification: https://docs.musicnerd.net/spec/users.json

## Authentication

This operation requires one of the security alternatives in the specification below. Security scheme definitions are included where present in the published specification.

[Authentication guide](https://docs.musicnerd.net/authentication)

## Operation and referenced schemas

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Music Nerd API: users and profile",
    "version": "1.0.0",
    "description": "The signed-in user's own account and profile: their user name, profile photo, approved claim, contributed artists, contribution summary and the updates feed. Every route answers about the caller only; the account comes from the token, never from the request."
  },
  "servers": [
    {
      "url": "https://musicnerd-api.vercel.app",
      "description": "Production"
    },
    {
      "url": "https://musicnerd-api-staging.vercel.app",
      "description": "Staging (staging database)"
    }
  ],
  "paths": {
    "/api/user/{id}/name-prompt": {
      "post": {
        "summary": "Record the user-name prompt",
        "operationId": "recordUserNamePrompt",
        "security": [
          {
            "privyBearer": []
          }
        ],
        "description": "Marks that the caller has been shown the one-time prompt to choose a user name, and says whether to show it now. `showPrompt` is true only the first time, and only while the generated name still needs confirmation; every later call returns false.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The caller's user id (a UUID).",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "6f1d2e3a-4b5c-4d6e-8f90-a1b2c3d4e5f6"
          }
        ],
        "responses": {
          "200": {
            "description": "Whether to show the prompt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "showPrompt"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "showPrompt": {
                      "type": "boolean",
                      "description": "True when this call recorded the prompt for the first time."
                    }
                  }
                },
                "example": {
                  "status": "ok",
                  "showPrompt": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/NotSignedIn"
          },
          "403": {
            "description": "`id` is not the caller's own id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Forbidden"
                }
              }
            }
          },
          "503": {
            "description": "The database could not be reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Could not load your user name setup."
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "NotSignedIn": {
        "description": "No token, an invalid or expired token, or no Music Nerd user for it.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "status": "error",
              "error": "Not signed in"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "error": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "privyBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Access token",
        "description": "The signed-in user's access token. Copy it at https://musicnerd.net/access after signing in. Every route here answers about that user only."
      }
    }
  }
}
```
