> ## 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 an email verification code

> Emails a 6-digit code to verify an address. Confirm it with `POST /v1/verify-email` within 3 minutes.

- If your email isn't verified yet, you can send any address; once
  verified, it becomes your account email.

- To change a verified email, first send and verify a code for your
  **current** address. That opens a 5-minute window in which you send
  and verify a code for the new address.


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



## OpenAPI

````yaml /spec/platform-auth.yaml post /v1/send-email-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/send-email-token:
    post:
      tags:
        - Verification
      summary: Send an email verification code
      description: >-
        Emails a 6-digit code to verify an address. Confirm it with `POST
        /v1/verify-email` within 3 minutes.


        - If your email isn't verified yet, you can send any address; once
          verified, it becomes your account email.

        - To change a verified email, first send and verify a code for your
          **current** address. That opens a 5-minute window in which you send
          and verify a code for the new address.


        This endpoint is rate limited. Too many requests return `429`.
      operationId: sendEmailVerificationCode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  format: email
            example:
              email: you@example.com
      responses:
        '200':
          description: The code was sent. The response body is empty.
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          description: >-
            The address is used by another account; or you asked for a new
            address outside the 5-minute change window; or you asked for your
            current address again while the window is already open.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                inUse:
                  summary: Address in use
                  value:
                    statusCode: 409
                    error: Conflict
                    message: This email is already in use.
                    data: null
                windowClosed:
                  summary: Change window not open
                  value:
                    statusCode: 409
                    error: Conflict
                    message: You can't change your email address anymore.
                    data: null
                windowOpen:
                  summary: Change window already open
                  value:
                    statusCode: 409
                    error: Conflict
                    message: You have already requested to unlock your current email.
                    data: null
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  responses:
    ValidationError:
      description: The request is invalid. `message` says which field failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 400
            error: Bad Request
            message: >-
              "phone" with value "123" fails to match the required pattern:
              /^09\d{9}$/
    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
  schemas:
    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
  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.