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

# Regenerate PSK for the current user

> Regenerates the PSK for the currently logged-in user.

**IMPORTANT**: Adhere to the following:
- The old PSK will be invalidated immediately.
- NexusOne returns the new PSK only once. Store it securely, you can't retrieve it again.
- Authentication requires a Keycloak token. A PSK auth isn't allowed.



## OpenAPI

````yaml post /api/user/psk/regenerate
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/user/psk/regenerate:
    post:
      tags:
        - User PSK management
      summary: Regenerate PSK for the current user
      description: >-
        Regenerates the PSK for the currently logged-in user.


        **IMPORTANT**: Adhere to the following:

        - The old PSK will be invalidated immediately.

        - NexusOne returns the new PSK only once. Store it securely, you can't
        retrieve it again.

        - Authentication requires a Keycloak token. A PSK auth isn't allowed.
      operationId: regenerate_user_psk_api_user_psk_regenerate_post
      responses:
        '200':
          description: PSK regenerated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPskCreatedResponse'
        '403':
          description: 'Forbidden: Keycloak token required.'
        '404':
          description: No existing PSK found to regenerate.
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    UserPskCreatedResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Unique ID of the PSK.
        psk:
          type: string
          title: Psk
          description: >-
            The raw pre-shared key. Store this securely, you can't retrieve it
            again.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description for the PSK.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when you created the PSK.
        message:
          type: string
          title: Message
          description: Important information about the PSK.
      type: object
      required:
        - id
        - psk
        - created_at
        - message
      title: UserPskCreatedResponse
      description: Response model for PSK creation/regeneration. It includes the raw PSK.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````