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

# Get the current user

> Returns your profile, verification status and billing contact details, plus the database versions you can choose from. With `teamID`, it also returns the team's profile and your role and permissions in that team.



## OpenAPI

````yaml /spec/platform-auth.yaml get /v1/me
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/me:
    get:
      tags:
        - Account
      summary: Get the current user
      description: >-
        Returns your profile, verification status and billing contact details,
        plus the database versions you can choose from. With `teamID`, it also
        returns the team's profile and your role and permissions in that team.
      operationId: getCurrentUser
      parameters:
        - $ref: '#/components/parameters/TeamID'
      responses:
        '200':
          description: The current user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentUserResponse'
              example:
                user:
                  _id: '000000000000000000000001'
                  fullname: نام نمونه
                  nationalCode: '0000000000'
                  email: you@example.com
                  phone: '09120000000'
                  avatar: https://example.com/avatar.png
                  joined_at: '2026-01-01T08:00:00.000Z'
                  hasPassword: true
                  emailVerifiedAt: '2026-01-01T08:05:00.000Z'
                  phoneVerifiedAt: '2026-01-01T08:06:00.000Z'
                  isVerified: true
                  isEmailChangeDeadline: false
                  isPhoneChangeDeadline: false
                  invoiceIssuingEnabled: true
                  isTeam: false
                  accountType: REAL_PERSON
                  contactInfo: {}
                  minCreditAmount: 20000
                  isManualMinCredit: false
                  hasSucceedPayment: true
                databaseVersions:
                  mysql:
                    - label: '9.0'
                      value: 9.0.1
                    - label: '8.0'
                      value: 8.0.30
                defaultDatabaseVersions:
                  mysql: 9.0.1
        '400':
          $ref: '#/components/responses/InvalidTeamID'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/TeamNotFound'
components:
  parameters:
    TeamID:
      name: teamID
      in: query
      required: false
      description: >-
        Run the request in the context of a team you belong to, instead of your
        personal account.
      schema:
        type: string
        pattern: ^[0-9a-fA-F]{24}$
      example: '000000000000000000000002'
  schemas:
    CurrentUserResponse:
      type: object
      description: The response can include additional fields not listed here.
      properties:
        user:
          $ref: '#/components/schemas/CurrentUser'
        team:
          allOf:
            - $ref: '#/components/schemas/CurrentTeam'
          description: Only returned with `teamID`.
        databaseVersions:
          type: object
          description: Database versions you can create, keyed by database type.
          additionalProperties:
            type: array
            items:
              type: object
              properties:
                label:
                  type: string
                value:
                  type: string
        defaultDatabaseVersions:
          type: object
          description: The default version `value` for each database type.
          additionalProperties:
            type: string
    CurrentUser:
      allOf:
        - type: object
          properties:
            _id:
              type: string
            fullname:
              type: string
            nationalCode:
              type: string
            email:
              type: string
              format: email
            phone:
              type: string
            avatar:
              type: string
              format: uri
            joined_at:
              type: string
              format: date-time
            hasPassword:
              type: boolean
              description: Whether a password is set on the account.
            emailVerifiedAt:
              type: string
              format: date-time
              nullable: true
            phoneVerifiedAt:
              type: string
              format: date-time
              nullable: true
            isVerified:
              type: boolean
              description: >-
                `true` once the full name, national code, email address and
                phone number are all set and verified. Creating services and API
                tokens requires this.
            isEmailChangeDeadline:
              type: boolean
              description: >-
                `true` while a 5-minute window to change the email address is
                open.
            isPhoneChangeDeadline:
              type: boolean
              description: >-
                `true` while a 5-minute window to change the phone number is
                open.
            invoiceIssuingEnabled:
              type: boolean
            isTeam:
              type: boolean
            isTeamCreator:
              type: boolean
              description: Only with `teamID`. Whether you created the team.
            hasSucceedPayment:
              type: boolean
              description: Whether any payment has succeeded on the account.
            changedTeamCreatorAt:
              type: string
              format: date-time
        - $ref: '#/components/schemas/BillingContact'
    CurrentTeam:
      allOf:
        - type: object
          properties:
            _id:
              type: string
            teamName:
              type: string
            teamCreator:
              type: string
              description: User ID of the team's creator.
            isTeam:
              type: boolean
            joined_at:
              type: string
              format: date-time
            invoiceIssuingEnabled:
              type: boolean
            teamMemberRole:
              type: object
              description: Your role in the team.
              properties:
                name:
                  type: string
                permissions:
                  type: array
                  items:
                    type: string
            teamMemberPermissions:
              type: array
              description: Permissions assigned to you on specific resources in the team.
              items:
                type: object
        - $ref: '#/components/schemas/BillingContact'
    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
    BillingContact:
      type: object
      properties:
        balance:
          type: number
          description: >-
            Current account balance. Only returned for the team, and only if you
            have billing permission there.
        accountType:
          type: string
          enum:
            - REAL_PERSON
            - LEGAL_PERSON
        contactInfo:
          type: object
          description: Saved billing contact details (see `POST /v1/contact-info`).
        contactInfoSavedAt:
          type: string
          format: date-time
        minCreditAmount:
          type: number
          description: Balance threshold for low-credit notifications.
        isManualMinCredit:
          type: boolean
          description: Whether the low-credit threshold was set manually.
        minCreditLastNotifiedAt:
          type: string
          format: date-time
          description: When a low-credit notification was last sent.
  responses:
    InvalidTeamID:
      description: '`teamID` isn''t a valid ID.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 400
            error: Bad Request
            message: Invalid team ID.
            data: null
    Unauthorized:
      description: The API token is missing, invalid or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthError'
          example:
            error: Unauthorized.
    TeamNotFound:
      description: You sent a `teamID` for a team you aren't a member of.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 403
            error: Forbidden
            message: Team not found
            data:
              code: team_not_found
  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.