> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kryptonfund.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set or update username

> Set or update the username for a user.
- **user_id**: User's unique ID
- **username**: Desired username
Returns success and the new username.



## OpenAPI

````yaml /api-reference/krypton_backend.json post /api/v1/set_username
openapi: 3.1.0
info:
  title: Krypton API
  description: >-
    API documentation for Krypton backend. This API allows user authentication,
    wallet management, USDC transfers, transaction history via Circle and
    Firestore, and marketplace management.
  version: 1.0.0
servers:
  - url: https://api.kryptonfund.com
    description: Production API
  - url: http://127.0.0.1:8000
    description: Local API
security: []
tags:
  - name: wallet
    description: Wallet management, authentication, and USDC transfer endpoints.
  - name: marketplace
    description: Marketplace management endpoints for startups and categories.
  - name: hedge-fund
    description: Hedge fund questionnaire submission and management endpoints.
  - name: smarttoken
    description: Smart Token management endpoints for businesses.
  - name: onramp
    description: Onramp data logging and analytics endpoints for Transak and Coinbase APIs.
  - name: strategy
    description: >-
      Unified strategy endpoints for MAVC, MAVP, and MAVC_YEARN vaults with
      standardized function names.
  - name: website
    description: Website-related endpoints including waitlist submission.
paths:
  /api/v1/set_username:
    post:
      tags:
        - wallet
      summary: Set or update username
      description: |-
        Set or update the username for a user.
        - **user_id**: User's unique ID
        - **username**: Desired username
        Returns success and the new username.
      operationId: set_username_api_v1_set_username_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UsernameUpdateRequest'
        required: true
      responses:
        '200':
          description: Success and new username
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Set Username Api V1 Set Username Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UsernameUpdateRequest:
      properties:
        user_id:
          type: string
          title: User Id
          description: User's unique ID
          example: 123e4567-e89b-12d3-a456-426614174000
        username:
          type: string
          title: Username
          description: Desired username
          example: alice
      type: object
      required:
        - user_id
        - username
      title: UsernameUpdateRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````