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

# Update user password

> Update user password



## OpenAPI

````yaml /api-reference/openapi/Evo-Auth-Service/users.yaml patch /api/v1/users/{id}/update_password
openapi: 3.0.1
info:
  title: Evolution Foundation - Auth Service - Users
  description: Authentication and user and account management
  version: v1.0.0
servers:
  - url: https://api.evoai.app
    description: Production server
  - url: http://localhost:3001
    description: Development server
    variables:
      port:
        default: '3001'
  - url: '{customUrl}'
    description: Custom server
    variables:
      customUrl:
        default: https://your-instance.com
        description: Enter your server URL
security: []
paths:
  /api/v1/users/{id}/update_password:
    parameters:
      - name: id
        in: path
        description: User ID
        required: true
        schema:
          type: string
          format: uuid
    patch:
      summary: Update user password
      description: Update user password
      operationId: updateUserPassword
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                current_password:
                  type: string
                  description: Current password for verification
                new_password:
                  type: string
                  description: New password
                  minLength: 8
              required:
                - current_password
                - new_password
      responses:
        '200':
          description: Password updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                validation_error:
                  summary: Invalid user ID format or missing required fields
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: Invalid user ID format
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/users/{id}/update_password
                      method: PATCH
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_token:
                  summary: Invalid or missing token
                  value:
                    success: false
                    error:
                      code: INVALID_TOKEN
                      message: Invalid token
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/users/{id}/update_password
                      method: PATCH
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                forbidden:
                  summary: Insufficient permissions
                  value:
                    success: false
                    error:
                      code: FORBIDDEN
                      message: You are not authorized to perform this action
                      details:
                        action: users.change_password
                        record: User
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/users/{id}/update_password
                      method: PATCH
        '404':
          description: Not Found (user not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                user_not_found:
                  summary: User not found
                  value:
                    success: false
                    error:
                      code: RESOURCE_NOT_FOUND
                      message: User not found
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/users/{id}/update_password
                      method: PATCH
        '422':
          description: Unprocessable Entity (validation errors)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                incorrect_current_password:
                  summary: Current password is incorrect
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: Current password is incorrect
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/users/{id}/update_password
                      method: PATCH
                password_validation_failed:
                  summary: New password validation failed
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: Validation failed
                      details:
                        - field: password
                          messages:
                            - is too short (minimum is 8 characters)
                          full_messages:
                            - Password is too short (minimum is 8 characters)
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/users/{id}/update_password
                      method: PATCH
        '500':
          description: Internal Server Error (erro interno do servidor)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internal_error:
                  summary: Internal server error
                  value:
                    success: false
                    error:
                      code: INTERNAL_ERROR
                      message: An unexpected error occurred
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/users/{id}/update_password
                      method: PATCH
      security:
        - ApiAccessTokenAuth: []
components:
  schemas:
    SuccessResponse:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          additionalProperties: true
          nullable: true
        message:
          type: string
          example: Operation completed successfully
        meta:
          type: object
          nullable: true
          properties:
            timestamp:
              type: string
              format: date-time
    ErrorResponse:
      type: object
      required:
        - success
        - error
        - meta
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: VALIDATION_ERROR
            message:
              type: string
              example: Validation failed
            details:
              type: object
              additionalProperties: true
              nullable: true
        meta:
          type: object
          required:
            - timestamp
            - path
            - method
          properties:
            timestamp:
              type: string
              format: date-time
              example: '2024-01-15T10:30:00Z'
            path:
              type: string
              example: /api/v1/super_admin/accounts/123
            method:
              type: string
              example: POST
  securitySchemes:
    ApiAccessTokenAuth:
      type: apiKey
      in: header
      name: api_access_token
      description: API access token authentication

````

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