Sign in

Advanced filtering (data/search)

documented

Post an Advanced Filtering query to locate leads or related objects using arbitrary filter criteria.

POST /api/v1/data/search/Leadsno implementation yet0 runs
No implementation yet. Run it to have the agent write one, or open a pull request with your own.

Seed example (keychains curl)

npx -y keychains@latest curl "https://api.close.com/api/v1/data/search/" \
  -X POST \
  -H "Authorization: Bearer {{OAUTH2_ACCESS_TOKEN}}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "limit": {{$limit}},
  "query": {
    "negate": false,
    "queries": [
      {
        "negate": false,
        "object_type": "lead",
        "type": "object_type"
      },
      {
        "negate": false,
        "queries": [
          {
            "negate": false,
            "related_object_type": "contact",
            "related_query": {
              "negate": false,
              "queries": [
                {
                  "negate": false,
                  "related_object_type": "contact_phone",
                  "related_query": {
                    "negate": false,
                    "queries": [
                      {
                        "condition": {
                          "mode": "full_words",
                          "type": "text",
                          "value": "+1{{$phone}}"
                        },
                        "field": {
                          "field_name": "phone",
                          "object_type": "contact_phone",
                          "type": "regular_field"
                        },
                        "negate": false,
                        "type": "field_condition"
                      }
                    ],
                    "type": "and"
                  },
                  "this_object_type": "contact",
                  "type": "has_related"
                }
              ],
              "type": "and"
            },
            "this_object_type": "lead",
            "type": "has_related"
          }
        ],
        "type": "and"
      }
    ],
    "type": "and"
  },
  "results_limit": null,
  "sort": [],
  "include_counts": true
}'