Records›Search for Records

Search for Records

Find records by one or more criteria. A successful search returns a JSON array.

POSThttps://secure-api.setshape.com/api/search/lead/{crmid}

Replace {crmid} with your CRM ID, the Shape system ID that belongs to your API key. Send the standard headers on every request: Authorization: YOUR_API_AUTHORIZATION_KEY and Content-Type: application/json. See Authentication.

Body parameters

Send at least one of these fields. Every field you send must match.

Field Requirement Description
lead_id At least one required Shape record ID.
phone At least one required Phone number.
email At least one required Email address.
trkloannnumber At least one required Tracking loan number (mortgage systems only). See below.

Example request

curl --request POST 
  --url "https://secure-api.setshape.com/api/search/lead/YOUR_CRM_ID" 
  --header "Authorization: YOUR_API_AUTHORIZATION_KEY" 
  --header "Content-Type: application/json" 
  --data '{ "email": "jordan.sample@example.com" }'
{
  "email": "jordan.sample@example.com"
}

Search by loan number (mortgage systems only)

Send trkloannnumber to find records by tracking loan number. The whole loan number must match. You can combine it with lead_id, phone or email; every field you send must match. Searching by loan number doesn’t include child branches.

{
  "trkloannnumber": "786-601-1052"
}

Response:

[
  {
    "id": 281944,
    "firstname": "Jordan",
    "lastname": "Sample",
    "email": "jordan.sample@example.com",
    "phone": "5550100123",
    "loannumber": "786-601-1052",
    "AssignedUsers": ["depursLO:1024"]
  }
]

The loan number comes back as loannumber, not trkloannnumber. No match returns 404 {"message": "Record not found"}.

Check the spelling. The field is trkloannnumber, with three n’s in a row (“loan” + “number”).

Tip: if you’re only searching to get a record’s ID for an update, skip the search; Update Record Information accepts trkloannnumber directly.

Status codes

Status Meaning
404 Not Found No matching record was found.
422 Unprocessable No supported search field was sent.
500 Server Error The search could not be completed.