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

# Change your password

> Changes the password of the logged-in account. Prove it's you either with `currentPassword`, or with an `email` or `phone` of your account that you verified within the last hour. Every API token issued before the change stops working; use the token in the response from now on.



## OpenAPI

````yaml /spec/platform-auth.yaml post /v1/password/change
openapi: 3.0.1
info:
  title: Authentication & Account
  version: 1.0.0
  description: >-
    Log in, issue API tokens, change or reset your password, set up two-factor
    authentication, verify your email address and phone number, and manage your
    account profile and billing contact details.
servers:
  - url: https://api.liara.ir
security:
  - bearerAuth: []
tags:
  - name: Login
    description: Exchange your credentials or a one-time code for an API token.
  - name: Registration
    description: Create a new account.
  - name: Password
    description: Change your password while logged in, or reset a forgotten one.
  - name: API Tokens
    description: Issue additional API tokens for your account.
  - name: Account
    description: Read and update your profile and billing contact details.
  - name: Two-Factor Authentication
    description: Set up and manage authenticator-app (TOTP) two-factor authentication.
  - name: Verification
    description: Verify, or change, your account's email address and phone number.
paths:
  /v1/password/change:
    post:
      tags:
        - Password
      summary: Change your password
      description: >-
        Changes the password of the logged-in account. Prove it's you either
        with `currentPassword`, or with an `email` or `phone` of your account
        that you verified within the last hour. Every API token issued before
        the change stops working; use the token in the response from now on.
      operationId: changePassword
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Send `currentPassword`, or one of `email` or `phone` (not both).
              required:
                - newPassword
              properties:
                currentPassword:
                  type: string
                  maxLength: 250
                newPassword:
                  type: string
                  maxLength: 250
                email:
                  type: string
                  format: email
                  description: >-
                    Your account's email address. It must have been verified
                    within the last hour.
                phone:
                  allOf:
                    - $ref: '#/components/schemas/PhoneNumber'
                  description: >-
                    Your account's phone number. It must have been verified
                    within the last hour.
            examples:
              currentPassword:
                summary: With the current password
                value:
                  currentPassword: <current-password>
                  newPassword: <new-password>
              recentlyVerifiedEmail:
                summary: With a recently verified email address
                value:
                  email: you@example.com
                  newPassword: <new-password>
      responses:
        '200':
          description: The password was changed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenResponse'
              example:
                api_token: <api-token>
        '400':
          description: >-
            The body is invalid, or neither `currentPassword` nor `email` /
            `phone` was sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 400
                error: Bad Request
                message: >-
                  The email address or phone number is required when
                  currentPassword is not provided.
                data: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            The current password is wrong, the email address or phone number
            isn't yours, or it wasn't verified within the last hour.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                wrongPassword:
                  summary: Wrong current password
                  value:
                    statusCode: 403
                    error: Forbidden
                    message: Current password is wrong.
                    data: null
                notRecentlyVerified:
                  summary: Not verified recently
                  value:
                    statusCode: 403
                    error: Forbidden
                    message: >-
                      You must verify the selected email address or phone number
                      within the last hour.
                    data: null
components:
  schemas:
    PhoneNumber:
      type: string
      pattern: ^09\d{9}$
      description: Iranian mobile number in the form `09XXXXXXXXX`.
      example: '09120000000'
    TokenResponse:
      type: object
      properties:
        api_token:
          type: string
          description: 'API token to send as `Authorization: Bearer <api-token>`.'
    Error:
      type: object
      description: Standard error body.
      properties:
        statusCode:
          type: integer
        error:
          type: string
          description: HTTP status text.
        message:
          type: string
          description: What went wrong.
        data:
          type: object
          nullable: true
          description: >-
            Extra details. When present, `code` is a stable, machine-readable
            error code.
          properties:
            code:
              type: string
    AuthError:
      type: object
      description: Error body returned when the API token is rejected.
      properties:
        error:
          type: string
  responses:
    Unauthorized:
      description: The API token is missing, invalid or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthError'
          example:
            error: Unauthorized.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send your API token as `Authorization: Bearer <api-token>`. Tokens
        expire (30 days by default) and stop working when you change or reset
        your password.

````

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