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

# Set Handle

> Set the caller's handle

A user chooses a handle once, and it cannot be changed. Choosing the same handle again changes nothing.

The endpoint answers ``409`` for another handle once the caller has one, and for a handle that another user has or had. It
answers ``422`` for a handle that is invalid or reserved.

Args:
    user (User): User authenticated with API key.
    api_key (str): The API key that the request was made with.
    temporary_key (TemporaryApiKey | None): The temporary key that the request was made with, if any.
    data (HandleSubmitModel): The handle.
    db: Database.

Returns:
    UserModel: The caller's profile, with the handle. With a temporary API key, ``api_access_key`` is that key.



## OpenAPI

````yaml https://api.haiqu.ai/openapi.json put /user/handle
openapi: 3.1.0
info:
  title: Haiqu API
  summary: Haiqu RESTful API service.
  description: Cloud service providing the access to Haiqu cloud runtime
  contact:
    name: Haiqu Inc.
    url: https://haiqu.ai/
    email: info@haiqu.ai
  version: 1.8.1
servers: []
security: []
paths:
  /user/handle:
    put:
      summary: Set Handle
      description: >-
        Set the caller's handle


        A user chooses a handle once, and it cannot be changed. Choosing the
        same handle again changes nothing.


        The endpoint answers ``409`` for another handle once the caller has one,
        and for a handle that another user has or had. It

        answers ``422`` for a handle that is invalid or reserved.


        Args:
            user (User): User authenticated with API key.
            api_key (str): The API key that the request was made with.
            temporary_key (TemporaryApiKey | None): The temporary key that the request was made with, if any.
            data (HandleSubmitModel): The handle.
            db: Database.

        Returns:
            UserModel: The caller's profile, with the handle. With a temporary API key, ``api_access_key`` is that key.
      operationId: set_handle_user_handle_put
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HandleSubmitModel'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserModel'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyQuery: []
        - APIKeyHeader: []
components:
  schemas:
    HandleSubmitModel:
      properties:
        handle:
          type: string
          title: Handle
      type: object
      required:
        - handle
      title: HandleSubmitModel
      description: >-
        A request to choose the handle that names you in the Haiqu cloud. A
        handle cannot be changed once set!
    UserModel:
      properties:
        email:
          type: string
          title: Email
        username:
          type: string
          title: Username
        first_name:
          type: string
          title: First Name
        last_name:
          type: string
          title: Last Name
        api_access_key:
          type: string
          title: Api Access Key
        handle:
          anyOf:
            - type: string
            - type: 'null'
          title: Handle
      type: object
      required:
        - email
        - username
        - first_name
        - last_name
        - api_access_key
      title: UserModel
      description: |-
        User model.

        MVP: Haiqu user is created by Haiqu team, auth with username/password.
        V2: Haiqu API user is OAuth authenticated user from IBM, Google, etc.
    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
  securitySchemes:
    APIKeyQuery:
      type: apiKey
      in: query
      name: HAIQU_API_KEY
    APIKeyHeader:
      type: apiKey
      in: header
      name: authorization

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.