---
updatedAt: 2026-08-27T13:52:09.000Z
agentTools:
  projectIndex: https://docs.youlend.com/llms.txt
---

# List leads with filtering applied. Returns a max 500 of the most recent results.

> 🚧 This is our recommended endpoint for fetching a  list of leads.
>
> As well as filtering by sign up date, you can also filter on one or more lead states, valid lead states are:\
> "stage1incomplete", "stage1submitted", "stage1rejected", "ineligible", "rescinded",\
> "offersProvided", "offerAccepted", "offersExpired", "contractgenerated", "contractsent" (DocuSign flow), "contractsigned",\
> "readytofund", "stage2submitted" (deprecated), "stage2rejected" (deprecated) or "onboardingcomplete" (deprecated).

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Onboarding",
    "description": "Through this API you can can initiate the process of onboarding a borrower with YouLend",
    "contact": {
      "name": "Mark Ufland",
      "email": "mark.ufland@youlend.com"
    },
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://partners.staging-youlendapi.com/onboarding"
    }
  ],
  "paths": {
    "/Leads/all": {
      "get": {
        "tags": [
          "GET Details"
        ],
        "summary": "List leads with filtering applied. Returns a max 500 of the most recent results.",
        "operationId": "GetAllLeadsByLendingPartnerWithFilters",
        "parameters": [
          {
            "name": "Limit",
            "in": "query",
            "schema": {
              "maximum": 500,
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "LastSortValue",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "LastLeadId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid",
              "nullable": true
            }
          },
          {
            "name": "api-version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Search Criteria model.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetAllLeadsQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request processed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GetAllLeadsByLendingPartnerWithFilterResultModel"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GetAllLeadsByLendingPartnerWithFilterResultModel"
                  }
                }
              }
            }
          },
          "204": {
            "description": "No leads were found that match the input criteria for the lending partner."
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized request! Please check your bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GetAllLeadsByLendingPartnerWithFilterResultModel": {
        "type": "object",
        "properties": {
          "leadId": {
            "type": "string",
            "description": "Gets or sets the lead id.",
            "format": "uuid"
          },
          "thirdPartyCustomerId": {
            "type": "string",
            "description": "Gets or sets the TPCI associated with the lead.",
            "nullable": true
          },
          "preApprovalId": {
            "type": "string",
            "description": "Gets or sets the PreApproval Id.",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "description": "Gets or sets the state for the lead.",
            "nullable": true
          },
          "stateUpdated": {
            "type": "string",
            "description": "Gets or sets the state updated for the lead.",
            "format": "date-time"
          },
          "signUpDate": {
            "type": "string",
            "description": "Gets or sets the sign-up date for the lead.",
            "format": "date-time"
          },
          "additionalInfo": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "description": "Gets or sets additional info associated with the lead.",
            "nullable": true
          },
          "companyName": {
            "type": "string",
            "description": "Gets or sets the name of the company.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Gets or sets the name.",
            "nullable": true
          },
          "owner": {
            "type": "string",
            "description": "Gets or sets the owner.",
            "nullable": true
          },
          "leadType": {
            "type": "string",
            "description": "Gets or sets the lead type.",
            "nullable": true
          },
          "partnerLoanType": {
            "type": "string",
            "description": "Gets or sets the Partner Loan Type - \"Initial\", \"Early Renewal\" or \"Renewal\".",
            "nullable": true
          },
          "ownerEmail": {
            "type": "string",
            "description": "Gets or sets the registered email of the owner.",
            "nullable": true
          },
          "country": {
            "type": "string",
            "description": "Gets or sets the country.",
            "nullable": true
          },
          "countryISOCode": {
            "type": "string",
            "description": "Gets or sets the country ISO value.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Gets or sets the registered email of the borrower.",
            "nullable": true
          },
          "comments": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "description": "Gets or sets the comments.",
            "nullable": true
          },
          "companyType": {
            "type": "string",
            "description": "Gets or sets the company type.",
            "nullable": true
          },
          "rejectionReasons": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "description": "Gets or sets the rejection reasons.",
            "nullable": true
          },
          "ineligibleReasons": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "description": "Gets or sets the ineligible reasons.",
            "nullable": true
          },
          "rescindedReasons": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "description": "Gets or sets the rescinded reasons.",
            "nullable": true
          },
          "productType": {
            "type": "string",
            "description": "Gets or sets the product code.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetAllLeadsQuery": {
        "required": [
          "dateFrom",
          "dateTo"
        ],
        "type": "object",
        "properties": {
          "leadStates": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Gets or sets the list of lead states to filter by.",
            "nullable": true
          },
          "filterBy": {
            "type": "string",
            "nullable": true,
            "example": "StateUpdated | SignUpDate"
          },
          "dateFrom": {
            "minLength": 1,
            "type": "string",
            "format": "date-time"
          },
          "dateTo": {
            "minLength": 1,
            "type": "string",
            "format": "date-time"
          },
          "sortBy": {
            "type": "string",
            "nullable": true,
            "example": "State | StateUpdated | SignUpDate | Owner | LeadType | Country | CountryISOCode | CompanyType"
          },
          "thirdPartyCustomerId": {
            "type": "string",
            "description": "Optional field to search by ThirdPartyCustomerId.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": {}
      }
    },
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://youlend-stag.eu.auth0.com/oauth/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "tags": [
    {
      "name": "GET Details"
    }
  ]
}
```