Use Close CRM's smart view search API to query leads with complex filter combinations, export matching lead IDs, and bulk-update a custom field across the result set
POST /api/v1/data/search/ with a JSON body containing a 'query' object using Close's search query language — combining 'and', 'or', and field-specific filter types (e.g. 'field_type':'lead_status', 'value':['potential'])
Paginate using '_skip' and '_limit' in the request body, extracting 'data[].id' from each page until 'has_more' is false
Collect all matching lead IDs into a list
POST /api/v1/lead/bulk-update/ with a body containing 'ids' (the lead ID list) and 'lead' (an object with the custom field API name and new value) to update all leads in bulk
Verify the update by sampling a subset of lead IDs via GET /api/v1/lead/{id}/ and checking the custom field value
Known gotchas
The Close bulk-update endpoint has a maximum batch size per request (typically 100 IDs); sending a larger array causes a 400 error, requiring the caller to chunk the ID list
Custom field API names in Close are formatted as 'custom.{field_name}' in the update body; using the display name or omitting the 'custom.' prefix silently ignores the field update
The search API's '_limit' parameter has a server-side maximum; setting it too high returns an error — use a moderate page size (e.g. 100) and loop rather than attempting to retrieve all results in one call
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp