> ## Documentation Index
> Fetch the complete documentation index at: https://developer.lofty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Lead

> ## Lead Assignment & Routing

**Assignment priority:**
1. If `assignedUserId` is provided, the lead is directly assigned to that agent. No routing rules are applied.
2. If `assignedUserId` is empty or omitted, the lead goes through automatic lead routing based on the configured routing rules.

**Routing rule scope** (when routing is triggered):
- `assignGroupId = -1` → Apply company-level routing rules.
- `assignGroupId = <officeId>` → Apply routing rules for the specified office.
- `assignGroupId` not set → Default routing rules will be applied according to the lead’s ownership scope.

**Routing location matching:**
- For Seller (1) type leads, routing is determined by the `property` field (property address/location).
- For all other lead types (Buyer, Renter, etc.), routing is determined by `inquiry.locations[]` (interested areas).

## Lead Ownership

Controls the visibility scope of the lead:
- `ownershipScope = TEAM` → Account-wide: visible to all users in this Lofty client account.
- `ownershipScope = OFFICE` → Visible to a specific office. Must provide `ownershipId` with the office ID.
- `ownershipScope = PERSONAL` → Visible only to the assigned agent. Must provide `ownershipId` with the agent's user ID.
- If not specified, defaults to PERSONAL scope owned by the API caller.

> Note: `ownershipScope = TEAM` refers to the entire client account (the organization), not the Lofty "Team add-on" product.

## Eventual consistency

Persistence is asynchronous. The lead ID is returned immediately, but subsequent GET /v1.0/leads/{leadId} and similar read endpoints may briefly return 404 right after create. Follow-up writes (PUT, POST inquiry, POST property, POST transaction) are unaffected.

## Property block

The optional `property` block is persisted together with the lead:
- Omit it entirely if you don't need to attach an address — the lead is still created.
- If provided, at least one of `city`, `state`, `zipCode`, `streetAddress` must be non-blank; otherwise the request is rejected with **200057 PROPERTY_ADDRESS_EMPTY** and no lead is created.

<Warning>
  **Silent truncation** — `firstName`, `lastName`, `groups`, `segments` are truncated to **30 characters**; `tags` / `tagsAdd` to **64 characters**. The API returns success with no error. Validate input length before sending.
</Warning>


## OpenAPI

````yaml openapi/openapi.json POST /v1.0/leads
openapi: 3.0.1
info:
  title: Lofty Service Open APIs
  description: Lofty service API description
  version: '1.0'
servers:
  - url: https://api.lofty.com
