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

# Set User Login Pin

> Sets a secure PIN (4 to 6 digits) for a user in a workspace. Validates uniqueness and sends notifications upon success.



## OpenAPI

````yaml PUT /api/v1/mgt/workspaces/{workspaceId}/users/{userId}/pin
openapi: 3.1.0
info:
  title: Xenia Team API - Set Login PIN
  description: >-
    Sets a numeric login PIN for a user within a workspace. Sends notifications
    if successful.
  version: 1.0.0
servers:
  - url: https://api.xenia.team
security: []
paths:
  /api/v1/mgt/workspaces/{workspaceId}/users/{userId}/pin:
    put:
      tags:
        - Users
      summary: Set Login PIN
      description: >-
        Sets a secure PIN (4 to 6 digits) for a user in a workspace. Validates
        uniqueness and sends notifications upon success.
      parameters:
        - name: workspaceId
          in: path
          required: true
          description: ID of the workspace
          schema:
            type: string
            format: uuid
        - name: userId
          in: path
          required: true
          description: ID of the user
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                pin:
                  type: string
                  pattern: ^[0-9]{4,6}$
                  description: PIN to assign to the user (must be 4-6 digits)
              required:
                - pin
            example:
              pin: '123456'
      responses:
        '200':
          description: PIN set successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                  extra_meta:
                    type: object
                    properties:
                      message:
                        type: string
              example:
                data: {}
                extra_meta:
                  message: PIN set successfully
        '400':
          description: Bad Request - Validation error (e.g., PIN format invalid)
        '401':
          description: Unauthorized - Missing or invalid authentication
        '403':
          description: Forbidden - Insufficient permissions
        '404':
          description: Not Found - User not found
        '409':
          description: Conflict - PIN already exists for another user
        '500':
          description: Internal Server Error
      security:
        - clientKey: []
          clientSecret: []
components:
  securitySchemes:
    clientKey:
      type: apiKey
      in: header
      name: x-client-key
      description: Client API key for authentication
    clientSecret:
      type: apiKey
      in: header
      name: x-client-secret
      description: Client secret for authentication

````