Rentberry User Phone Verification API

User Phone Verification

OpenAPI Specification

rentberry-user-phone-verification-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Rentberry User Phone Verification API
  description: Renting Done Right. Finally.
  version: 4
tags:
- name: User Phone Verification
  description: User Phone Verification
paths:
  /v{version}/user/phone:
    post:
      tags:
      - User Phone Verification
      summary: Change user phone number and send verification code.
      description: Available since API version 1. Updates user phone number and sends SMS verification code.
      operationId: post_api_v1_user_phone_change
      parameters:
      - name: version
        in: path
        required: true
        schema:
          type: string
          pattern: \d+
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountPhoneType'
      responses:
        '200':
          description: Verification code sent successfully.
        '400':
          description: Validation failed, recaptcha failed, or phone already verified
        '401':
          description: Unauthorized
        '429':
          description: Rate limit exceeded
      security:
      - XAuthToken: []
  /v{version}/user/phone/code:
    post:
      tags:
      - User Phone Verification
      summary: Validate phone verification code.
      description: Available since API version 1. Validates the SMS verification code and marks phone as verified.
      operationId: post_api_v1_user_phone_code_validate
      parameters:
      - name: version
        in: path
        required: true
        schema:
          type: string
          pattern: \d+
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhoneVerificationRequest'
      responses:
        '200':
          description: Phone verified successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User2'
        '400':
          description: Invalid verification code or phone already verified
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
      security:
      - XAuthToken: []
components:
  schemas:
    AccountPhoneType:
      required:
      - phone
      properties:
        phone:
          type: integer
      type: object
    UserOauthProvider:
      properties:
        id:
          type: integer
        provider:
          type: string
        providerId:
          type: string
        connectId:
          type: string
        nameFirst:
          type: string
        nameLast:
          type: string
        pictureUrl:
          type: string
        appId:
          type: string
      type: object
    UserAddress2:
      required:
      - street
      - houseNumber
      - city
      - zip
      properties:
        street:
          type: string
          maxLength: 255
          minLength: 1
        houseNumber:
          type: string
          maxLength: 255
          minLength: 1
        streetType:
          type:
          - string
          - 'null'
          maxLength: 10
        city:
          type: string
          maxLength: 255
          minLength: 3
        state:
          $ref: '#/components/schemas/State2'
        zip:
          type: string
          maxLength: 9
          minLength: 5
      type: object
    UserCreditScore:
      properties:
        score:
          type: integer
        creditScoreUpdatedAt:
          type: string
          format: date-time
        alert:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      type: object
    RentalPaymentAccount:
      properties:
        stripeAccountId:
          type: string
        isStripeOnboardingFinished:
          type: boolean
          default: false
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      type: object
    PhoneVerificationRequest:
      required:
      - phone
      - code
      properties:
        phone:
          type: integer
        code:
          type: integer
          maximum: 9999
          minimum: 1000
      type: object
    UserStripeCustomer2:
      properties:
        customerId:
          type: string
        user:
          $ref: '#/components/schemas/User2'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      type: object
    State2:
      properties:
        id:
          type: integer
        shortName:
          type:
          - string
          - 'null'
          default: null
          maxLength: 200
          minLength: 1
        name:
          type:
          - string
          - 'null'
          default: null
          maxLength: 255
          minLength: 1
      type: object
    User2:
      required:
      - nameFirst
      - nameLast
      - username
      - phone
      - birthday
      properties:
        hasPassword:
          type: boolean
        phoneCountryCode:
          type: string
        id:
          type: integer
        nameFirst:
          type: string
          maxLength: 255
          minLength: 2
        nameMiddle:
          type: string
          maxLength: 255
          minLength: 1
        nameLast:
          type: string
          maxLength: 255
          minLength: 2
        company:
          $ref: '#/components/schemas/Company'
        companyName:
          type: string
          maxLength: 255
          minLength: 1
        username:
          type: string
          maxLength: 255
          minLength: 1
        profilePictureThumbs:
          type: string
        phone:
          type: string
          maxLength: 15
          minLength: 7
        birthday:
          type: string
          format: date-time
        bio:
          type: string
          maxLength: 1500
        oauthProviders:
          type: array
          items:
            $ref: '#/components/schemas/UserOauthProvider'
        address:
          $ref: '#/components/schemas/UserAddress2'
        creditScore:
          $ref: '#/components/schemas/UserCreditScore'
        criminalReport:
          $ref: '#/components/schemas/UserCriminalReport'
        stripeCustomer:
          $ref: '#/components/schemas/UserStripeCustomer2'
        active:
          type: boolean
          default: true
        fromNotBerryForbiddenCountry:
          type: boolean
          default: false
        verified:
          type: boolean
          default: false
        emailVerified:
          type: boolean
          default: false
        phoneVerified:
          type: boolean
          default: false
        registered:
          type: boolean
          default: true
        emailNotVerifiedAfter:
          type: string
          format: date-time
        lastActiveAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        statusType:
          type: string
          default: regular
          enum:
          - regular
          - premium
          - premium_pending
          - vip
          - vip_pending
        authToken:
          type: string
        deleted:
          type: boolean
          default: false
        rentalPaymentAccount:
          $ref: '#/components/schemas/RentalPaymentAccount'
        newsletterSubscription:
          type: boolean
          default: false
        premiumPartner:
          type: boolean
          default: false
        locale:
          type: string
          default: en_US
          enum:
          - en_US
          - es_ES
        currency:
          type: string
        lengthUnit:
          type: string
          enum:
          - m
          - ft
        isRaiUser:
          type: boolean
          default: false
      type: object
    Company:
      properties:
        id:
          type: integer
        name:
          type: string
          maxLength: 255
          minLength: 1
        phone:
          type: integer
          maxLength: 15
          minLength: 7
        website:
          type: string
          maxLength: 255
          minLength: 1
        logoThumbs:
          type: string
        email:
          type: string
          maxLength: 255
          minLength: 1
        city:
          type: string
          maxLength: 255
          minLength: 1
        countryCode:
          type: string
          maxLength: 2
          minLength: 2
        provider:
          type: string
        externalId:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      type: object
    UserCriminalReport:
      properties:
        criminalRecordFound:
          type: boolean
          default: false
        status:
          type: integer
          maxLength: 10
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      type: object