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

# Reset user password

> Reset a user's password (superadmin only).

Can either send a reset link email or set a new password directly.
Invalidates all of the user's refresh tokens, forcing them to log in again.



## OpenAPI

````yaml put /api/v1/users/{user_id}/password
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/users/{user_id}/password:
    put:
      tags:
        - users
        - Users
      summary: Reset user password
      description: >-
        Reset a user's password (superadmin only).


        Can either send a reset link email or set a new password directly.

        Invalidates all of the user's refresh tokens, forcing them to log in
        again.
      operationId: reset_user_password_api_v1_users__user_id__password_put
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            title: User Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PasswordResetRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
                title: >-
                  Response Reset User Password Api V1 Users  User Id  Password
                  Put
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PasswordResetRequest:
      properties:
        new_password:
          anyOf:
            - type: string
              minLength: 1
              format: password
              writeOnly: true
            - type: 'null'
          title: New Password
          description: New password
        send_reset_link:
          type: boolean
          title: Send Reset Link
          description: >-
            Whether to send a password reset link instead of setting password
            directly
          default: false
      type: object
      title: PasswordResetRequest
      description: |-
        Request schema for resetting a user's password.

        Used by superadmins to reset user passwords.
    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

````