security: []
tags:
  - name: Tasks & Appointments V2
    description: >-
      Unified V2 API for lead tasks and appointments: list, create, read,
      update, finish, unfinish and delete. Tasks and appointments share the same
      taskId namespace; each endpoint resolves the target by ID regardless of
      underlying type.
  - name: Opportunity
    description: Operations about opportunity
  - name: Communication V2
    description: >-
      Fetch a single communication record (text / email / call) by its
      communication ID. Closes the webhook follow-up gap where only list-by-lead
      endpoints existed for text and email.
  - name: Vendor
    description: >-
      Team vendor directory: team members, sub-accounts and associated agents
      within the caller's team.
  - name: Lead Routing
    description: >-
      Lead routing configuration: read and update routing rules and default
      (supplement) rules per business type, and list the members and roles
      available for assignment.
  - name: Lead Activity V2 API
    description: >-
      Unified lead activity timeline: returns call, text and email activities
      for a lead in chronological order, including both auto-captured and
      agent-logged entries.
  - name: Tasks & Appointments
    description: >-
      Agent tasks and lead appointments. Supports listing a lead's appointments,
      listing / reading / creating / updating / deleting tasks on a lead.
  - name: Transactions V2
    description: V2 transaction APIs.
  - name: Lead Manual Log
    description: >-
      Agent-recorded log of communications that happened outside the Lofty CRM
      (calls placed on a personal line, emails sent from another mailbox, SMS
      sent from another device). Three channels are supported: logCall,
      logEmail, logText. Direction fields are recorded from the agent's point of
      view: 'outbound' = agent -> lead, 'inbound' = lead -> agent. Persistence
      is asynchronous: a POST returns the new entry's ID once the write is
      enqueued, and the entry becomes readable after a short delay.
  - name: Calls
    description: >-
      Calls placed or received through the Lofty dialer. Supports fetching a
      recording URL, retrieving a single call record, and listing calls attached
      to a lead.
  - name: Listing V2
    description: Listing search V2
  - name: Agent User
    description: >-
      Agent onboarding and team directory operations. Create a new agent under
      the caller's team and attach tags to existing agents.
  - name: Sales Agents V2
    description: >-
      Sales Agent (AI Assistant) management: read the caller's assistant and
      quota, query leads followed by AI, mute leads, manage working-pool
      membership and plan tasks, and update Sales Agent settings.
  - name: Calendar V2 API
    description: >-
      Unified V2 API for tasks and appointments on a lead: create, update,
      delete, finish, unfinish, query a paginated list, and find available
      meeting slots. Calendar IDs returned by POST /v2.0/calendar are composite
      strings of the form '<numericId>-task' or '<numericId>-appointment' and
      must be sent back as-is to the per-entry endpoints.
  - name: Lead System Logs
    description: Query a lead's system log.
  - name: Lead Transaction
    description: Operations about leads
  - name: Notifications V2
    description: Operations for sending notifications to agents
  - name: Notes
    description: >-
      Free-text notes attached to a lead. Supports create, list, get-by-id,
      update and delete. Notes may be pinned to surface them at the top of the
      lead's timeline. System-generated notes (automated activity) are included
      on the list endpoint only when explicitly requested.
  - name: Listing
    description: >-
      Listing data access: retrieve published listings for a site feed (XML),
      and search active / sold listings by agent, office or MLS id.
  - name: Intelligent Features
    description: AI-powered features for lead analysis and communication
  - name: Leads
    description: >-
      Lead lifecycle operations: create / read / update / delete a lead, search
      leads by stage, source, tag, create time or update time, place an inquiry
      or property on a lead, list lead activities, resolve assignee by lead
      info, and handle Brokermint contact callbacks.
  - name: Members
    description: >-
      Team member directory: look up members by user ID, by account (email), or
      list all members of the caller's team. Also supports retrieving the
      current user's profile.
  - name: Team Features
    description: >-
      Team-scoped metadata: lead tags, custom fields, and lead ponds. Supports
      listing existing entries, adding a new custom field, and retrieving a
      specific lead pond.
  - name: Agent Organization
    description: >-
      Team organizational structure: read the caller's organization info, manage
      company and office records, and list permission profiles available to the
      team.
  - name: Communication
    description: >-
      Lead communication history and outbound messaging: list call / email /
      text history for a lead, search communications for an agent, and send SMS
      or email to a lead.
  - name: Webhooks
    description: >
      Use webhooks to be notified about events that happen in a lofty account.


      Supported webhook event types (listId):


      | listId | Event Type | Description |

      |--------|-----------|-------------|

      | 1 | Agent Info | Agent created or updated |

      | 2 | Lead Info | Lead created, updated, or deleted |

      | 3 | Lead Activity | Lead site activity (e.g. SiteBrowse, SiteFavorite,
      SiteSearch) |

      | 4 | Listing Alert | Listing alert changed |

      | 5 | Transaction | Transaction created, updated, or deleted |

      | 6 | Call | Call event (MANUAL and LOGGED only, excludes AUTO) |

      | 7 | Email | Email event (MANUAL and LOGGED only, excludes AUTO) |

      | 8 | Text | Text message event (MANUAL and LOGGED only, excludes AUTO) |

      | 9 | Note | Note created, updated, or deleted |

      | 10 | Task | Task created, updated, finished, or deleted |

      | 11 | Appointment | Appointment created, updated, finished, or deleted |

      | 12 | Pipeline Change | Lead pipeline stage changed |


      ### Notification Recipient Rules


      Here "team" means the entire Lofty client account (the organization), not
      the Lofty "Team add-on" product.


      Which subscribed users receive a callback depends on the subscription's
      delivery mode (`permissionMode`). In both modes, only users in the lead's
      account (team) who have subscribed to the event type are considered.


      **Assignment-based delivery — `permissionMode: 0` (default)**


      A subscriber receives the callback only for leads assigned to them or that
      they administer:

      - If the lead is a **hidden lead**, only the **assigned agent** receives
      the notification.

      - Otherwise, the subscriber receives it if they are the **assigned agent**
      of the lead, or a **Company Owner** or **Company Admin**.

      - All other subscribers do **not** receive the notification.


      **Ownership-based delivery — `permissionMode: 1`**


      A subscriber receives the callback for any lead they manage, regardless of
      who it is assigned to:

      - Every assignment-based case above still applies (assigned agent, Company
      Owner / Company Admin).

      - In addition, the subscriber receives the callback for any lead within
      their **ownership scope** — a lead owned by their **team** or **office**,
      or **personally owned** by them — even if it is assigned to someone else.

      - Hidden leads are still delivered only to users who manage them.


      Ownership-based mode is intended for team/account-level integrations that
      must cover every lead in their scope, not only assigned leads. Set
      `permissionMode` when creating the subscription (POST /v1.0/webhook); it
      defaults to `0`, so existing subscriptions are unaffected.


      ### Delivery Timing


      Webhooks are typically delivered within **1 minute** of the event being
      triggered. During periods of high traffic, delivery may be delayed, but
      will always be sent within **5 minutes**.


      For detailed callback payload structures, see [Webhook Event
      Payloads](/concepts/webhooks#event-payloads).
paths:
  /v1.0/leads:
    post:
      tags:
        - Leads
      summary: Create Lead
      description: >-
        ## Lead Assignment & Routing


        **Assignment priority:**

        1. If `assignedUserId` is provided, the lead is directly assigned to
        that agent. No routing rules are applied.

        2. If `assignedUserId` is empty or omitted, the lead goes through
        automatic lead routing based on the configured routing rules.


        **Routing rule scope** (when routing is triggered):

        - `assignGroupId = -1` → Apply company-level routing rules.

        - `assignGroupId = <officeId>` → Apply routing rules for the specified
        office.

        - `assignGroupId` not set → Default routing rules will be applied
        according to the lead’s ownership scope.


        **Routing location matching:**

        - For Seller (1) type leads, routing is determined by the `property`
        field (property address/location).

        - For all other lead types (Buyer, Renter, etc.), routing is determined
        by `inquiry.locations[]` (interested areas).


        ## Lead Ownership


        Controls the visibility scope of the lead:

        - `ownershipScope = TEAM` → Account-wide: visible to all users in this
        Lofty client account.

        - `ownershipScope = OFFICE` → Visible to a specific office. Must provide
        `ownershipId` with the office ID.

        - `ownershipScope = PERSONAL` → Visible only to the assigned agent. Must
        provide `ownershipId` with the agent's user ID.

        - If not specified, defaults to PERSONAL scope owned by the API caller.


        > Note: `ownershipScope = TEAM` refers to the entire client account (the
        organization), not the Lofty "Team add-on" product.


        ## Eventual consistency


        Persistence is asynchronous. The lead ID is returned immediately, but
        subsequent GET /v1.0/leads/{leadId} and similar read endpoints may
        briefly return 404 right after create. Follow-up writes (PUT, POST
        inquiry, POST property, POST transaction) are unaffected.


        ## Property block


        The optional `property` block is persisted together with the lead:

        - Omit it entirely if you don't need to attach an address — the lead is
        still created.

        - If provided, at least one of `city`, `state`, `zipCode`,
        `streetAddress` must be non-blank; otherwise the request is rejected
        with **200057 PROPERTY_ADDRESS_EMPTY** and no lead is created.
      operationId: add_3
      parameters:
        - name: Authorization
          in: header
          description: Bearer [access_token]
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: application/json
          required: true
          schema:
            type: string
          example: application/json
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadRequest'
        required: true
      responses:
        '200':
          description: Lead created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadIdResponse'
        '400':
          description: >-
            Invalid parameters. Includes: missing required lead field (20012
            INVALID_PARAMETER); `property` block supplied with every address
            field (`city` / `state` / `zipCode` / `streetAddress`) blank (200057
            PROPERTY_ADDRESS_EMPTY).
          content:
            application/json:
              schema:
                type: string
        '401':
          description: Missing or invalid authentication token.
          content:
            application/json:
              schema:
                type: string
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: string
components:
  schemas:
    LeadRequest:
      required:
        - firstName
      type: object
      properties:
        cannotText:
          type: boolean
          description: 'false: can send message to the lead'
        cannotCall:
          type: boolean
          description: 'false: can call to the lead'
        cannotEmail:
          type: boolean
          description: 'false: can email to the lead'
        firstName:
          type: string
          description: >-
            The first/given name of the lead 

            Caution: Max limit 30 characters. If you exceed the limit, the
            import will succuss, but only import 30 characters in front.
          example: Bob
        lastName:
          type: string
          description: >-
            The last/family name of the lead 

            Caution: Max limit 30 characters. If you exceed the limit, the
            import will succuss, but only import 30 characters in front.
          example: Li
        emails:
          type: array
          description: A list of email addresses associated with the lead
          example:
            - jane.doe@example.com
            - jdoe-work@company.com
          items:
            type: string
            example: jane.doe@example.com
        phones:
          type: array
          description: >-
            A list of phone numbers associated with the lead. (No more than 20
            characters per phone)
          example:
            - '+14155551234'
            - '+12125559876'
          items:
            type: string
            example: '+14155551234'
        leadTypes:
          type: array
          description: >-
            Types of lead, expressed by ID. Type ID : Other (-1), Seller (1),
            Buyer (2), Renter (5), Investor (6), Agent (7), Homeowner (8),
            Landlord (9)
          example:
            - 2
            - 5
          items:
            type: integer
            format: int32
            example: 2
        assignedUserId:
          type: integer
          description: >-
            ID of the agent to directly assign this lead to. When provided,
            automatic lead routing is skipped. When omitted or empty, the lead
            is routed automatically based on routing rules.
          format: int64
          example: 10000000514
        streetAddress:
          type: string
          description: >-
            The streetAddress associated with the lead. Deprecated: please use
            the streetAddress field in property instead.
          example: The White House,1600 Pennsylvania Avenue NW
          deprecated: true
        city:
          type: string
          description: >-
            The city associated with the lead. Deprecated: please use the city
            field in property instead.
          example: Washington DC
          deprecated: true
        state:
          type: string
          description: >-
            The state associated with the lead. Deprecated: please use the state
            field in property instead.
          example: Washington DC
          deprecated: true
        zipCode:
          type: string
          description: >-
            ZipCode. Deprecated: please use the zipCode field in property
            instead.
          example: '20500'
          deprecated: true
        referredBy:
          type: string
          description: The referee of the lead
          example: Jeremy Kelly
        stage:
          type: string
          description: The stage the lead is in, less than 20 characters
          example: Pending
        groups:
          type: array
          description: >-
            The groups the lead is in. Caution: Max limit 30 characters. If you
            exceed the limit, the import will succeed, but only import 30
            characters in front. Deprecated, use segments instead.
          example:
            - VIP Clients
            - Open House Feb
          deprecated: true
          items:
            type: string
            example: VIP Clients
        segments:
          type: array
          description: >-
            The segments the lead is in. Caution: Max limit 30 characters. If
            you exceed the limit, the import will succeed, but only import 30
            characters in front.
          example:
            - First-Time Buyers
            - Downtown Area
          items:
            type: string
            example: First-Time Buyers
        tags:
          type: array
          description: >-
            The tags associated with the lead. All existing tags will be updated
            based on this call. Caution: Max limit 64 characters. If you exceed
            the limit, the import will succeed, but only import 64 characters in
            front.
          example:
            - Hot Lead
            - Zillow
          items:
            type: string
            example: Hot Lead
        tagsAdd:
          type: array
          description: >-
            The tags associated with the lead. All existing tags will be
            retained, only add new tags based on this call. Caution: Max limit
            64 characters. If you exceed the limit, the import will succeed, but
            only import 64 characters in front.
          example:
            - Referral
            - Pre-Approved
          items:
            type: string
            example: Referral
        source:
          type: string
          description: The source of the lead
          example: Open House
        inquiry:
          $ref: '#/components/schemas/LeadInquiry'
        property:
          $ref: '#/components/schemas/LeadProperty'
        unsubscription:
          type: boolean
          description: Unsubscription the email
        welcomeEmail:
          type: boolean
          description: send Welcome Email. (Not supporting update)
        leadAlert:
          type: boolean
          description: send new lead alert email. (Not supporting update)
        customAttributeList:
          type: array
          description: User customized field
          items:
            $ref: '#/components/schemas/CustomAttribute'
        birthday:
          type: string
          description: The birthday of the lead(pattern:MMM d, yyyy)
          example: Jun 5, 2001
        leadRouting:
          type: boolean
          description: >-
            Deprecated. Lead routing is now automatically applied when
            `assignedUserId` is not provided. This field has no effect.
          deprecated: true
        assignGroupId:
          type: integer
          description: >-
            Specifies which routing rule scope to apply when automatic lead
            routing is triggered (i.e., `assignedUserId` is not provided). Set
            to `-1` to use company-level routing rules. Set to a specific office
            ID to use that office's routing rules. If omitted, default routing
            rules will be applied according to the lead’s ownership scope.
          format: int64
        buyingTimeFrame:
          type: string
          description: >-
            buying time frame, `1-3`, `3-6`, `6-12`, `12+`, `Just Looking`,
            `Refinancing`.
          example: 6-12
        preQual:
          type: string
          description: Pre-qual, `Yes` or `No`.
          example: 'Yes'
        houseToSell:
          type: string
          description: House to Sell, `Yes` or `No`.
          example: 'Yes'
        fthb:
          type: string
          description: first time home buyer, `Yes` or `No`.
          example: 'Yes'
        withBuyerAgent:
          type: string
          description: With buyer Agent, `Yes` or `No`.
          example: 'Yes'
        sellingTimeFrame:
          type: string
          description: >-
            selling time frame, `1-3`, `3-6`, `6-12`, `12+`, `Just Looking`,
            `Refinancing`.
          example: 1-3
        mortgage:
          type: string
          description: Mortgage, `Yes` or `No`.
          example: 'Yes'
        buyHouse:
          type: string
          description: Buy a house, `Yes` or `No`.
          example: 'Yes'
        withListingAgent:
          type: string
          description: With listing agent, `Yes` or `No`.
          example: 'Yes'
        leadTransaction:
          $ref: '#/components/schemas/LeadTransaction'
        leadFamilyMemberList:
          type: array
          description: >-
            A list of family members associated with the lead. You can add up to
            4 family members.
          items:
            $ref: '#/components/schemas/LeadFamilyMember'
        language:
          type: string
          description: >-
            The lead's abbreviated language, `en`, `fr`, `de`, `es`, `zh-CN`,
            `zh-TW`, `ja`
          example: en
        content:
          type: string
          description: Note content
          example: example_note
        isPin:
          type: boolean
          description: Pin this note or not
          example: false
        ownershipId:
          type: integer
          description: >-
            The entity ID for the ownership scope. Required when
            `ownershipScope` is `OFFICE` (pass the office ID) or `PERSONAL`
            (pass the agent's user ID). Ignored when `ownershipScope` is `TEAM`.
          format: int64
        ownershipScope:
          type: string
          description: >-
            Controls the visibility scope of the lead. `TEAM` — Account-wide:
            visible to all users in this Lofty client account. `OFFICE` —
            visible only within the specified office (requires `ownershipId`).
            `PERSONAL` — visible only to the specified agent (requires
            `ownershipId`). Defaults to `PERSONAL` scope owned by the API caller
            if not specified. Note: `ownershipScope` = `TEAM` refers to the
            entire client account (the organization), not the Lofty "Team
            add-on" product.
        defaultInquiryParam:
          type: boolean
        specifiedAssignGroupId:
          type: boolean
      description: Lead info that needs to be added in
    LeadIdResponse:
      type: object
      properties:
        leadId:
          type: integer
          description: ID of the lead.
          format: int64
          example: 651095960136641
      description: Response containing the lead ID.
    LeadInquiry:
      type: object
      properties:
        priceMin:
          type: integer
          description: Price range lower end
          format: int64
          example: 1
        priceMax:
          type: integer
          description: Price range higher end
          format: int64
          example: 10000000
        propertyType:
          type: array
          description: >-
            Property types: `Single Family Home`, `Multi-Family`, `Condo`,
            `Townhouse`, `Mobile Home`, `Manufactured Home`, `Vacant Land`,
            `Commercial`.
          example:
            - Single Family Home
            - Condo
          items:
            type: string
            example: Single Family Home
        bedroomsMin:
          type: integer
          description: Bed Rooms
          format: int32
          example: 1
        bathroomsMin:
          type: string
          description: Bath Rooms
          example: '1'
        locations:
          type: array
          description: >-
            Areas the lead is interested in. Each entry is a Location object
            (city, stateCode, zipCode, county, streetAddress or description).
            Used by routing rules when the lead's leadTypes do not include
            Seller (1).
          example:
            - city: Austin
              stateCode: TX
          items:
            $ref: '#/components/schemas/Location'
        id:
          type: integer
          format: int64
        leadUserId:
          type: integer
          format: int64
        bedroomsMax:
          type: integer
          format: int32
        bathroomsMax:
          type: string
        modifyByAgent:
          type: boolean
        createTime:
          type: string
          format: date-time
        updateTime:
          type: string
          format: date-time
        defaultValue:
          type: boolean
      description: LeadInquirys
    LeadProperty:
      type: object
      properties:
        price:
          type: integer
          description: |-
            The price
            Applies to lead routing only if the leadType field is Seller(1)
          format: int64
          example: 100000
        state:
          type: string
          description: |-
            The state
            Applies to lead routing only if the leadType field is Seller(1)
          example: California
        city:
          type: string
          description: |-
            The city
            Applies to lead routing only if the leadType field is Seller(1)
          example: New York
        streetAddress:
          type: string
          description: |-
            The street address
            Applies to lead routing only if the leadType field is Seller(1)
          example: 22348 Regnart RD
        zipCode:
          type: string
          description: |-
            The zip code
            Applies to lead routing only if the leadType field is Seller(1)
          example: '25401'
        county:
          type: string
          description: |-
            The county
            Applies to lead routing only if the leadType field is Seller(1)
        propertyType:
          type: string
          description: >-
            Property type: `Single Family Home`, `Multi-Family`, `Condo`,
            `Townhouse`, `Mobile Home`, `Manufactured Home`, `Vacant Land`,
            `Commercial`.
          example: Single Family Home
        bedrooms:
          type: integer
          description: The bed rooms.
          format: int32
          example: 3
        bathrooms:
          type: number
          description: The bath rooms.
          format: double
          example: 2
        squareFeet:
          type: integer
          description: The square feet.
          format: int64
          example: 100
        lotSize:
          type: number
          description: The lot size (acreage).
          format: double
          example: 26.33
        parkingSpace:
          type: integer
          description: The parking space.
          format: int64
          example: 1
        floors:
          type: integer
          description: The floors.
          format: int32
          example: 1
        mailAddress:
          type: boolean
          description: >-
            If set to true, the address is a mailing address; otherwise, it is a
            property address.
        id:
          type: integer
          description: >-
            The property ID. Required when updating an existing mailing address
            or property address. If not provided, a new address will be created.
          format: int64
        leadUserId:
          type: integer
          format: int64
        listingId:
          type: string
        autoListingId:
          type: integer
          format: int64
        label:
          type: string
        note:
          type: string
        listingStatus:
          type: string
        labelList:
          type: string
        pictureUrl:
          type: string
        siteListingUrl:
          type: string
        labelType:
          type: string
        priceMax:
          type: integer
          description: |-
            The max price
            Applies to lead routing only if the leadType field is Seller(1)
          format: int64
          writeOnly: true
          example: 10000000
        priceMin:
          type: integer
          description: |-
            The min price
            Applies to lead routing only if the leadType field is Seller(1)
          format: int64
          writeOnly: true
          example: 100000
      description: Lead property or mailing address details
    CustomAttribute:
      required:
        - attributeName
        - attributeType
        - value
      type: object
      properties:
        attributeName:
          type: string
          description: The name of this custom field
        attributeType:
          type: string
          description: The type of the field
          example: >-
            number, text, date, anniversary_date, single_select, multi_select,
            percentage, currency
        value:
          type: string
          description: >-
            The content of the field for lead, value for multi-select,such as
            "[\"item1\",\"item2\s",...]" .It's unnecessary when adding a new
            custom field for team
        params:
          type: string
          description: options for select, such as {"option":["item1","item2",...]}
      description: User customized field
    LeadTransaction:
      required:
        - transactionName
      type: object
      properties:
        created:
          type: integer
          description: >-
            Transaction creation timestamp, in milliseconds since Unix epoch
            (UTC). Do not supply on create.
          format: int64
          readOnly: true
          example: 1518078026000
        updated:
          type: integer
          description: >-
            Transaction last-modified timestamp, in milliseconds since Unix
            epoch (UTC). Do not supply on create or update.
          format: int64
          readOnly: true
          example: 1518078026000
        transactionId:
          type: integer
          description: Transaction ID. Do not supply on create.
          format: int64
          readOnly: true
          example: 10001
        transactionName:
          type: string
          description: >-
            Property address or deal name. Required on create. Must not be blank
            and must not contain '<' or '>' characters.
          example: 123 Main St
        leadName:
          type: string
          description: >-
            Name of the lead this transaction belongs to. Ignored if supplied in
            a request body.
          example: Bob
        assignedAgent:
          type: integer
          description: >-
            User ID of the agent this transaction is assigned to. Ignored if
            supplied in a request body.
          format: int64
          example: 100001
        transactionType:
          type: string
          description: >-
            Transaction type. Case-sensitive; must be one of the supported
            values. Values not matching the team's configured pipeline types
            fall back silently to the first pipeline (typically 'Purchase /
            Pre-contract'); always pass a valid type to avoid this silent
            behavior.
          example: Purchase
          enum:
            - Purchase
            - Listing
            - Lease
            - Other
        homePrice:
          type: number
          description: Home price of the transaction.
          example: 1000000
        transactionStatus:
          type: string
          description: >-
            Transaction status name. Must match one of the statuses configured
            in the team's pipeline for the given transactionType; unmatched
            values silently fall back to the first status of that type.
          example: Pre-contract
        expectedCloseDate:
          type: integer
          description: Expected close date, in milliseconds since Unix epoch (UTC).
          format: int64
          example: 1508580010000
        closeDate:
          type: integer
          description: Actual close date, in milliseconds since Unix epoch (UTC).
          format: int64
          example: 1508580010000
        commissionRate:
          type: number
          description: Commission rate, expressed as a percentage (e.g. 3 for 3%).
          example: 3
        gci:
          type: number
          description: Gross Commission Income (GCI) of the transaction.
          example: 5000
        teamRevenue:
          type: number
          description: Portion of the GCI attributed to the team.
          example: 1000
        agentRevenue:
          type: number
          description: Portion of the GCI attributed to the agent.
          example: 4000
        appointmentDate:
          type: integer
          description: Appointment date, in milliseconds since Unix epoch (UTC).
          format: int64
          example: 1508580010000
        agreementSignedDate:
          type: integer
          description: Agreement-signed date, in milliseconds since Unix epoch (UTC).
          format: int64
          example: 1508580010000
        offerDate:
          type: integer
          description: Offer date, in milliseconds since Unix epoch (UTC).
          format: int64
          example: 1508580010000
        contractDate:
          type: integer
          description: Contract date, in milliseconds since Unix epoch (UTC).
          format: int64
          example: 1508580010000
        appraisalDate:
          type: integer
          description: Appraisal date, in milliseconds since Unix epoch (UTC).
          format: int64
          example: 1508580010000
        homeInspectionDate:
          type: integer
          description: Home-inspection date, in milliseconds since Unix epoch (UTC).
          format: int64
          example: 1508580010000
        escrowDate:
          type: integer
          description: Escrow date, in milliseconds since Unix epoch (UTC).
          format: int64
          example: 1508580010000
        expiration:
          type: integer
          description: >-
            Expiration date (listing / contract), in milliseconds since Unix
            epoch (UTC).
          format: int64
          example: 1508580010000
        customFields:
          type: array
          description: >-
            Custom field values; full-coverage update or insertion. See GET
            /v1.0/transaction/customfields for the team's custom field
            definitions.
          items:
            $ref: '#/components/schemas/CustomFieldRequest'
        commissions:
          $ref: '#/components/schemas/Commissions'
    LeadFamilyMember:
      required:
        - firstName
      type: object
      properties:
        relationship:
          type: string
          description: >-
            The relationship of this family member to primary lead. Example:
            Husband
        firstName:
          type: string
          description: The first name of the family member
        lastName:
          type: string
          description: The last name of the family member
        phones:
          type: array
          description: >-
            A list of phone numbers associated with the family member. (No more
            than 20 characters per phone)
          example:
            - '+14155551234'
          items:
            type: string
            example: '+14155551234'
        emails:
          type: array
          description: A list of email addresses associated with the lead
          example:
            - spouse@example.com
          items:
            type: string
            example: spouse@example.com
        birthday:
          type: string
          description: The birthday of the family member(pattern:MMM d, yyyy)
      description: A list of family members associated with the lead
    Location:
      type: object
      properties:
        stateCode:
          type: string
          description: >-
            The state code of city

            Applies to lead routing if the leadType field is not Seller(1) in
            the lead creation request.
          example: CA
        city:
          type: string
          description: >-
            The city

            Applies to lead routing if the leadType field is not Seller(1) in
            the lead creation request.
          example: Palm Desert
        zipCode:
          type: string
          description: >-
            The zip code

            Applies to lead routing if the leadType field is not Seller(1) in
            the lead creation request.
          example: '92211'
        county:
          type: string
          description: >-
            The county

            Applies to lead routing if the leadType field is not Seller(1) in
            the lead creation request.
        streetAddress:
          type: string
          description: >-
            The street address

            Applies to lead routing if the leadType field is not Seller(1) in
            the lead creation request.
        description:
          type: string
          description: Description of location.
          example: other
      description: >-
        Areas the lead is interested in. Each entry is a Location object (city,
        stateCode, zipCode, county, streetAddress or description). Used by
        routing rules when the lead's leadTypes do not include Seller (1).
      example:
        - city: Austin
          stateCode: TX
    CustomFieldRequest:
      type: object
      properties:
        id:
          type: integer
          description: Custom field id
          format: int64
        value:
          type: string
          description: >-
            Custom field value For multi_select, the format is:["Item1","Item2",
            ...]
      description: >-
        Custom field values; full-coverage update or insertion. See GET
        /v1.0/transaction/customfields for the team's custom field definitions.
    Commissions:
      type: object
      properties:
        preSplit:
          type: array
          items:
            $ref: '#/components/schemas/Commission'
        split:
          type: array
          items:
            $ref: '#/components/schemas/Commission'
        postSplit:
          type: array
          items:
            $ref: '#/components/schemas/Commission'
      description: >-
        Commission structure (preSplit / split / postSplit). See POST
        /v1.0/leads/{leadId}/transaction description for validation rules.
    Commission:
      type: object
      properties:
        id:
          type: integer
          format: int64
        splitPayType:
          type: string
          enum:
            - TEAM
            - AGENT
            - VENDOR_PARTNER
            - LEAD
            - OTHER
            - BROKERAGE
            - UPLINE
        splitPayTo:
          type: integer
          format: int64
        splitPayToName:
          type: string
        payType:
          type: string
          enum:
            - TEAM
            - AGENT
            - VENDOR_PARTNER
            - LEAD
            - OTHER
            - BROKERAGE
            - UPLINE
        payTo:
          type: integer
          format: int64
        payToName:
          type: string
        value:
          type: integer
          format: int64
        calculateType:
          type: string
          enum:
            - PERCENT
            - AMOUNT
        desc:
          type: string

````