> ## 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.

# Send a password change code

> Sends a 6-digit code to your account's verified email address or phone number, so you can change your password without the current one. Use it with `POST /v1/password/change/verify-otp-token`. Email codes are valid for 3 minutes, SMS codes for 2 minutes.

This endpoint is rate limited. Too many requests return `429`.



## OpenAPI

````yaml /spec/platform-auth.yaml post /v1/password/change/send-otp-token
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/send-otp-token:
    post:
      tags:
        - Password
      summary: Send a password change code
      description: >-
        Sends a 6-digit code to your account's verified email address or phone
        number, so you can change your password without the current one. Use it
        with `POST /v1/password/change/verify-otp-token`. Email codes are valid
        for 3 minutes, SMS codes for 2 minutes.


        This endpoint is rate limited. Too many requests return `429`.
      operationId: sendPasswordChangeCode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailOrPhone'
            example:
              phone: '09120000000'
      responses:
        '200':
          description: The code was sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusSuccess'
              example:
                status: success
        '400':
          description: The body is invalid, or it includes `token` or `newPassword`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            The email address or phone number isn't yours, or it hasn't been
            verified.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 403
                error: Forbidden
                message: >-
                  The email address or phone number does not belong to the
                  current user.
                data: null
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    EmailOrPhone:
      type: object
      description: Send exactly one of `email` or `phone`.
      properties:
        email:
          type: string
          format: email
        phone:
          $ref: '#/components/schemas/PhoneNumber'
    StatusSuccess:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
    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
    PhoneNumber:
      type: string
      pattern: ^09\d{9}$
      description: Iranian mobile number in the form `09XXXXXXXXX`.
      example: '09120000000'
    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.
    TooManyRequests:
      description: Too many requests. Wait and try again later.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 429
            error: Too Many Requests
            message: Too Many Requests
            data: null
  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.