openapi: 3.1.0
info:
  title: RentEngine Public API
  description: >
    Integrate your systems anywhere with RentEngine.


    ## Authorization


    This API uses JWT Bearer token authentication. Follow these steps to obtain
    and use your API tokens:


    ### Obtaining API Tokens


    1. Log in to your RentEngine [developer
    portal](https://app.rentengine.io/developer/portal)

    2. In the top corner, click the "Create New API Key" button

    3. Provide a name for your token (e.g., "Integration Name")

    4. Click Create

    5. Copy the token to your clipboard and save it securely as it will not be
    displayed again


    **Important Security Notice:** Your token will only be displayed ONCE at
    creation time. Make sure to copy it and store it securely. For security
    reasons, we cannot display the token again after this point.


    ### Using API Tokens


    Include your token in all API requests as a Bearer token in the
    Authorization header:


    ```

    Authorization: Bearer your_token_here

    ```


    ### Token Security Best Practices


    - Store tokens securely in environment variables or a secure vault

    - Never hardcode tokens in your application code

    - Do not share tokens in public repositories or client-side code

    - Use separate tokens for different integrations or environments


    ### Token Permissions


    Each token generated by a user will have the full permissions of the user
    that created it across all accounts associated with that user. 

    Actions will be logged in the name of that user & token. 


    ### Invalidating Tokens


    Tokens will not expire. (Well not for 100 years at least). If a token is
    compromised or no longer needed:


    1. Log in to your RentEngine [developer
    portal](https://app.rentengine.io/developer/portal)

    2. Find the token you wish to invalidate in the table in the API Keys
    section

    3. Click the "Revoke Token" icon that looks like a trash can


    Once revoked, a token cannot be restored. You'll need to create a new token
    if needed.


    ### Pagination


    All list endpoints in the RentEngine API support pagination to efficiently
    handle large datasets. Here's how to use pagination in your API requests:


    **Pagination Parameters**


    When making requests to list endpoints (e.g., `/lockboxes`,
    `/lockbox_events`, `/units`), you can include the following query
    parameters:


    - `limit` - Controls how many items to return per page (default: 50, max:
    100)

    - `page_number` - Specifies which page to retrieve (0-indexed, default: 0)


    Example request with pagination:

    ```

    GET /api/public/v1/lockboxes?limit=25&page_number=1

    ```


    This would return the second page of results with 25 items per page.


    **Response Format**


    Paginated responses include only the requested data. The total number of
    items across all pages is not included in the response. 


    **Iterating Through Pages**


    To retrieve all items across multiple pages, increment the `page_number`
    parameter until you've processed all pages. You can determine when you've
    reached the end when the response is shorter than the limit requested.


    **Performance Considerations**


    - Use appropriate `limit` values based on your needs. Smaller values reduce
    payload size but require more API calls, which can slow down performance and
    be subject to rate limits.

    - When filtering data, apply filters in the query parameters first to reduce
    the total number of items that need to be fetched.


    ## Webhooks


    RentEngine provides webhooks to notify your systems about events in
    real-time. This allows you to build integrations that respond immediately to
    changes in your RentEngine data.


    **Setting Up Webhooks**


    Webhooks can be configured through the RentEngine [developer
    portal](https://app.rentengine.io/developer/portal). You'll need to specify:


    1. The target URL where webhook events should be sent

    2. The data you want to monitor (e.g., lockboxes, units, lockbox_events)

    3. The event types you want to receive (INSERT, UPDATE, DELETE)

    4. An optional API key that will be included in webhook requests to your
    endpoint


    **Webhook Payload Structure**


    Webhook payloads follow this general structure:


    ```json

    {
      "type": "INSERT|UPDATE|DELETE",
      "table": "table_name",
      "record": { /* The current state of the record (null for DELETE) */ },
      "old_record": { /* The previous state of the record (null for INSERT) */ }
    }

    ```


    The specific fields in `record` and `old_record` will depend on the table
    that triggered the event.


    **Event Types**


    - `INSERT`: Sent when a new record is created

    - `UPDATE`: Sent when an existing record is modified

    - `DELETE`: Sent when a record is deleted


    **Security Considerations**


    - Webhook endpoints should be HTTPS to ensure secure transmission of data

    - Validate the API key included in the webhook request to ensure it's coming
    from RentEngine

    - Implement idempotency in your webhook handlers to prevent duplicate
    processing


    **Webhook Delivery**


    RentEngine uses a reliable delivery system (QStash) to ensure webhooks are
    delivered even during temporary outages. If your endpoint is unavailable,
    we'll retry delivery with exponential backoff.
  version: 1.1.1
  contact:
    email: eng@rentengine.io
    url: https://rentengine.io
servers:
  - url: https://app.rentengine.io/api/public/v1
    description: Production environment
  - url: https://staging-app.rentengine.io/api/public/v1
    description: Staging environment
paths:
  /lockboxes:
    get:
      summary: Get lockboxes
      description: Retrieve lockboxes with optional filtering and pagination
      operationId: getLockboxes
      tags:
        - Lockboxes
      parameters:
        - name: serial_numbers
          in: query
          description: Filter by comma-separated list of lockbox provider serial numbers
          schema:
            type: array
            items:
              type: string
              example: '1234567'
          style: form
          explode: false
          example: 1234567,7654321
        - name: lockbox_ids
          in: query
          description: Filter by comma-separated list of RentEngine lockbox IDs
          schema:
            type: array
            items:
              type: string
              example: 123e4567-e89b-12d3-a456-426614174000
          style: form
          explode: false
          example: >-
            123e4567-e89b-12d3-a456-426614174000,123e4567-e89b-12d3-a456-426614174001
        - name: account_id
          in: query
          description: >-
            Filter by lockboxes associated with a specific RentEngine account by
            the account's id
          schema:
            type: string
            example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
        - name: lockbox_type
          in: query
          description: >-
            Filter by lockbox type (currently only SentriLock is supported via
            API. Codebox is supported via the UI only)
          schema:
            type: string
            enum:
              - Sentrilock
            example: Sentrilock
        - $ref: '#/components/parameters/PaginationLimit'
        - $ref: '#/components/parameters/PaginationPage'
      responses:
        '200':
          description: Success. Returns a list of lockboxes.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Lockbox'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
    post:
      summary: Create lockboxes
      description: Create new lockboxes (currently only SentriLock type is supported)
      operationId: postLockboxes
      tags:
        - Lockboxes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostLockboxesRequest'
            example:
              lockbox_type: Sentrilock
              serial_numbers:
                - '1234567'
                - '7654321'
              account_id: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
      responses:
        '201':
          description: Lockboxes created successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Lockbox'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
  /lockboxes/transfer_accounts:
    post:
      summary: Transfer lockboxes between accounts
      description: >-
        Moves lockboxes between accounts. The user must have access to both the
        lockboxes and the target account.
      operationId: postLockboxesTransferAccounts
      tags:
        - Lockboxes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostLockboxTransferAccountsRequest'
            example:
              lockbox_ids:
                - 123e4567-e89b-12d3-a456-426614174000
                - 123e4567-e89b-12d3-a456-426614174001
              new_account_id: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
      responses:
        '200':
          description: Lockboxes transferred successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Lockbox'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            Forbidden - User does not have access to the target account or the
            specified lockboxes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unauthorized-account:
                  value:
                    error: Unauthorized to transfer lockboxes to this account
                unauthorized-lockboxes:
                  value:
                    error: Unauthorized to transfer these lockboxes.
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
  /lockbox_events:
    get:
      summary: Get lockbox events
      description: Retrieve lockbox events with optional filtering and pagination
      operationId: getLockboxEvents
      tags:
        - Lockbox Events
      parameters:
        - name: serial_numbers
          in: query
          description: Filter by comma-separated list of serial numbers
          schema:
            type: array
            items:
              type: string
              example: '1234567'
          style: form
          explode: false
          example: 1234567,7654321
        - name: lockbox_ids
          in: query
          description: Filter by comma-separated list of lockbox IDs
          schema:
            type: array
            items:
              type: string
              example: 123e4567-e89b-12d3-a456-426614174000
          style: form
          explode: false
          example: >-
            123e4567-e89b-12d3-a456-426614174000,123e4567-e89b-12d3-a456-426614174001
        - name: lockbox_event_ids
          in: query
          description: Filter by comma-separated list of lockbox event IDs
          schema:
            type: array
            items:
              type: string
              example: 123e4567-e89b-12d3-a456-426614174002
          style: form
          explode: false
          example: >-
            123e4567-e89b-12d3-a456-426614174002,123e4567-e89b-12d3-a456-426614174003
        - name: account_id
          in: query
          description: Filter by account ID
          schema:
            type: string
            example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
        - name: lockbox_type
          in: query
          description: Filter by lockbox type
          schema:
            type: string
            enum:
              - Sentrilock
            example: Sentrilock
        - name: event_types
          in: query
          description: Filter by event types
          schema:
            type: array
            items:
              type: string
              enum:
                - Install
                - Uninstall
                - Generate Code
              example: Install
          style: form
          explode: false
          example: Install,Uninstall
        - name: created_at_from
          in: query
          description: Filter events created after this timestamp (ISO 8601 format)
          schema:
            type: string
            format: date-time
            example: '2023-01-01T00:00:00Z'
        - name: created_at_to
          in: query
          description: Filter events created before this timestamp (ISO 8601 format)
          schema:
            type: string
            format: date-time
            example: '2023-12-31T23:59:59Z'
        - name: unit_ids
          in: query
          description: Filter by comma-separated list of unit IDs
          schema:
            type: array
            items:
              type: string
              example: '12345'
          style: form
          explode: false
          example: 12345,67890
        - $ref: '#/components/parameters/PaginationLimit'
        - $ref: '#/components/parameters/PaginationPage'
      responses:
        '200':
          description: Success. Returns a list of lockbox events.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LockboxEvent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
    post:
      summary: Create lockbox events
      description: Create new lockbox events (Install or Uninstall)
      operationId: postLockboxEvents
      tags:
        - Lockbox Events
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostLockboxEventsRequest'
            example:
              events:
                - lockbox_id: 123e4567-e89b-12d3-a456-426614174000
                  event_type: Install
                  unit_id: 12345
                - lockbox_id: 123e4567-e89b-12d3-a456-426614174001
                  event_type: Uninstall
                  unit_id: 67890
      responses:
        '201':
          description: Lockbox events created successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LockboxEvent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
  /lockbox_installations:
    get:
      summary: Get lockbox installations
      description: >-
        Retrieve lockbox installations with optional filtering and pagination.
        Lockbox installations can only be created by inserting a lockbox event
        with event_type "Install".
      operationId: getLockboxInstallations
      tags:
        - Lockbox Installations
      parameters:
        - name: lockbox_ids
          in: query
          description: Filter by comma-separated list of lockbox IDs
          schema:
            type: array
            items:
              type: string
              example: 123e4567-e89b-12d3-a456-426614174000
          style: form
          explode: false
          example: >-
            123e4567-e89b-12d3-a456-426614174000,123e4567-e89b-12d3-a456-426614174001
        - name: unit_ids
          in: query
          description: Filter by comma-separated list of unit IDs
          schema:
            type: array
            items:
              type: string
              example: '12345'
          style: form
          explode: false
          example: 12345,67890
        - $ref: '#/components/parameters/PaginationLimit'
        - $ref: '#/components/parameters/PaginationPage'
      responses:
        '200':
          description: Success. Returns a list of lockbox installations.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LockboxInstallation'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
  /units:
    get:
      summary: Get units
      description: Retrieve units with optional filtering and pagination
      operationId: getUnits
      tags:
        - Units
      parameters:
        - name: unitIds
          in: query
          description: Filter by comma-separated list of unit IDs
          schema:
            type: array
            items:
              type: number
              example: 12345
          style: form
          explode: false
          example: 12345,67890
        - name: extracted_from
          in: query
          description: >-
            Any string that can be used to identify the unit in an external
            system. Essentially the same as an external_id, but not limited to
            an ID format. Uniqueness is not enforced.
          schema:
            type: string
            example: f78125c
        - name: accountId
          in: query
          description: Filter by account ID
          schema:
            type: string
            example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
        - name: statuses
          in: query
          description: Filter by comma-separated list of unit statuses
          schema:
            type: array
            items:
              type: string
              enum:
                - Incomplete
                - Under Review
                - Available
                - Archived
                - Leased
                - On Hold
                - Expired
                - Withdrawn
                - Withdrawal Requested
                - Price Analysis
          example: Available,Incomplete
        - $ref: '#/components/parameters/PaginationLimit'
        - $ref: '#/components/parameters/PaginationPage'
      responses:
        '200':
          description: Success. Returns a list of units.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Unit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
    post:
      summary: Create or update a unit
      description: >
        Create a new unit or update an existing one.


        ## Insert vs Update

        - **Insert**: When no `id` is provided, a new unit will be created.
        Required fields for creation include `address`, `property_type`,
        `target_rental_rate`, and `account_id`.

        - **Update**: When an `id` is provided, an existing unit will be
        updated. No other fields are required.


        ## Address Updates

        When updating a unit, if you include the `address` field, you must
        provide all address components (`street_number`, `street_name`,
        `zip_code`, `state`, `city`). Partial address updates are not supported.


        ## Structured Access Instructions

        When providing `structured_access_instructions`, the `showing_method`
        field must also be set. The structure of the access instructions depends
        on the showing method:

        - For "Self Guided", "Remote Guided", or "Remote Guided with Gated
        Access" methods: Include fields like `lockbox_location`, `lockbox_code`,
        etc.

        - For "Accompanied" method: Include fields like `assigned_user_ids`,
        `meeting_location`, etc.
      operationId: postUnit
      tags:
        - Units
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertUnitRequest'
      responses:
        '200':
          description: Unit successfully created or updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  unit:
                    $ref: '#/components/schemas/Unit'
        '400':
          description: Bad request - invalid input parameters or request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                validation-error:
                  value:
                    error: Invalid request body
                    details:
                      - keyword: required
                        dataPath: ''
                        schemaPath: '#/required'
                        params:
                          missingProperty: address
                        message: should have required property 'address'
                foreign-key-error:
                  value:
                    error: Invalid foreign IDs
                    details:
                      - field: account_id
                        id: invalid-uuid
                        message: Account with ID invalid-uuid does not exist
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
  /multifamily_properties:
    get:
      summary: Get multifamily properties
      description: Retrieve multifamily properties with optional filtering
      operationId: getMultifamilyProperties
      tags:
        - Multifamily Properties
      parameters:
        - name: account_id
          in: query
          description: Filter by account ID
          schema:
            type: string
            format: uuid
          required: false
          example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
        - name: id
          in: query
          description: Filter by multifamily property ID
          schema:
            type: string
            format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        - name: deleted
          in: query
          description: Filter by deleted status
          schema:
            type: boolean
            default: false
          example: false
      responses:
        '200':
          description: Success. Returns a list of multifamily properties.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MultifamilyProperty'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
    post:
      summary: Create or update a multifamily property
      description: Create a new multifamily property or update an existing one
      operationId: postMultifamilyProperties
      tags:
        - Multifamily Properties
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertMultifamilyPropertyRequest'
            example:
              community_name: Sunset Towers
              building_count: 3
              unit_count: 75
              description: Luxury apartment community with amenities
              structure_type: Mid Rise
              year_built: 2008
              photos:
                - path: https://example.com/images/sunset-towers.jpg
                  hidden: false
              text_address: 123 Main St, San Francisco, CA 94111
              account_id: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
      responses:
        '200':
          description: Multifamily property successfully created or updated
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MultifamilyProperty'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
  /floorplans:
    get:
      summary: Get floorplans
      description: Retrieve multifamily_prs with optional filtering
      operationId: getFloorplans
      tags:
        - Floorplans
      parameters:
        - name: multifamily_property_id
          in: query
          description: Filter by multifamily property ID
          schema:
            type: string
            format: uuid
          required: false
          example: 123e4567-e89b-12d3-a456-426614174000
        - name: account_id
          in: query
          description: Filter by account ID
          schema:
            type: string
            format: uuid
          required: false
          example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
        - name: id
          in: query
          description: Filter by floorplan ID
          schema:
            type: string
            format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        - name: deleted
          in: query
          description: Filter by deleted status
          schema:
            type: boolean
            default: false
          example: false
      responses:
        '200':
          description: Success. Returns a list of floorplans.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Floorplan'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
    post:
      summary: Create or update a floorplan
      description: Create a new floorplan or update an existing one
      operationId: postFloorplans
      tags:
        - Floorplans
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertFloorplanRequest'
            example:
              multifamily_property_id: 123e4567-e89b-12d3-a456-426614174000
              name: The Willow
              bedroom_count: 2
              bathroom_count: 2.5
              unit_count: 15
              units_available: 3
              market_rent: 1850
              min_sqft: 950
              max_sqft: 1100
              photos:
                - path: https://example.com/images/willow-floorplan.jpg
                  hidden: false
              description: Spacious 2-bedroom layout with modern finishes
      responses:
        '200':
          description: Floorplan successfully created or updated
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Floorplan'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
  /prospects:
    get:
      summary: Get prospects
      description: Retrieve prospects with optional filtering and pagination
      operationId: getProspects
      tags:
        - Prospects
      parameters:
        - name: id
          in: query
          description: Filter by prospect ID
          schema:
            type: number
            example: 123
        - name: account_id
          in: query
          description: >-
            Filter by prospects associated with a specific RentEngine account by
            the account's id
          schema:
            type: string
            format: uuid
            example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
        - name: units_of_interest
          in: query
          description: >-
            Filter by prospects interested in specific units (comma-separated
            list of unit IDs)
          schema:
            type: array
            items:
              type: number
              example: 234
          style: form
          explode: false
          example: 123,124
        - name: status
          in: query
          description: Filter prospects by status
          schema:
            type: string
            example: Showing Scheduled
        - name: source
          in: query
          description: Filter prospects by source
          schema:
            type: string
            example: Zillow
        - name: created_after
          in: query
          description: Filter prospects created after this timestamp (ISO 8601 format)
          schema:
            type: string
            format: date-time
            example: '2023-01-15T12:00:00Z'
        - name: created_before
          in: query
          description: Filter prospects created before this timestamp (ISO 8601 format)
          schema:
            type: string
            format: date-time
            example: '2023-01-17T12:00:00Z'
        - $ref: '#/components/parameters/PaginationLimit'
        - $ref: '#/components/parameters/PaginationPage'
      responses:
        '200':
          description: Success. Returns a list of prospects.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Prospect'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
  /lockboxes/generate_code:
    post:
      summary: Generate a lockbox code
      description: >-
        Generate a one-time code for a lockbox. The code can be generated by
        providing either a lockbox_id, serial_number, or unit_id. The code will
        be valid for the specified date.
      operationId: postGenerateLockboxCode
      tags:
        - Lockboxes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostGenerateLockboxCodeRequest'
            example:
              lockbox_id: 123e4567-e89b-12d3-a456-426614174000
              date: '2024-03-15'
              created_for: John Doe
              code_type: ACCESS
      responses:
        '200':
          description: Success. Returns the generated code and lockbox type.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: The generated lockbox code
                    example: '1234'
                  lockboxType:
                    type: string
                    enum:
                      - Sentrilock
                      - Codebox
                    description: Type of the lockbox
                    example: Sentrilock
                  instructions:
                    type: string
                    description: >-
                      Optional instructions for using the code. May or may not
                      be provided, depending on the lockbox.
                    example: 'Enter code followed by #'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
  /subteams:
    get:
      summary: Get subteams
      description: Retrieve subteams with optional filtering and pagination
      operationId: getSubteams
      tags:
        - Subteams
      parameters:
        - name: subteam_ids
          in: query
          description: Filter by comma-separated list of subteam IDs
          schema:
            type: array
            items:
              type: string
              example: 123e4567-e89b-12d3-a456-426614174000
          style: form
          explode: false
          example: >-
            123e4567-e89b-12d3-a456-426614174000,123e4567-e89b-12d3-a456-426614174001
        - name: account_id
          in: query
          description: Filter by account ID
          schema:
            type: string
            example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
        - $ref: '#/components/parameters/PaginationLimit'
        - $ref: '#/components/parameters/PaginationPage'
      responses:
        '200':
          description: Success. Returns a list of subteams.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Subteam'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
  /prescreening_templates:
    get:
      summary: Get prescreening templates
      description: Retrieve prescreening templates with optional filtering and pagination
      operationId: getPrescreeningTemplates
      tags:
        - Prescreening Templates
      parameters:
        - name: templateIds
          in: query
          description: Filter by comma-separated list of template IDs
          schema:
            type: array
            items:
              type: string
              example: 123e4567-e89b-12d3-a456-426614174000
          style: form
          explode: false
          example: >-
            123e4567-e89b-12d3-a456-426614174000,123e4567-e89b-12d3-a456-426614174001
        - name: accountId
          in: query
          description: Filter by account ID
          schema:
            type: string
            example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
        - name: isDefault
          in: query
          description: Filter by default template status
          schema:
            type: boolean
            example: true
        - $ref: '#/components/parameters/PaginationLimit'
        - $ref: '#/components/parameters/PaginationPage'
      responses:
        '200':
          description: Success. Returns a list of prescreening templates.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PrescreeningTemplate'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
  /showings/availability:
    get:
      summary: Get unit showing availability
      description: >-
        Retrieve showing availability for a specific unit, including available
        and preferred showing windows
      operationId: getShowingAvailability
      tags:
        - Showings
      parameters:
        - name: unitId
          in: query
          description: ID of the unit to get availability for
          schema:
            type: number
            example: 12345
          required: true
      responses:
        '200':
          description: Success. Returns showing availability for the unit.
          content:
            application/json:
              schema:
                type: object
                properties:
                  availability:
                    $ref: '#/components/schemas/UnitShowingAvailability'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
  /showings/create:
    post:
      summary: Create a showing
      description: >
        Create a new showing for a unit. This endpoint handles both new showings
        and rescheduling of existing showings.


        ## Prospect Types

        - **Self**: Regular prospect who needs to complete prescreening

        - **Agent**: Real estate agent who needs to provide a valid agent token


        ## Prescreening

        For self prospects, the system will automatically run prescreening based
        on the unit's prescreen template.

        If prescreening fails, the showing will not be created and an
        appropriate error will be returned.


        ## Agent Tokens

        For agent prospects, a valid 6-character agent token must be provided in
        the `agentTk` field.


        ## Showing Methods

        The `desiredShowingMethod` field allows specifying the preferred showing
        method:

        - "Accompanied": Agent-guided showing

        - "Self Guided": Self-guided showing

        - "Remote Guided": Remote-guided showing

        - "Remote Guided with Gated Access": Remote-guided showing with gate
        access
      operationId: createShowing
      tags:
        - Showings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateShowingRequest'
            example:
              unitId: 12345
              plannedForTime: '2024-03-15T10:00:00Z'
              prospectData:
                firstName: John
                lastName: Doe
                email: john.doe@example.com
                phone: '5551234567'
                creditScore: 700+
                income: $5000-$6000/month
                questionAnswers:
                  - question: Do you have a housing voucher (e.g. Section 8)?
                    fixedQuestionType: housing_voucher
                    type: yes_no
                    answer: false
                  - question: Have you been convicted of a felony?
                    type: yes_no
                    answer: false
                prospectType: Self
                voucherHolder: false
              desiredShowingMethod: Accompanied
      responses:
        '200':
          description: Showing created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateShowingResponse'
        '400':
          description: Bad request - validation error or business logic error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                required:
                  - message
              examples:
                unit-on-hold:
                  value:
                    message: Unit is on hold. Cannot create showing.
                showing-time-unavailable:
                  value:
                    message: Showing time is no longer available
                showing-method-unavailable:
                  value:
                    message: Showing method no longer available for desired slot
                past-showing-time:
                  value:
                    message: Cannot schedule a showing in the past
                invalid-agent-token:
                  value:
                    message: Agent token is invalid
                unit-unknown:
                  value:
                    message: Cannot schedule a showing for an unknown unit
                no-showing-time:
                  value:
                    message: No showing time provided
                prescreen-template-not-found:
                  value:
                    message: Showing prescreen template not found
                prospect-blocked:
                  value:
                    message: Showings are no longer available at this unit.
                prescreen-rejection:
                  value:
                    message: 'Prescreening rejected: Self Reported Income'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                required:
                  - message
              examples:
                generic-error:
                  value:
                    message: Failed to create showing.
                coordinator-error:
                  value:
                    message: Failed to create showing
      security:
        - BearerAuth: []
  /leasing_events:
    post:
      summary: Create leasing events
      description: >
        Create one or more leasing events. Additional event types will be
        supported in future releases.

        Currently only **Assign to User** events are fully supported.  When
        using the "Assign to User" event type the `context` object **must**
        include an `assignedToUserIds` array.
      operationId: postLeasingEvents
      tags:
        - Leasing Events
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostLeasingEventsRequest'
            example:
              events:
                - prospect_id: 12345
                  event_type: Assign to User
                  source: Other
                  notes: Assigning to Alice
                  context:
                    assignedToUserIds:
                      - 1259ef6e-61ee-42cb-b6bd-7fe547569d7c
                    applyActionInBulk: false
      responses:
        '201':
          description: Leasing events created successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LeasingEvent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
          example: Invalid request parameters
        details:
          type: array
          items:
            type: object
          description: Detailed error information
          example:
            - keyword: required
              dataPath: ''
              schemaPath: '#/required'
              params:
                missingProperty: account_id
              message: should have required property 'account_id'
      required:
        - error
    Lockbox:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UuidProperty'
        lockbox_type:
          type: string
          enum:
            - Sentrilock
          description: Type of lockbox
          example: Sentrilock
        serial_number:
          type: string
          description: Serial number of the lockbox
          example: '1234567'
        account_id:
          type: string
          description: ID of the account that owns the lockbox
          example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
        created_at:
          type: string
          format: date-time
          description: Timestamp when the lockbox was created
          example: '2023-01-15T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the lockbox was last updated
          example: '2023-01-16T14:30:00Z'
      required:
        - id
        - lockbox_type
        - serial_number
        - account_id
        - created_at
        - updated_at
    PostLockboxesRequest:
      type: object
      properties:
        lockbox_type:
          type: string
          enum:
            - Sentrilock
          description: Type of lockbox (currently only SentriLock is supported)
          example: Sentrilock
        serial_numbers:
          type: array
          items:
            type: string
            example: '1234567'
          minItems: 1
          maxItems: 100
          description: List of serial numbers for the lockboxes to create
          example:
            - '1234567'
            - '7654321'
        account_id:
          type: string
          description: ID of the account to associate with the lockboxes
          example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
      required:
        - lockbox_type
        - serial_numbers
        - account_id
    PostLockboxTransferAccountsRequest:
      type: object
      properties:
        lockbox_ids:
          type: array
          items:
            type: string
            format: uuid
          minItems: 1
          description: List of lockbox IDs to be transferred to the new account
          example:
            - 123e4567-e89b-12d3-a456-426614174000
            - 123e4567-e89b-12d3-a456-426614174001
        new_account_id:
          type: string
          format: uuid
          description: ID of the account to which the lockboxes should be transferred
          example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
      required:
        - lockbox_ids
        - new_account_id
    LockboxEvent:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UuidProperty'
        lockbox_id:
          type: string
          description: ID of the lockbox
          example: 123e4567-e89b-12d3-a456-426614174000
        event_type:
          type: string
          enum:
            - Install
            - Uninstall
            - Generate Code
          description: Type of event
          example: Install
        unit_id:
          type: string
          description: ID of the unit associated with the event
          example: '12345'
        account_id:
          type: string
          description: ID of the account associated with the event
          example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
        created_at:
          type: string
          format: date-time
          description: Timestamp when the event occurred
          example: '2023-01-15T12:30:00Z'
        metadata:
          type: object
          description: Additional metadata about the event
          example:
            installer_id: user_12345
            notes: Installed on front door
      required:
        - id
        - lockbox_id
        - event_type
        - unit_id
        - created_at
    PostLockboxEventsRequest:
      type: object
      properties:
        events:
          type: array
          items:
            type: object
            properties:
              lockbox_id:
                type: string
                description: ID of the lockbox
                example: 123e4567-e89b-12d3-a456-426614174000
              event_type:
                type: string
                enum:
                  - Install
                  - Uninstall
                description: Type of event
                example: Install
              unit_id:
                type: number
                description: ID of the unit to associate with the event
                example: 12345
            required:
              - lockbox_id
              - event_type
              - unit_id
          minItems: 1
          maxItems: 100
          description: List of lockbox events to create
          example:
            - lockbox_id: 123e4567-e89b-12d3-a456-426614174000
              event_type: Install
              unit_id: 12345
      required:
        - events
    UuidProperty:
      type: string
      format: uuid
      description: Unique identifier
      example: 123e4567-e89b-12d3-a456-426614174000
    LockboxInstallation:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UuidProperty'
        lockbox_id:
          $ref: '#/components/schemas/UuidProperty'
        unit_id:
          type: string
          description: ID of the unit where the lockbox is installed
          example: '12345'
      required:
        - id
        - lockbox_id
        - unit_id
    LeasingEvent:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Unique identifier for the leasing event
          example: 12345
        created_at:
          type: string
          format: date-time
          description: Timestamp when the leasing event was created
          example: '2024-10-05T18:53:03.406168Z'
        notes:
          type: string
          description: Optional notes about the leasing event
          example: Reschedule
        prospect:
          type: integer
          format: int64
          description: ID of the associated prospect
          example: 12345
        planned_date_time:
          type: string
          format: date-time
          description: Planned date and time for the leasing event
          example: '2024-10-05T18:53:03.406168Z'
        source:
          type: string
          description: Source of the leasing event
          enum:
            - Phone Call
            - Text Message
            - Email
            - Facebook Message
            - WhatsApp
            - Other
            - Showing Scheduler
            - Automation
          example: Phone Call
        event_type:
          type: string
          description: Type of the leasing event
          enum:
            - New
            - Contacted, Awaiting Information
            - Showing Desired
            - Showing Scheduled
            - Showing Complete
            - Missed Showing
            - Ghosting
            - Application Sent to Prospect
            - Application Received
            - Application Pending
            - Application in Owner Review
            - Application Approved
            - Withdrawn
            - Application Rejected
            - Prescreen Submitted
            - Prescreen Rejected - Self reported credit
            - Prescreen Rejected - Self reported income
            - Prescreen Rejected - ID Verification
            - Prescreen Approved
            - Looking too early
            - Lease out for signing
            - Lease Signed
            - Deposit Received
            - Move-in Scheduled
            - Moved In
            - Unit of Interest Unavailable
            - Not Interested
            - Duplicate Lead
            - Still Deciding
            - HOA Application Sent To Prospect
            - HOA Application Submitted
            - HOA Application Approved
            - HOA Application Rejected
            - Showing Failed
            - Showing Canceled
            - Showing Confirmed
            - Awaiting PM Response
            - PM Response
            - Arrived for Showing
            - Showing Started
            - Log Note
            - Assign to User
            - Blocklist Prospect
            - Unblock Prospect
            - Reassign Showing
          example: New
        next_follow_up:
          type: string
          format: date-time
          description: Timestamp for the next follow-up
          example: '2024-10-05T18:53:03.406168Z'
        deleted:
          type: boolean
          default: false
          description: Flag indicating if the leasing event is deleted
          example: false
        created_by:
          type: string
          description: Identifier of the user who created the event
          example: '12345'
        context:
          type: object
          description: >-
            Additional context information for the event. Structure varies based
            on event_type.
          example:
            assignedToUserIds:
              - 1259ef6e-61ee-42cb-b6bd-7fe547569d7c
            createdByUserRole: Property Manager
            previousAssignedToUserIds: []
    Unit:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for the unit
          example: 3318
        created_at:
          type: string
          format: date-time
          description: Timestamp when the unit was created
          example: '2024-10-05T18:53:03.406168Z'
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the unit was last updated
          example: '2024-10-05T18:53:03.406168Z'
        address:
          type: integer
          description: ID of the address record associated with this unit
          example: 957
        property_type:
          type: string
          description: Type of property
          example: TOWNHOUSE
          enum:
            - SINGLE FAMILY RESIDENCE
            - DUPLEX
            - TRIPLEX
            - MULTI-FAMILY
            - CONDO
            - TOWNHOUSE
            - ROOM
            - ADU
        bedrooms:
          type: string
          description: Number of bedrooms
          example: '3'
        bathrooms:
          type: string
          description: Number of bathrooms
          example: '2'
        sqft:
          type: string
          description: Square footage of the unit
          example: '1378'
        furnished:
          type: boolean
          description: Whether the unit is furnished
          example: false
        renovated:
          type: string
          description: Whether the unit has been renovated
          example: 'No'
        num_parking_spots:
          type: string
          description: Number of parking spots
          example: '2'
        laundry:
          type: string
          description: Laundry options
          example: In Unit
          enum:
            - In Unit
            - Shared
            - Coin-op
            - Hookups but no machines
            - Machines In Unit - Tenant Responsible
            - None
        target_rental_rate:
          type: string
          description: >-
            Target rental rate for the unit in dollars per month. 1925 means
            $1925/month
          example: '1925'
        is_occupied:
          type: boolean
          description: Whether the unit is currently occupied
          example: false
        earliest_move_in_date:
          type: string
          format: date
          description: Earliest date the unit is available for move-in
          example: '2024-10-12'
        allow_cooperating_brokers:
          type:
            - boolean
            - 'null'
          description: Whether cooperating brokers are allowed
          example: true
        desired_lease_duration_months:
          type: array
          items:
            type: integer
          description: Desired lease duration in months
          example:
            - 12
        pets_allowed:
          type:
            - string
            - 'null'
          enum:
            - 'Yes'
            - Yes with pet fee
            - Dogs only
            - Dogs only with pet fee
            - Cats only
            - Cats only with pet fee
            - 'No'
          description: Pet policy
          example: Yes with pet fee
        pet_restrictions:
          type: string
          description: Restrictions on pets
          example: >-
            A MINIMUM NON-REFUNDABLE pet fee in the amount of $300 per pet is
            required
        hoa_app_required:
          type:
            - boolean
            - 'null'
          description: Whether HOA application is required
          example: true
        hoa_app_fee:
          type:
            - number
            - 'null'
          description: HOA application fee in dollars
          example: 100
        hoa_application_url:
          type:
            - string
            - 'null'
          description: URL for HOA application
          example: https://example.com/application
        key_access:
          type: string
          description: Key access information
          example: I will add this later
          enum:
            - Digital Lockbox Connected to RentEngine
            - Single code lockbox with key
            - Digital door lock with code
            - I will add this later
            - Accompanied Showing
        access_instructions:
          type: string
          description: Instructions for accessing the unit
          example: 'Lockbox/Door Code: Tenant Turner'
        min_resident_qualifications:
          type: string
          description: Minimum qualifications for residents
          example: ''
        utilities_included:
          type: array
          items:
            type: string
            enum:
              - Water
              - Sewer/Septic
              - Trash
              - Wifi/Internet
              - Cable/TV
              - Electricity
              - Gas
              - HOA
              - Lawn Care
              - Pool Service
              - Pest Control
          description: Utilities included in rent
          example:
            - Lawn Care
            - Trash
        parking_type:
          type: array
          items:
            type: string
            enum:
              - Street
              - Carport
              - Assigned Spots
              - Driveway
              - Shared Garage
              - Private Garage
              - Paid Parking
          description: Type of parking available
          example:
            - Assigned Spots
        storm_protection:
          type: string
          description: Storm protection features
          example: None
        status:
          type: string
          description: Current status of the unit
          example: Leased
        send_showing_notifications:
          type: boolean
          description: Whether to send showing notifications
          example: true
        send_leasing_update_email:
          type: boolean
          description: Whether to send leasing update emails
          example: true
        extracted_from:
          type: string
          description: >-
            Source of the unit data. Can be a any string. Essentially the same
            as an external_id. Uniqueness is not enforced.
          example: f123abc
        marketing_description:
          type: string
          description: Marketing description of the unit
          example: >-
            **AVAILABLE NOW** 3 Bedroom 2 Bathroom Townhome For Rent in Meadow
            Woods!
        marketing_photos:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: >-
                  Either the original image URL or the file path in the
                  RentEngine storage. When updating, provide the external image
                  url.
                examples:
                  - images/92fdf304-9f60-45ff-b44a-e5b2d16b5257.jpg
                  - >-
                    https://images.cdn.appfolio.com/allegiant/images/8eb1431e-d325-4a43-9fbc-cea487e609f1/large.jpeg
              hidden:
                type: boolean
                example: false
              original:
                description: >-
                  The external image URL from where the image was imported to
                  RentEngine. Not required as it will be set/overwritten by
                  RentEngine when setting the path field.
                type:
                  - string
                  - 'null'
                example: >-
                  https://images.cdn.appfolio.com/allegiant/images/8eb1431e-d325-4a43-9fbc-cea487e609f1/large.jpeg
          description: Photos of the unit
        commission_amount:
          type: string
          description: Commission amount
          example: '1'
        commission_type:
          type: string
          description: Type of commission
          enum:
            - percent
            - fixed
            - none
            - contact_mls_agent
          example: none
        imported_by:
          type:
            - string
            - 'null'
          description: Who/what imported the unit
          example: Rentvine Sync
        floor_number:
          type: integer
          description: >-
            Floor number of the unit. Best to use the floor of the entrance door
            if the unit spans multiple floors.
          example: 1
        has_elevator:
          type:
            - boolean
            - 'null'
          description: Whether the building has an elevator
          example: false
        hoa_details:
          type: object
          properties:
            isInHOA:
              type: boolean
              example: true
            hoaAmenities:
              type: array
              items:
                type: string
              example:
                - Clubhouse
                - Pool
          description: Details about the HOA
        account_id:
          type: string
          format: uuid
          description: >-
            ID of the account that owns the unit. Must be a valid account for
            which the api key has access.
          example: 269bf205-d876-42f5-988d-6f40891df58a
        owner_emails:
          type: array
          items:
            type: string
          description: Email addresses of the owners
          example:
            - rick@amgrents.com
        accepts_vouchers:
          type:
            - boolean
            - 'null'
          description: Whether the unit accepts housing vouchers.
          example: true
        internal_notes:
          type:
            - string
            - 'null'
          description: Internal notes about the unit.
          example: Garage work scheduled for Monday.
        amenities:
          type: array
          items:
            type: string
          description: All amenities of the unit
          example:
            - Dishwasher
            - Stove
            - Range Oven
            - Refrigerator
        monthly_fees:
          type:
            - array
            - 'null'
          items:
            type: object
            properties:
              name:
                type: string
                example: Resident Benefit Package
              amount:
                type: number
                example: 55.5
                description: >-
                  Depending on the type field, this can represet either $55.50
                  of 55.5% of 1 month's rent.
              type:
                enum:
                  - percent
                  - dollar
                type: string
                description: >-
                  Determines if  amount is calculated as an absolute dollar
                  value or as a percent of 1 month's rent.
                example: dollar
          description: Monthly recurring fees
        move_in_fees:
          type:
            - array
            - 'null'
          items:
            type: object
            properties:
              name:
                type: string
                example: Admin Fee
              amount:
                type: number
                example: 55.5
                description: >-
                  Depending on the type field, this can represet either $55.50
                  of 55.5% of 1 month's rent.
              type:
                enum:
                  - percent
                  - dollar
                type: string
                description: >-
                  Determines if  amount is calculated as an absolute dollar
                  value or as a percent of 1 month's rent.
                example: dollar
          description: Fees required at move-in
        multifamily_property_id:
          type:
            - string
            - 'null'
          format: uuid
          description: ID of the multifamily property
          example: 421e4567-e89b-12d3-a456-426614174000
        showing_method:
          type:
            - string
            - 'null'
          description: Method for showing the unit
          example: Remote Guided
          enum:
            - Accompanied
            - Remote Guided
            - Remote Guided with Gated Access
            - Self Guided
        floorplans_id:
          type:
            - string
            - 'null'
          format: uuid
          description: ID of the floorplan
          example: 451e4567-e89b-12d3-a456-426614174000
        video_url:
          type:
            - string
            - 'null'
          format: url
          description: >-
            URL of video tour (such as YouTube, Vimeo, Zillow Tour, Matterport,
            Ricoh360, or zInspector tour)
          example: https://www.youtube.com/watch?v=1234567890
        subteam_id:
          type:
            - string
            - 'null'
          format: uuid
          description: ID of the subteam managing the unit
          example: 123e4567-e89b-12d3-a456-426614174000
        prescreen_template_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            ID of the prescreening template to use for this unit, if it is null
            the default template will be used.
          example: 123e4567-e89b-12d3-a456-426614174000
        structured_access_instructions:
          type: object
          description: >
            Structured access instructions that vary based on showing_method:

            - For "Self Guided" showing method: Use the self-guided showing
            instructions object

            - For "Remote Guided" or "Remote Guided with Gated Access" showing
            methods: Use the self-guided showing instructions object

            - For "Accompanied" showing method: Use either the legacy
            accompanied or accompanied showing instructions object


            When updating structured_access_instructions, the showing_method
            field must also be set.
          oneOf:
            - type: object
              description: >-
                Self-guided showing instructions (for "Self Guided", "Remote
                Guided", or "Remote Guided with Gated Access" showing methods)
              title: Self Guided/Remote Showing Instructions
              properties:
                lockbox_location:
                  type: string
                  example: Front Door
                  description: Location of the lockbox
                lockbox_door_code:
                  type: string
                  example: '1234'
                  description: Code for the lockbox
                private_gate_code:
                  type: string
                  example: '5678'
                  description: Code for private gate access
                community_gate_code:
                  type: string
                  example: '9012'
                  description: Code for community gate access
                anything_else:
                  type: string
                  example: Please close the gate behind you
                  description: Additional instructions
            - type: object
              description: >-
                Accompanied showing instructions (for "Accompanied" showing
                method)
              title: Accompanied Showing Instructions
              properties:
                assigned_user_ids:
                  type: array
                  items:
                    type: string
                  example:
                    - cd702dbe-bf32-41cc-83a2-efe00f495f04
                    - 98702dbe-bf32-41cc-83a2-efe00f495f04
                  description: IDs of users assigned to conduct the showing
                pmPhones:
                  type: array
                  items:
                    type: string
                  example:
                    - '+15551234567'
                    - +1 555-987-6543
                  description: Property manager contact phone numbers
                meeting_location:
                  type: string
                  example: Leasing office
                  description: Where to meet for the showing
                internal_notes:
                  type: string
                  example: Current tenant works from home
                  description: Notes for internal use
                current_tenant_phone:
                  type: string
                  example: 555-111-2222
                  deprecated: true
                  description: Current tenant's contact phone
                current_tenant_phones:
                  type: array
                  items:
                    type: string
                    example: 555-111-2222
                    description: Current tenant's contact phone
                current_tenant_name:
                  type: string
                  example: Jane Doe
                  description: Current tenant's name
                min_notice_period_hours:
                  type: number
                  example: 24
                  description: Minimum notice required before showing (in hours)
                assign_to_best_agent:
                  type: boolean
                  example: false
                  description: Whether to automatically assign to the best available agent
              required:
                - assigned_user_ids
        enable_send_report:
          type: boolean
          description: Whether to enable sending reports
          example: true
        earliest_showing_date:
          type: string
          format: date
          description: Earliest date the unit can be shown
          example: '2024-10-12'
        security_deposit_amount:
          type:
            - number
            - 'null'
          description: Amount of security deposit in dollars. 1000 means $1000.21
          example: 1000.21
        require_last_month_rent:
          type:
            - boolean
            - 'null'
          description: Whether last month's rent is required upfront
          example: true
        requires_voucher:
          type:
            - boolean
            - 'null'
          description: Whether a voucher is required
          example: false
        custom_application_url:
          type: string
          description: URL for custom application
          example: >-
            https://app.findigs.com/apply/unitid=70f51c4c-d708-402e-9a5f-bb6fd60b6cf2
        include_feedback_leasing_report:
          type: boolean
          description: Whether to include feedback in leasing reports
          example: true
        year_built:
          type:
            - number
            - 'null'
          description: Year the property was built
          example: 2020
          minimum: 1800
        application_fee:
          type:
            - number
            - 'null'
          description: Application fee amount in dollars
          example: 50
          minimum: 0
      required:
        - id
        - created_at
        - updated_at
        - address
        - enable_send_report
        - showing_method
    UpsertUnitRequest:
      type: object
      properties:
        id:
          type: number
          description: >-
            Unit ID. If provided, the unit will be updated; if not, a new unit
            will be created.
          example: 3318
        address:
          type: object
          description: Unit address. All fields must be provided together when updating.
          properties:
            street_number:
              type: string
              description: Street number
              example: '123'
            street_name:
              type: string
              description: Street name
              example: Main St
            unit:
              type: string
              description: Unit/apartment number
              example: 4B
            zip_code:
              type: string
              description: ZIP code
              example: '12345'
            state:
              type: string
              description: State (two-letter code)
              example: CA
            country:
              type: string
              enum:
                - United States
              default: United States
              description: Country
              example: United States
            city:
              type: string
              description: City
              example: San Francisco
          required:
            - street_number
            - street_name
            - zip_code
            - state
            - city
        property_type:
          type: string
          enum:
            - SINGLE FAMILY RESIDENCE
            - DUPLEX
            - TRIPLEX
            - MULTI-FAMILY
            - CONDO
            - TOWNHOUSE
            - ROOM
            - ADU
          description: Type of property
          example: TOWNHOUSE
        bedrooms:
          type: number
          description: Number of bedrooms
          example: 3
        bathrooms:
          type: number
          description: Number of bathrooms
          example: 2
        sqft:
          type: number
          description: Square footage of the unit
          example: 1378
        furnished:
          type: boolean
          description: Whether the unit is furnished
          example: false
        renovated:
          type: string
          description: Whether the unit has been renovated
          example: 'No'
        num_parking_spots:
          type: number
          description: Number of parking spots
          example: 2
        laundry:
          type: string
          enum:
            - In Unit
            - Shared
            - Coin-op
            - Hookups but no machines
            - Machines In Unit - Tenant Responsible
            - None
          description: Laundry options
          example: In Unit
        target_rental_rate:
          type: number
          description: Target rental rate in dollars per month
          example: 1925
        is_occupied:
          type: boolean
          description: Whether the unit is currently occupied
          example: false
        earliest_move_in_date:
          type: string
          format: date
          description: Earliest date the unit is available for move-in
          example: '2024-10-12'
        allow_cooperating_brokers:
          type: boolean
          description: Whether cooperating brokers are allowed
          example: true
        desired_lease_duration_months:
          type: array
          items:
            type: number
          description: Desired lease duration in months
          example:
            - 12
        pets_allowed:
          type: string
          enum:
            - 'Yes'
            - Yes with pet fee
            - 'No'
            - Dogs only
            - Dogs only with pet fee
            - Cats only
            - Cats only with pet fee
          description: Pet policy
          example: Yes with pet fee
        pet_restrictions:
          type: string
          description: Restrictions on pets
          example: >-
            A MINIMUM NON-REFUNDABLE pet fee in the amount of $300 per pet is
            required
        hoa_details:
          type: object
          properties:
            isInHOA:
              type: boolean
              description: Whether the unit is in an HOA
              example: true
            hoaAppRequired:
              type: boolean
              description: Whether HOA application is required
              example: true
            hoaAppFee:
              type: number
              minimum: 0
              description: HOA application fee in dollars
              example: 100
            hoaApplicationUrl:
              type: string
              format: uri
              description: URL for HOA application
              example: https://example.com/application
            hoaApprovalTimeframe:
              type: string
              description: Timeframe for HOA approval
              example: 2 weeks
            hoaAmenities:
              type: array
              items:
                type: string
              description: HOA amenities
              example:
                - Pool
                - Gym
                - Clubhouse
        key_access:
          type: string
          description: Key access information
          example: Digital door lock with code
          enum:
            - Digital Lockbox Connected to RentEngine
            - Single code lockbox with key
            - Digital door lock with code
            - I will add this later
            - Accompanied Showing
        structured_access_instructions:
          type: object
          description: >
            Structured access instructions that vary based on showing_method.

            When providing structured_access_instructions, showing_method must
            also be set.
          oneOf:
            - type: object
              description: Self-guided showing instructions
              title: Self-guided/Remote showing instructions
              properties:
                lockbox_location:
                  type: string
                  description: Location of the lockbox
                  example: Front Door
                lockbox_code:
                  type: string
                  description: Code for the lockbox
                  example: '1234'
                private_gate:
                  type: string
                  description: Private gate information
                  example: 'Gate code: 5678'
                community_gate:
                  type: string
                  description: Community gate information
                  example: 'Gate code: 9012'
                anything_else:
                  type: string
                  description: Additional instructions
                  example: Please close the gate behind you
            - type: object
              description: Accompanied showing instructions
              title: Accompanied Showing Instructions
              properties:
                assigned_user_ids:
                  type: array
                  items:
                    type: string
                  description: IDs of users assigned to conduct the showing
                  example:
                    - user-123
                    - user-456
                pmPhones:
                  type: array
                  items:
                    type: string
                    examples:
                      - 555-123-4567
                      - 555-987-6543
                    description: Property manager contact phone numbers
                meeting_location:
                  type: string
                  description: Where to meet for the showing
                  example: Leasing office
                internal_notes:
                  type: string
                  description: Notes for internal use
                  example: Current tenant works from home
                current_tenant_phone:
                  type: string
                  description: Current tenant's contact phone
                  example: 555-111-2222
                  deprecated: true
                current_tenant_phones:
                  type: array
                  items:
                    type: string
                    example: 555-111-2222
                    description: Current tenant's contact phone
                current_tenant_name:
                  type: string
                  description: Current tenant's name
                  example: Jane Doe
                min_notice_period_hours:
                  type: number
                  description: Minimum notice required before showing (in hours)
                  example: 24
                assign_to_best_agent:
                  type: boolean
                  description: Whether to automatically assign to the best available agent
                  example: false
        earliest_showing_date:
          type: string
          format: date
          description: Earliest date the unit can be shown
          example: '2024-10-12'
        additional_info:
          type: string
          description: Additional information about the unit
          example: Newly renovated kitchen
        min_resident_qualifications:
          type: string
          description: Minimum qualifications for residents
          example: Credit score 650+, income 3x rent
        utilities_included:
          type: array
          items:
            type: string
            enum:
              - Water
              - Sewer/Septic
              - Trash
              - Wifi/Internet
              - Cable/TV
              - Electricity
              - Gas
              - HOA
              - Lawn Care
              - Pool Service
              - Pest Control
          description: Utilities included in rent
          example:
            - Lawn Care
            - Trash
        parking_type:
          type: array
          items:
            type: string
            enum:
              - Street
              - Carport
              - Assigned Spots
              - Driveway
              - Shared Garage
              - Private Garage
              - Paid Parking
              - Parking Lot
          description: Type of parking available
          example:
            - Assigned Spots
        status:
          type: string
          enum:
            - Incomplete
            - Available
            - On Hold
            - Leased
            - Archived
            - Withdrawn
            - Withdrawal Requested
          description: Current status of the unit
          example: Available
        extracted_from:
          type: string
          description: >-
            Source of the unit data. Can be a any string. Essentially the same
            as an external_id. Uniqueness is not enforced.
          example: f123abc
        marketing_description:
          type: string
          description: Marketing description of the unit
          example: '**AVAILABLE NOW** 3 Bedroom 2 Bathroom Townhome For Rent!'
        marketing_photos:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: >-
                  Either the original image URL or the file path in the
                  RentEngine storage
                example: https://example.com/images/unit123.jpg
              hidden:
                type: boolean
                description: Whether the photo is hidden
                example: false
              original:
                type: string
                description: The external image URL from where the image was imported
                example: https://example.com/images/unit123_original.jpg
            required:
              - path
              - hidden
        commission_amount:
          type: number
          description: Commission amount
          example: 1
        commission_type:
          type: string
          enum:
            - percent
            - fixed
            - none
            - contact_mls_agent
          description: Type of commission
          example: percent
        imported_by:
          type: string
          description: Who/what imported the unit
          example: API Import
        floor_number:
          type: number
          minimum: 0
          maximum: 150
          description: Floor number of the unit
          example: 1
        has_elevator:
          type: boolean
          description: Whether the building has an elevator
          example: false
        account_id:
          type: string
          description: ID of the account that owns the unit
          example: 269bf205-d876-42f5-988d-6f40891df58a
        owner_emails:
          type: array
          items:
            type: string
          description: Email addresses of the owners
          example:
            - owner@example.com
        accepts_vouchers:
          type: boolean
          description: Whether the unit accepts housing vouchers
          example: true
        showing_method:
          type: string
          enum:
            - Accompanied
            - Remote Guided
            - Remote Guided with Gated Access
            - Self Guided
          description: Method for showing the unit
          example: Self Guided
        internal_notes:
          type: string
          description: Internal notes about the unit
          example: Garage work scheduled for Monday
        move_in_fees:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - percent
                  - dollar
                description: Type of fee calculation
                example: dollar
              amount:
                type: number
                minimum: 0
                description: Fee amount
                example: 150
              name:
                type: string
                description: Name of the fee
                example: Admin Fee
            required:
              - type
              - amount
              - name
        monthly_fees:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - percent
                  - dollar
                description: Type of fee calculation
                example: dollar
              amount:
                type: number
                minimum: 0
                description: Fee amount
                example: 50
              name:
                type: string
                description: Name of the fee
                example: Pet Fee
            required:
              - type
              - amount
              - name
        multifamily_property_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            ID of the multifamily property. Pass string 'null' to clear this
            field.
          example: 421e4567-e89b-12d3-a456-426614174000
        floorplans_id:
          type:
            - string
            - 'null'
          format: uuid
          description: ID of the floorplan. Pass string 'null' to clear this field.
          example: 451e4567-e89b-12d3-a456-426614174000
        video_url:
          type: string
          description: >-
            URL of video tour (such as YouTube, Vimeo, Zillow Tour, Matterport,
            Ricoh360, or zInspector tour)
          example: https://www.youtube.com/watch?v=1234567890
        subteam_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            ID of the subteam managing the unit. Pass string 'null' to clear
            this field.
          example: 123e4567-e89b-12d3-a456-426614174000
        prescreen_template_id:
          type: string
          format: uuid
          description: ID of the prescreening template to use for this unit
          example: 123e4567-e89b-12d3-a456-426614174000
        enable_send_report:
          type: boolean
          description: Whether to enable sending reports
          example: true
        security_deposit_amount:
          type: number
          description: Amount of security deposit in dollars
          example: 1000
        require_last_month_rent:
          type: boolean
          description: Whether last month's rent is required upfront
          example: true
        requires_voucher:
          type: boolean
          description: Whether a voucher is required
          example: false
        include_feedback_leasing_report:
          type: boolean
          description: Whether to include feedback in leasing reports
          example: true
        year_built:
          type: number
          description: Year the property was built
          example: 2020
          minimum: 1800
        after_upsert_action:
          type: object
          description: Actions to perform after updating the unit
          properties:
            action:
              type: string
              enum:
                - cancel_scheduled_bookings
                - notify_all_prospects
              description: The action to perform after updating the unit
              example: cancel_scheduled_bookings
            should_cancel_scheduled_bookings:
              type: boolean
              description: >-
                Whether to cancel any scheduled/confirmed bookings when updating
                the unit (only applies to cancel_scheduled_bookings action)
              example: true
            custom_sms_message:
              type: string
              description: Custom SMS message to send to prospects (applies to all actions)
              example: >-
                Hi, the unit is available for showing. Please contact us at
                (555) 123-4567 with any questions.
          required:
            - action
        application_fee:
          type: number
          description: Application fee amount in dollars
          example: 50
          minimum: 0
      oneOf:
        - required:
            - id
          title: Create New Unit
        - required:
            - address
            - property_type
            - target_rental_rate
            - account_id
          title: Update Unit
    WebhookPayload:
      type: object
      description: Generic structure of webhook payloads
      oneOf:
        - $ref: '#/components/schemas/InsertPayload'
        - $ref: '#/components/schemas/UpdatePayload'
        - $ref: '#/components/schemas/DeletePayload'
    InsertPayload:
      type: object
      properties:
        type:
          type: string
          enum:
            - INSERT
          description: Type of event
          example: INSERT
        table:
          type: string
          description: Name of the table where the event occurred
          example: lockbox_events
        record:
          type: object
          description: The newly created record
          example:
            id: 123e4567-e89b-12d3-a456-426614174000
            lockbox_id: 123e4567-e89b-12d3-a456-426614174001
            event_type: Install
            unit_id: '12345'
            created_at: '2023-01-15T12:30:00Z'
            data: null
        old_record:
          type: 'null'
          description: Always null for INSERT events
          example: null
      required:
        - type
        - table
        - record
        - old_record
    UpdatePayload:
      type: object
      properties:
        type:
          type: string
          enum:
            - UPDATE
          description: Type of event
          example: UPDATE
        table:
          type: string
          description: Name of the table where the event occurred
          example: units
        record:
          type: object
          description: The updated record with new values
          example:
            id: 3318
            address: 957
            property_type: TOWNHOUSE
            target_rental_rate: '2000'
            updated_at: '2024-10-05T18:53:03.406168Z'
        old_record:
          type: object
          description: The record before the update
          example:
            id: 3318
            address: 957
            property_type: TOWNHOUSE
            target_rental_rate: '1925'
            updated_at: '2024-09-05T18:53:03.406168Z'
      required:
        - type
        - table
        - record
        - old_record
    DeletePayload:
      type: object
      properties:
        type:
          type: string
          enum:
            - DELETE
          description: Type of event
          example: DELETE
        table:
          type: string
          description: Name of the table where the event occurred
          example: lockboxes
        record:
          type: 'null'
          description: Always null for DELETE events
          example: null
        old_record:
          type: object
          description: The record that was deleted
          example:
            id: 123e4567-e89b-12d3-a456-426614174000
            lockbox_type: Sentrilock
            serial_number: '1234567'
            account_id: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
      required:
        - type
        - table
        - record
        - old_record
    MultifamilyProperty:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the multifamily property
          example: 123e4567-e89b-12d3-a456-426614174000
        community_name:
          type: string
          description: Name of the multifamily community
          example: Sunset Towers
        building_count:
          type: integer
          description: Number of buildings in the property
          example: 3
          minimum: 1
          maximum: 100
        unit_count:
          type: integer
          description: Total number of units in the property
          example: 75
          minimum: 1
          maximum: 10000
        description:
          type: string
          description: Description of the property
          example: Luxury apartment community with amenities
        structure_type:
          type: string
          enum:
            - Mid Rise
            - High Rise
            - Garden Style
          description: Type of building structure
          example: Mid Rise
        year_built:
          type: integer
          description: Year the property was built
          example: 2008
          minimum: 1800
          maximum: 2025
        photos:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: URL or path to the property photo
                example: https://example.com/images/sunset-towers.jpg
              hidden:
                type: boolean
                description: Whether the photo is hidden
                example: false
            required:
              - path
              - hidden
          description: Photos of the property
        external_ids:
          type: object
          description: External identifiers for the property
          example:
            mls_id: MLS12345
            yardi_id: Y7890
        text_address:
          type: string
          description: Full text address of the property
          example: 123 Main St, San Francisco, CA 94111
        account_id:
          type: string
          format: uuid
          description: ID of the account that owns the property
          example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
        created_at:
          type: string
          format: date-time
          description: Timestamp when the property was created
          example: '2023-01-15T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the property was last updated
          example: '2023-01-16T14:30:00Z'
      required:
        - id
        - community_name
        - text_address
        - account_id
        - created_at
        - updated_at
    UpsertMultifamilyPropertyRequest:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: >-
            Unique identifier for the multifamily property. If provided, the
            property will be updated; if not, a new property will be created.
          example: 123e4567-e89b-12d3-a456-426614174000
        community_name:
          type: string
          description: Name of the multifamily community
          example: Sunset Towers
        building_count:
          type: integer
          description: Number of buildings in the property
          example: 3
          minimum: 1
          maximum: 100
        unit_count:
          type: integer
          description: Total number of units in the property
          example: 75
          minimum: 1
          maximum: 10000
        description:
          type: string
          description: Description of the property
          example: Luxury apartment community with amenities
        structure_type:
          type: string
          enum:
            - Mid Rise
            - High Rise
            - Garden Style
          description: Type of building structure
          example: Mid Rise
        year_built:
          type: integer
          description: Year the property was built
          example: 2008
          minimum: 1800
        photos:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: URL or path to the property photo
                example: https://example.com/images/sunset-towers.jpg
              hidden:
                type: boolean
                description: Whether the photo is hidden
                example: false
            required:
              - path
              - hidden
          description: Photos of the property
        external_ids:
          type: object
          description: External identifiers for the property
          example:
            mls_id: MLS12345
            yardi_id: Y7890
        text_address:
          type: string
          description: Full text address of the property
          example: 123 Main St, San Francisco, CA 94111
        account_id:
          type: string
          format: uuid
          description: >-
            ID of the account that owns the property. Must be a valid account ID
            that the API key has access to.
          example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
        deleted:
          type: boolean
          description: Whether the property is deleted
          example: false
          default: false
      required:
        - community_name
        - text_address
        - account_id
        - structure_type
        - year_built
        - building_count
        - unit_count
        - photos
      additionalProperties: false
    Floorplan:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the floorplan
          example: 123e4567-e89b-12d3-a456-426614174000
        multifamily_property_id:
          type: string
          format: uuid
          description: ID of the multifamily property this floorplan belongs to
          example: 123e4567-e89b-12d3-a456-426614174000
        name:
          type: string
          description: Name of the floorplan
          example: The Willow
        bedroom_count:
          type: integer
          description: Number of bedrooms
          example: 2
          minimum: 0
          maximum: 100
        bathroom_count:
          type: number
          description: Number of bathrooms
          example: 2.5
          minimum: 0
          maximum: 100
        unit_count:
          type: integer
          description: Total number of units with this floorplan
          example: 15
          minimum: 0
          maximum: 10000
        units_available:
          type: integer
          description: Number of units currently available with this floorplan
          example: 3
          minimum: 0
          maximum: 10000
        market_rent:
          type: number
          description: Market rent for this floorplan
          example: 1850
          minimum: 0
        min_sqft:
          type: integer
          description: Minimum square footage for this floorplan
          example: 950
          minimum: 0
          maximum: 1000000
        max_sqft:
          type: integer
          description: Maximum square footage for this floorplan
          example: 1100
          minimum: 0
          maximum: 1000000
        photos:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: URL or path to the floorplan photo
                example: https://example.com/images/willow-floorplan.jpg
              hidden:
                type: boolean
                description: Whether the photo is hidden
                example: false
            required:
              - path
          description: Photos of the floorplan
        created_at:
          type: string
          format: date-time
          description: Timestamp when the floorplan was created
          example: '2023-01-15T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the floorplan was last updated
          example: '2023-01-16T14:30:00Z'
        deleted:
          type: boolean
          description: Whether the floorplan is deleted
          example: false
          default: false
        description:
          type: string
          description: Description of the floorplan
          example: Spacious 2-bedroom layout with modern finishes
      required:
        - id
        - multifamily_property_id
        - created_at
        - updated_at
        - deleted
    UpsertFloorplanRequest:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: >-
            Unique identifier for the floorplan. If provided, the floorplan will
            be updated; if not, a new floorplan will be created.
          example: 123e4567-e89b-12d3-a456-426614174000
        multifamily_property_id:
          type: string
          format: uuid
          description: ID of the multifamily property this floorplan belongs to
          example: 123e4567-e89b-12d3-a456-426614174000
        name:
          type: string
          description: Name of the floorplan
          example: The Willow
        bedroom_count:
          type: integer
          description: Number of bedrooms
          example: 2
          minimum: 0
        bathroom_count:
          type: number
          description: Number of bathrooms
          example: 2.5
          minimum: 0
        unit_count:
          type: integer
          description: Total number of units with this floorplan
          example: 15
          minimum: 0
        units_available:
          type: integer
          description: Number of units currently available with this floorplan
          example: 3
          minimum: 0
        market_rent:
          type: number
          description: Market rent for this floorplan
          example: 1850
          minimum: 0
        min_sqft:
          type: integer
          description: Minimum square footage for this floorplan
          example: 950
          minimum: 0
        max_sqft:
          type: integer
          description: Maximum square footage for this floorplan
          example: 1100
          minimum: 0
        photos:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: URL or path to the floorplan photo
                example: https://example.com/images/willow-floorplan.jpg
              hidden:
                type: boolean
                description: Whether the photo is hidden
                example: false
            required:
              - path
              - hidden
          description: Photos of the floorplan
        deleted:
          type: boolean
          description: Whether the floorplan is deleted
          example: false
          default: false
        description:
          type: string
          description: Description of the floorplan
          example: Spacious 2-bedroom layout with modern finishes
      required:
        - multifamily_property_id
      additionalProperties: false
    Prospect:
      type: object
      properties:
        id:
          type: number
          description: Unique identifier for the prospect
          example: 123
        name:
          type:
            - string
            - 'null'
          description: Prospect's name
          example: John Doe
        email:
          type:
            - string
            - 'null'
          description: Prospect's email address
          example: john@example.com
        phone:
          type:
            - string
            - 'null'
          description: Prospect's phone number
          example: '+15551234567'
        status:
          type: string
          description: Current status of the prospect
          example: Showing Scheduled
        source:
          type:
            - string
            - 'null'
          description: Where the prospect came from
          example: Zillow
        unit_of_interest:
          type: number
          description: ID of the unit the prospect is interested in
          example: 123
        notes:
          type:
            - string
            - 'null'
          description: Notes about the prospect
          example: Interested in 2BR units
        prescreened:
          type:
            - boolean
            - 'null'
          description: Whether the prospect has been prescreened
          example: true
        voucher_holder:
          type:
            - boolean
            - 'null'
          description: Whether the prospect holds a housing voucher
          example: false
        normalized_phone_number_generated:
          type:
            - string
            - 'null'
          description: Normalized phone number if normalizable. Else null.
          example: '+15551234567'
        license_number:
          type:
            - string
            - 'null'
          description: License number if applicable
          example: ABC123
        prospect_type:
          type: string
          description: Type of prospect
          enum:
            - Self
            - Agent
          example: Self
        created_at:
          type: string
          format: date-time
          description: When the prospect was created
          example: '2023-01-15T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          description: When the prospect was last updated
          example: '2023-01-16T14:30:00Z'
    PostGenerateLockboxCodeRequest:
      type: object
      properties:
        lockbox_id:
          type: string
          format: uuid
          description: >-
            ID of the lockbox. Either this, serial_number, or unit_id must be
            provided.
          example: 123e4567-e89b-12d3-a456-426614174000
        serial_number:
          type: string
          description: >-
            Serial number of the lockbox. Either this, lockbox_id, or unit_id
            must be provided.
          example: '1234567'
        unit_id:
          type: number
          description: >-
            ID of the unit where the lockbox is installed. Either this,
            lockbox_id, or serial_number must be provided.
          example: 12345
        date:
          type: string
          format: date
          description: Date for which the code should be valid (YYYY-MM-DD format)
          example: '2024-03-15'
        created_for:
          type: string
          description: >-
            Optional name or identifierof the person the code is being created
            for
          example: John Doe
        code_type:
          type: string
          description: >-
            Type of code to generate. Only relevant for Sentrilock lockboxes.
            All other boxes can only generate ACCESS codes.
          example: ACCESS
          default: ACCESS
          enum:
            - ACCESS
            - SHACKLE
      required:
        - date
      oneOf:
        - required:
            - lockbox_id
          title: By Lockbox ID
          description: Generate a code for a specific lockbox by providing the lockbox ID.
        - required:
            - serial_number
          title: By Serial Number
          description: >-
            Generate a code for a specific lockbox by providing the serial
            number.
        - required:
            - unit_id
          title: By Unit ID
          description: >-
            Generate a code for a specific unit by providing the unit ID that
            the box is installed on.
      additionalProperties: false
    Subteam:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the subteam
          example: 123e4567-e89b-12d3-a456-426614174000
        name:
          type: string
          description: Name of the subteam
          example: Marketing Team
        account_id:
          type: string
          format: uuid
          description: ID of the account to associate with the subteam
          example: cd702dbe-bf32-41cc-83a2-efe00f495f04
      required:
        - id
        - name
        - description
        - members
    PrescreeningTemplate:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the prescreening template
          example: 123e4567-e89b-12d3-a456-426614174000
        name:
          type: string
          description: Name of the prescreening template
          example: Default Template
        rules:
          type: object
          description: Rules for prescreening
          properties:
            minimumCreditScore:
              type: number
              description: Minimum credit score required
              example: 600
            minimumIncomeRentMultiplier:
              type: number
              description: Minimum income as multiple of rent
              example: 2.5
            enableVoIPPhoneVerification:
              type: boolean
              description: Whether to enable VoIP phone verification
              example: true
            enableIDVerification:
              type: boolean
              description: Whether to enable ID verification
              example: true
            enableSelfieVerification:
              type: boolean
              description: Whether to enable selfie verification
              example: true
            allowIDWithoutExpiryDate:
              type: boolean
              description: Whether to allow IDs without expiry date
              example: false
            allowIDExpiredInDays:
              type: number
              description: Number of days an expired ID is still acceptable
              example: 30
            minimumAge:
              type: number
              description: Minimum age required
              example: 18
            enableShowingLocationVerification:
              type: boolean
              description: Whether to enable showing location verification
              example: true
        questions:
          type: array
          items:
            type: object
            properties:
              fixedQuestionType:
                type: string
                description: Fixed question type (if any)
                example: housing_voucher
              question:
                type: string
                description: Question text
                example: Do you have a housing voucher (e.g. Section 8)?
              type:
                type: string
                description: Question type
                example: yes_no
              rejectAnswers:
                type: array
                items:
                  type: string
                description: Answers that cause rejection
                example:
                  - 'Yes'
          description: List of prescreening questions
          example:
            - fixedQuestionType: housing_voucher
              question: Do you have a housing voucher (e.g. Section 8)?
              type: yes_no
              rejectAnswers: []
            - question: Have you been convicted of a felony?
              type: yes_no
              rejectAnswers:
                - 'Yes'
        isDefault:
          type: boolean
          description: Whether this is the default template
          example: true
        accountId:
          type: string
          description: ID of the account that owns the template
          example: 4b88ff32-8ba0-4bbf-8e60-c789909ac176
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the template was created
          example: '2023-01-15T12:00:00Z'
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the template was last updated
          example: '2023-01-16T14:30:00Z'
      required:
        - id
        - name
        - rules
        - questions
        - isDefault
        - accountId
        - createdAt
        - updatedAt
    PostLeasingEventsRequest:
      type: object
      properties:
        events:
          type: array
          minItems: 1
          maxItems: 1
          description: >-
            List of leasing events to create. Only 1 event is supported at a
            time.
          items:
            type: object
            properties:
              prospect_id:
                type: number
                description: ID of the prospect associated with the event
                example: 12345
              event_type:
                type: string
                description: >-
                  Type of leasing event. Currently only "Assign to User" is
                  supported.
                example: Assign to User
              source:
                type: string
                description: Source of the leasing event
                enum:
                  - Phone Call
                  - Text Message
                  - Email
                  - Facebook Message
                  - WhatsApp
                  - Other
                  - Automation
                example: Other
              notes:
                type: string
                description: Optional notes for the event
                example: Assigning to primary agent
              context:
                type: object
                description: >
                  Additional context for the event.  For "Assign to User" events
                  the following fields are recognized:

                  - `assignedToUserIds` (array[uuid], required)

                  - `applyActionInBulk` (boolean) - This will apply the action
                  to all prospects with the same phone number. This is helpful
                  for bulk assigning all units that the prospect is interested
                  in to a single agent in one request.
                example:
                  assignedToUserIds:
                    - 1259ef6e-61ee-42cb-b6bd-7fe547569d7c
                  applyActionInBulk: false
            required:
              - prospect_id
              - event_type
      required:
        - events
    TimeInterval:
      type: object
      properties:
        start:
          type: string
          format: date-time
          description: Start time of the showing window
          example: '2024-03-15T10:00:00Z'
        end:
          type: string
          format: date-time
          description: End time of the showing window
          example: '2024-03-15T10:30:00Z'
        invitedUserIdsArray:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Array of user IDs invited for this showing window (for accompanied
            showings)
          example:
            - 1259ef6e-61ee-42cb-b6bd-7fe547569d7c
        showingMethodsAvailable:
          type: array
          items:
            type: string
            enum:
              - Accompanied
              - Remote Guided
              - Remote Guided with Gated Access
              - Self Guided
          description: Available showing methods for this time slot
          example:
            - Accompanied
            - Self Guided
      required:
        - start
        - end
    UnitShowingAvailability:
      type: object
      properties:
        unitId:
          type: number
          description: ID of the unit
          example: 12345
        preferredShowingWindows:
          type: array
          items:
            $ref: '#/components/schemas/TimeInterval'
          description: Preferred showing windows (e.g., with stacking opportunities)
        availableShowingWindows:
          type: array
          items:
            $ref: '#/components/schemas/TimeInterval'
          description: Available showing windows
        showingMethod:
          type: string
          enum:
            - Accompanied
            - Remote Guided
            - Remote Guided with Gated Access
            - Self Guided
          description: The showing method configured for this unit
          example: Accompanied
        timezoneName:
          type: string
          description: Timezone name for the unit
          example: America/Chicago
        timezoneAbbreviation:
          type: string
          description: Timezone abbreviation
          example: CST
        unitStatus:
          type:
            - string
            - 'null'
          enum:
            - Available
            - Leased
            - On Hold
            - Archived
            - Withdrawn
            - Withdrawal Requested
            - Incomplete
            - Under Review
            - Expired
            - Price Analysis
          description: Current status of the unit
          example: Available
      required:
        - unitId
        - preferredShowingWindows
        - availableShowingWindows
        - showingMethod
        - timezoneName
        - timezoneAbbreviation
    PrescreenQuestionAnswer:
      type: object
      properties:
        question:
          type: string
          description: The question text
          example: Do you have a housing voucher (e.g. Section 8)?
        fixedQuestionType:
          type: string
          description: Fixed question type identifier
          example: housing_voucher
        type:
          type: string
          description: Question type
          example: yes_no
        answer:
          type: boolean
          description: The prospect's answer to the question
          example: false
      required:
        - question
        - type
        - answer
    ProspectData:
      type: object
      properties:
        firstName:
          type: string
          description: Prospect's first name
          example: John
        lastName:
          type: string
          description: Prospect's last name
          example: Doe
        email:
          type: string
          description: Prospect's email address
          example: john.doe@example.com
        phone:
          type: string
          description: Prospect's phone number (10 digits)
          example: '5551234567'
        creditScore:
          type: string
          description: Prospect's credit score range
          example: 700+
        income:
          type: string
          description: Prospect's household monthly income range
          example: $5000-$6000/month
        questionAnswers:
          type: array
          items:
            $ref: '#/components/schemas/PrescreenQuestionAnswer'
          description: Answers to prescreening questions
        prospectType:
          type: string
          enum:
            - Self
            - Agent
          description: Type of prospect
          example: Self
        voucherHolder:
          type: boolean
          description: Whether the prospect holds a housing voucher
          example: false
        licenseNumber:
          type: string
          description: License number (for agent prospects)
          example: ABC123
        notes:
          type: string
          description: Additional notes about the prospect
          example: Interested in 2BR units
      required:
        - firstName
        - lastName
        - email
        - phone
        - creditScore
        - income
        - questionAnswers
        - prospectType
    CreateShowingRequest:
      type: object
      properties:
        unitId:
          type: number
          description: ID of the unit to schedule the showing for
          example: 12345
        plannedForTime:
          type: string
          format: date-time
          description: Planned date and time for the showing (ISO 8601 format)
          example: '2024-03-15T10:00:00Z'
        prospectData:
          $ref: '#/components/schemas/ProspectData'
          description: Prospect information and prescreening data
        agentTk:
          type: string
          description: Agent token (required for agent prospects, must be 6 characters)
          example: ABC123
        desiredShowingMethod:
          type: string
          enum:
            - Accompanied
            - Self Guided
            - Remote Guided
            - Remote Guided with Gated Access
          description: Preferred showing method
          example: Accompanied
        files:
          type: array
          items:
            type: string
          description: Array of file paths for uploaded documents
          example:
            - documents/id-verification.pdf
        livenessResult:
          type: object
          description: Liveness verification result from ID verification
        rescheduleEvent:
          type:
            - string
            - number
          description: ID of the event to reschedule (if rescheduling an existing showing)
          example: 67890
      required:
        - unitId
        - plannedForTime
        - prospectData
    CreateShowingResponse:
      type: object
      properties:
        statusText:
          type: string
          description: Success status message
          example: success
      required:
        - statusText
  parameters:
    PaginationLimit:
      name: limit
      in: query
      description: Maximum number of items to return per page (default 50, max 100)
      schema:
        type: integer
        default: 50
        minimum: 1
        maximum: 100
        example: 25
    PaginationPage:
      name: page_number
      in: query
      description: Page number for pagination (0-indexed, default 0)
      schema:
        type: integer
        default: 0
        minimum: 0
        example: 1
  responses:
    BadRequest:
      description: Bad request - invalid input parameters or request body
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid request parameters
            details:
              - keyword: required
                dataPath: ''
                schemaPath: '#/required'
                params:
                  missingProperty: account_id
                message: should have required property 'account_id'
    NotFound:
      description: Not found.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized - missing or invalid Bearer token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized - Missing or invalid Authorization header
            details:
              - message: Bearer token is required
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Internal server error
            details:
              - message: An unexpected error occurred
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Bearer token authentication. Use format 'Bearer {token}' in the
        Authorization header.
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-token
      description: >-
        API key authentication for webhooks. The key is defined when setting up
        the webhook in the [developer
        portal](https://app.rentengine.io/developer/portal).
tags:
  - name: Lockboxes
    description: Operations for managing lockboxes
  - name: Lockbox Events
    description: Operations for tracking and creating lockbox events
  - name: Lockbox Installations
    description: Operations for retrieving lockbox installations
  - name: Units
    description: Operations for managing rental units
  - name: Prospects
    description: Events related to prospective tenants
  - name: Multifamily Properties
    description: >-
      Operations for managing multifamily properties. Multifamily properties are
      used to syndicate large properties with paid advertising contracts to the
      paid rental feeds. For example, paid adverising contracts are required for
      the Zillow network if the building has more than 24 units, and for the
      Apartments.com if the building has more than 4 units. Other ILSs have
      different thresholds.
  - name: Floorplans
    description: >-
      Operations for managing floorplans associated with multifamily properties.
      Floorplans are used to syndicate units to the paid rental feeds for paid
      advertising contracts. They must be used in conjunction with a multifamily
      property.
  - name: Leasing Events
    description: Events related to leasing events
  - name: Subteams
    description: Operations for managing subteams
  - name: Prescreening Templates
    description: >-
      Operations for managing prescreening templates used for prospect
      qualification
  - name: Showings
    description: Operations for managing showing availability and scheduling
webhooks:
  LeasingEvents:
    post:
      summary: Leasing events
      description: |
        Webhook for leasing events (creates, updates, deletes).
        Leasing events of the following types are supported:
        - "New"
        - "Contacted, Awaiting Information"
        - "Showing Desired" 
        - "Showing Scheduled"
        - "Showing Complete"
        - "Missed Showing"
        - "Ghosting"
        - "Application Sent to Prospect"
        - "Application Received"
        - "Application Pending"
        - "Application in Owner Review"
        - "Application Approved"
        - "Withdrawn"
        - "Application Rejected"
        - "Prescreen Submitted"
        - "Prescreen Rejected - Self reported credit"
        - "Prescreen Rejected - Self reported income"
        - "Prescreen Rejected - ID Verification"
        - "Prescreen Approved"
        - "Looking too early"
        - "Lease out for signing"
        - "Lease Signed"
        - "Deposit Received"
        - "Move-in Scheduled"
        - "Moved In"
        - "Unit of Interest Unavailable"
        - "Not Interested"
        - "Duplicate Lead"
        - "Still Deciding"
        - "HOA Application Sent To Prospect"
        - "HOA Application Submitted"
        - "HOA Application Approved"
        - "HOA Application Rejected"
        - "Showing Failed"
        - "Showing Canceled"
        - "Showing Confirmed"
        - "Arrived for Showing"
        - "Showing Started"
        - "Log Note"
        - "Assign to User"
        - "Blocklist Prospect"
        - "Unblock Prospect"
        - "Reassign Showing"
      operationId: receive-leasing-events
      tags:
        - Leasing Events
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookPayload'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
  LockboxEvents:
    post:
      summary: Lockbox events
      operationId: receive-lockbox-events
      tags:
        - Lockbox Events
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookPayload'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
  ProspectsEvents:
    post:
      summary: Prospects
      operationId: receive-prospects-updates
      tags:
        - Prospects
      description: |
        Webhook for prospect changes (creates, updates, deletes).
        Only the below fields are included in the record and old_record objects.
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookPayload'
                - type: object
                  properties:
                    record:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: Unique identifier for the prospect
                          example: 123e4567-e89b-12d3-a456-426614174000
                        created_at:
                          type: string
                          format: date-time
                          description: When the prospect was created
                          example: '2023-01-15T12:00:00Z'
                        name:
                          type: string
                          description: Prospect's name
                          example: John Doe
                        phone:
                          type: string
                          description: Prospect's phone number
                          example: '+15551234567'
                        email:
                          type: string
                          description: Prospect's email address
                          example: test@gmail.com
                        unit_of_interest:
                          type: string
                          description: Unit the prospect is interested in
                          example: '123'
                        status:
                          type: string
                          description: Current status of the prospect
                          example: Showing Scheduled
                        source:
                          type: string
                          description: Where the prospect came from
                          example: Zillow
                        notes:
                          type: string
                          description: Notes about the prospect
                          example: Interested in 2BR units
                        prescreened:
                          type: boolean
                          description: Whether the prospect has been prescreened
                          example: true
                        voucher_holder:
                          type: boolean
                          description: Whether the prospect holds a housing voucher
                          example: false
                        normalized_phone_number_generated:
                          type: string
                          description: Normalized phone number if normalizable. Else null.
                          example: '+15551234567'
                        license_number:
                          type: string
                          description: License number if applicable
                          example: ABC123
                        prospect_type:
                          type: string
                          description: Type of prospect
                          enum:
                            - Self
                            - Agent
                          example: Agent
                        updated_at:
                          type: string
                          format: date-time
                          description: When the prospect was last updated
                          example: '2023-01-16T14:30:00Z'
                        assigned_to_user_ids:
                          type: array
                          items:
                            type: string
                            format: uuid
                          description: IDs of users assigned to this prospect
                          example:
                            - 123e4567-e89b-12d3-a456-426614174001
                    old_record:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: Unique identifier for the prospect
                          example: 123e4567-e89b-12d3-a456-426614174000
                        created_at:
                          type: string
                          format: date-time
                          description: When the prospect was created
                          example: '2023-01-15T12:00:00Z'
                        name:
                          type: string
                          description: Prospect's name
                          example: John Doe
                        phone:
                          type: string
                          description: Prospect's phone number
                          example: '+15551234567'
                        email:
                          type: string
                          description: Prospect's email address
                          example: john.doe@example.com
                        unit_of_interest:
                          type: string
                          description: Unit the prospect is interested in
                          example: '123'
                        status:
                          type: string
                          description: Current status of the prospect
                          example: Not Interested
                        source:
                          type: string
                          description: Where the prospect came from
                          example: RentEngine
                        notes:
                          type: string
                          description: Notes about the prospect
                          example: Interested in 2BR units
                        prescreened:
                          type: boolean
                          description: Whether the prospect has been prescreened
                          example: false
                        voucher_holder:
                          type: boolean
                          description: Whether the prospect holds a housing voucher
                          example: false
                        normalized_phone_number_generated:
                          type: string
                          description: Normalized phone number if normalizable. Else null.
                          example: '+15551234567'
                        license_number:
                          type: string
                          description: License number if applicable
                          example: 'null'
                        prospect_type:
                          type: string
                          description: Type of prospect
                          enum:
                            - Self
                            - Agent
                          example: Self
                        updated_at:
                          type: string
                          format: date-time
                          description: When the prospect was last updated
                          example: '2023-01-15T12:00:00Z'
                        assigned_to_user_ids:
                          type: array
                          items:
                            type: string
                            format: uuid
                          description: IDs of users assigned to this prospect
                          example:
                            - 123e4567-e89b-12d3-a456-426614174001
            example:
              type: UPDATE
              table: prospects
              record:
                id: 123e4567-e89b-12d3-a456-426614174000
                created_at: '2023-01-15T12:00:00Z'
                name: John Doe
                phone: '+15551234567'
                email: john.doe@example.com
                unit_of_interest: '123'
                status: Not Interested
                source: Zillow
                notes: Interested in 2BR units
                prescreened: true
                voucher_holder: false
                normalized_phone_number_generated: '+15551234567'
                license_number: ABC123
                prospect_type: Agent
                updated_at: '2023-01-16T14:30:00Z'
                assigned_to_user_ids:
                  - 123e4567-e89b-12d3-a456-426614174001
              old_record:
                id: 123e4567-e89b-12d3-a456-426614174000
                created_at: '2023-01-15T12:00:00Z'
                name: John Doe
                phone: '+15551234567'
                email: john.doe@example.com
                unit_of_interest: '123'
                status: Showing SCheduled
                source: RentEngine
                notes: Interested in 2BR units
                prescreened: false
                voucher_holder: false
                normalized_phone_number_generated: '+15551234567'
                license_number: 'null'
                updated_at: '2023-01-15T12:00:00Z'
                prospect_type: Self
                assigned_to_user_ids: []
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
  UnitsEvents:
    post:
      summary: Units
      operationId: receive-units-updates
      tags:
        - Units
      description: |
        Webhook for unit changes (creates, updates, deletes).
        Only the below fields are included in the record and old_record objects.
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookPayload'
                - type: object
                  properties:
                    record:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: Unique identifier for the unit
                          example: 3318
                        property_type:
                          type: string
                          description: Type of property
                          example: TOWNHOUSE
                        highlighted_amenities:
                          type: array
                          items:
                            type: string
                          description: Highlighted amenities
                        bedrooms:
                          type: string
                          description: Number of bedrooms
                          example: '3'
                        bathrooms:
                          type: string
                          description: Number of bathrooms
                          example: '2'
                        sqft:
                          type: string
                          description: Square footage of the unit
                          example: '1378'
                        furnished:
                          type: boolean
                          description: Whether the unit is furnished
                          example: false
                        renovated:
                          type: string
                          description: Whether the unit has been renovated
                          example: 'No'
                        num_parking_spots:
                          type: string
                          description: Number of parking spots
                          example: '2'
                        laundry:
                          type: string
                          description: Laundry options
                          example: In Unit
                        target_rental_rate:
                          type: string
                          description: Target rental rate for the unit in dollars per month
                          example: '1925'
                        is_occupied:
                          type: boolean
                          description: Whether the unit is currently occupied
                          example: false
                        earliest_move_in_date:
                          type: string
                          format: date
                          description: Earliest date the unit is available for move-in
                          example: '2024-10-12'
                        allow_cooperating_brokers:
                          type:
                            - boolean
                            - 'null'
                          description: Whether cooperating brokers are allowed
                          example: true
                        desired_lease_duration_months:
                          type: array
                          items:
                            type: integer
                          description: Desired lease duration in months
                          example:
                            - 12
                        pets_allowed:
                          type:
                            - string
                            - 'null'
                          description: Pet policy
                          example: Yes with pet fee
                        pet_restrictions:
                          type: string
                          description: Restrictions on pets
                          example: >-
                            A MINIMUM NON-REFUNDABLE pet fee in the amount of
                            $300 per pet is required
                        hoa_app_required:
                          type:
                            - boolean
                            - 'null'
                          description: Whether HOA application is required
                          example: true
                        hoa_app_fee:
                          type:
                            - number
                            - 'null'
                          description: HOA application fee in dollars
                          example: 100
                        hoa_application_url:
                          type:
                            - string
                            - 'null'
                          description: URL for HOA application
                          example: https://example.com/application
                        key_access:
                          type: string
                          description: Key access information
                          example: I will add this later
                        structured_access_instructions:
                          type: object
                          description: Structured access instructions
                        earliest_showing_date:
                          type: string
                          format: date
                          description: Earliest date the unit can be shown
                          example: '2024-10-12'
                        min_resident_qualifications:
                          type: string
                          description: Minimum qualifications for residents
                          example: ''
                        utilities_included:
                          type: array
                          items:
                            type: string
                          description: Utilities included in rent
                          example:
                            - Lawn Care
                            - Trash
                        parking_type:
                          type: array
                          items:
                            type: string
                          description: Type of parking available
                          example:
                            - Assigned Spots
                        status:
                          type: string
                          description: Current status of the unit
                          example: Leased
                        extracted_from:
                          type: string
                          description: Source of the unit data
                          example: f123abc
                        marketing_description:
                          type: string
                          description: Marketing description of the unit
                          example: >-
                            **AVAILABLE NOW** 3 Bedroom 2 Bathroom Townhome For
                            Rent in Meadow Woods!
                        marketing_photos:
                          type: array
                          items:
                            type: object
                            properties:
                              path:
                                type: string
                              hidden:
                                type: boolean
                              original:
                                type:
                                  - string
                                  - 'null'
                          description: Photos of the unit
                        commission_amount:
                          type: string
                          description: Commission amount
                          example: '1'
                        commission_type:
                          type: string
                          description: Type of commission
                          example: none
                        imported_by:
                          type:
                            - string
                            - 'null'
                          description: Who/what imported the unit
                          example: Rentvine Sync
                        floor_number:
                          type: integer
                          description: Floor number of the unit
                          example: 1
                        has_elevator:
                          type:
                            - boolean
                            - 'null'
                          description: Whether the building has an elevator
                          example: false
                        hoa_details:
                          type: object
                          description: Details about the HOA
                        account_id:
                          type: string
                          description: ID of the account that owns the unit
                          example: 269bf205-d876-42f5-988d-6f40891df58a
                        owner_emails:
                          type: array
                          items:
                            type: string
                          description: Email addresses of the owners
                          example:
                            - rick@amgrents.com
                        accepts_vouchers:
                          type:
                            - boolean
                            - 'null'
                          description: Whether the unit accepts housing vouchers.
                          example: true
                        showing_method:
                          type:
                            - string
                            - 'null'
                          description: Method for showing the unit
                          example: Remote Guided
                        amenities:
                          type: array
                          items:
                            type: string
                          description: All amenities of the unit
                          example:
                            - Dishwasher
                            - Stove
                            - Range Oven
                            - Refrigerator
                        internal_notes:
                          type:
                            - string
                            - 'null'
                          description: Internal notes about the unit.
                          example: Garage work scheduled for Monday.
                        move_in_fees:
                          type:
                            - array
                            - 'null'
                          items:
                            type: object
                          description: Fees required at move-in
                        monthly_fees:
                          type:
                            - array
                            - 'null'
                          items:
                            type: object
                          description: Monthly recurring fees
                        multifamily_property_id:
                          type:
                            - string
                            - 'null'
                          description: ID of the multifamily property
                          example: 421e4567-e89b-12d3-a456-426614174000
                        floorplans_id:
                          type:
                            - string
                            - 'null'
                          description: ID of the floorplan
                          example: 451e4567-e89b-12d3-a456-426614174000
                        video_url:
                          type:
                            - string
                            - 'null'
                          description: URL of video tour
                          example: https://www.youtube.com/watch?v=1234567890
                        subteam_id:
                          type:
                            - string
                            - 'null'
                          description: ID of the subteam managing the unit
                          example: 123e4567-e89b-12d3-a456-426614174000
                        prescreen_template_id:
                          type:
                            - string
                            - 'null'
                          description: ID of the prescreening template to use for this unit
                          example: 123e4567-e89b-12d3-a456-426614174000
                        enable_send_report:
                          type: boolean
                          description: Whether to enable sending reports
                          example: true
                        security_deposit_amount:
                          type:
                            - number
                            - 'null'
                          description: Amount of security deposit in dollars
                          example: 1000.21
                        require_last_month_rent:
                          type:
                            - boolean
                            - 'null'
                          description: Whether last month's rent is required upfront
                          example: true
                        requires_voucher:
                          type:
                            - boolean
                            - 'null'
                          description: Whether a voucher is required
                          example: false
                        custom_application_url:
                          type: string
                          description: URL for custom application
                          example: >-
                            https://app.findigs.com/apply/unitid=70f51c4c-d708-402e-9a5f-bb6fd60b6cf2
                        include_feedback_leasing_report:
                          type: boolean
                          description: Whether to include feedback in leasing reports
                          example: true
                        year_built:
                          type:
                            - number
                            - 'null'
                          description: Year the property was built
                          example: 2020
                        application_fee:
                          type:
                            - number
                            - 'null'
                          description: Application fee amount in dollars
                          example: 50
                        created_at:
                          type: string
                          format: date-time
                          description: Timestamp when the unit was created
                          example: '2024-10-05T18:53:03.406168Z'
                        updated_at:
                          type: string
                          format: date-time
                          description: Timestamp when the unit was last updated
                          example: '2024-10-05T18:53:03.406168Z'
                    old_record:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: Unique identifier for the unit
                          example: 3318
                        property_type:
                          type: string
                          description: Type of property
                          example: TOWNHOUSE
                        highlighted_amenities:
                          type: array
                          items:
                            type: string
                          description: Highlighted amenities
                        bedrooms:
                          type: string
                          description: Number of bedrooms
                          example: '3'
                        bathrooms:
                          type: string
                          description: Number of bathrooms
                          example: '2'
                        sqft:
                          type: string
                          description: Square footage of the unit
                          example: '1378'
                        furnished:
                          type: boolean
                          description: Whether the unit is furnished
                          example: false
                        renovated:
                          type: string
                          description: Whether the unit has been renovated
                          example: 'No'
                        num_parking_spots:
                          type: string
                          description: Number of parking spots
                          example: '2'
                        laundry:
                          type: string
                          description: Laundry options
                          example: In Unit
                        target_rental_rate:
                          type: string
                          description: Target rental rate for the unit in dollars per month
                          example: '1925'
                        is_occupied:
                          type: boolean
                          description: Whether the unit is currently occupied
                          example: false
                        earliest_move_in_date:
                          type: string
                          format: date
                          description: Earliest date the unit is available for move-in
                          example: '2024-10-12'
                        allow_cooperating_brokers:
                          type:
                            - boolean
                            - 'null'
                          description: Whether cooperating brokers are allowed
                          example: true
                        desired_lease_duration_months:
                          type: array
                          items:
                            type: integer
                          description: Desired lease duration in months
                          example:
                            - 12
                        pets_allowed:
                          type:
                            - string
                            - 'null'
                          description: Pet policy
                          example: Yes with pet fee
                        pet_restrictions:
                          type: string
                          description: Restrictions on pets
                          example: >-
                            A MINIMUM NON-REFUNDABLE pet fee in the amount of
                            $300 per pet is required
                        hoa_app_required:
                          type:
                            - boolean
                            - 'null'
                          description: Whether HOA application is required
                          example: true
                        hoa_app_fee:
                          type:
                            - number
                            - 'null'
                          description: HOA application fee in dollars
                          example: 100
                        hoa_application_url:
                          type:
                            - string
                            - 'null'
                          description: URL for HOA application
                          example: https://example.com/application
                        key_access:
                          type: string
                          description: Key access information
                          example: I will add this later
                        structured_access_instructions:
                          type: object
                          description: Structured access instructions
                        earliest_showing_date:
                          type: string
                          format: date
                          description: Earliest date the unit can be shown
                          example: '2024-10-12'
                        min_resident_qualifications:
                          type: string
                          description: Minimum qualifications for residents
                          example: ''
                        utilities_included:
                          type: array
                          items:
                            type: string
                          description: Utilities included in rent
                          example:
                            - Lawn Care
                            - Trash
                        parking_type:
                          type: array
                          items:
                            type: string
                          description: Type of parking available
                          example:
                            - Assigned Spots
                        status:
                          type: string
                          description: Current status of the unit
                          example: Leased
                        extracted_from:
                          type: string
                          description: Source of the unit data
                          example: f123abc
                        marketing_description:
                          type: string
                          description: Marketing description of the unit
                          example: >-
                            **AVAILABLE NOW** 3 Bedroom 2 Bathroom Townhome For
                            Rent in Meadow Woods!
                        marketing_photos:
                          type: array
                          items:
                            type: object
                            properties:
                              path:
                                type: string
                              hidden:
                                type: boolean
                              original:
                                type:
                                  - string
                                  - 'null'
                          description: Photos of the unit
                        commission_amount:
                          type: string
                          description: Commission amount
                          example: '1'
                        commission_type:
                          type: string
                          description: Type of commission
                          example: none
                        imported_by:
                          type:
                            - string
                            - 'null'
                          description: Who/what imported the unit
                          example: Rentvine Sync
                        floor_number:
                          type: integer
                          description: Floor number of the unit
                          example: 1
                        has_elevator:
                          type:
                            - boolean
                            - 'null'
                          description: Whether the building has an elevator
                          example: false
                        hoa_details:
                          type: object
                          description: Details about the HOA
                        account_id:
                          type: string
                          description: ID of the account that owns the unit
                          example: 269bf205-d876-42f5-988d-6f40891df58a
                        owner_emails:
                          type: array
                          items:
                            type: string
                          description: Email addresses of the owners
                          example:
                            - rick@amgrents.com
                        accepts_vouchers:
                          type:
                            - boolean
                            - 'null'
                          description: Whether the unit accepts housing vouchers.
                          example: true
                        showing_method:
                          type:
                            - string
                            - 'null'
                          description: Method for showing the unit
                          example: Remote Guided
                        amenities:
                          type: array
                          items:
                            type: string
                          description: All amenities of the unit
                          example:
                            - Dishwasher
                            - Stove
                            - Range Oven
                            - Refrigerator
                        internal_notes:
                          type:
                            - string
                            - 'null'
                          description: Internal notes about the unit.
                          example: Garage work scheduled for Monday.
                        move_in_fees:
                          type:
                            - array
                            - 'null'
                          items:
                            type: object
                          description: Fees required at move-in
                        monthly_fees:
                          type:
                            - array
                            - 'null'
                          items:
                            type: object
                          description: Monthly recurring fees
                        multifamily_property_id:
                          type:
                            - string
                            - 'null'
                          description: ID of the multifamily property
                          example: 421e4567-e89b-12d3-a456-426614174000
                        floorplans_id:
                          type:
                            - string
                            - 'null'
                          description: ID of the floorplan
                          example: 451e4567-e89b-12d3-a456-426614174000
                        video_url:
                          type:
                            - string
                            - 'null'
                          description: URL of video tour
                          example: https://www.youtube.com/watch?v=1234567890
                        subteam_id:
                          type:
                            - string
                            - 'null'
                          description: ID of the subteam managing the unit
                          example: 123e4567-e89b-12d3-a456-426614174000
                        prescreen_template_id:
                          type:
                            - string
                            - 'null'
                          description: ID of the prescreening template to use for this unit
                          example: 123e4567-e89b-12d3-a456-426614174000
                        enable_send_report:
                          type: boolean
                          description: Whether to enable sending reports
                          example: true
                        security_deposit_amount:
                          type:
                            - number
                            - 'null'
                          description: Amount of security deposit in dollars
                          example: 1000.21
                        require_last_month_rent:
                          type:
                            - boolean
                            - 'null'
                          description: Whether last month's rent is required upfront
                          example: true
                        requires_voucher:
                          type:
                            - boolean
                            - 'null'
                          description: Whether a voucher is required
                          example: false
                        custom_application_url:
                          type: string
                          description: URL for custom application
                          example: >-
                            https://app.findigs.com/apply/unitid=70f51c4c-d708-402e-9a5f-bb6fd60b6cf2
                        include_feedback_leasing_report:
                          type: boolean
                          description: Whether to include feedback in leasing reports
                          example: true
                        year_built:
                          type:
                            - number
                            - 'null'
                          description: Year the property was built
                          example: 2020
                        application_fee:
                          type:
                            - number
                            - 'null'
                          description: Application fee amount in dollars
                          example: 50
                        created_at:
                          type: string
                          format: date-time
                          description: Timestamp when the unit was created
                          example: '2024-10-05T18:53:03.406168Z'
                        updated_at:
                          type: string
                          format: date-time
                          description: Timestamp when the unit was last updated
                          example: '2024-10-05T18:53:03.406168Z'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
security:
  - ApiKeyAuth: []
