Watch subset of Fields In Syncs

By default, Knit tracks changes in all fields within the unified models. When any field changes, Knit sends a record.modified webhook. However, you may only want to track changes in specific fields, such as:

  • Candidate stage in ATS systems
  • Deal status in CRM
  • Company website in CRM systems

Using Sync Watch Fields API

To configure field-specific tracking, use the Sync Watch Fields API.

API Request

curl --request POST \
     --url https://api.getknit.dev/v1.0/sync.watchFields.update \
     --header 'Authorization: Bearer API_KEY' \
     --header 'X-Knit-Integration-Id: INTEGRATION_ID' \
     --header 'content-type: application/json' \
     --data '{
  "dataType": "employee",
  "jsonPaths": [
    "$.profile.workEmail"
  ]
}'

Understanding JSONPaths

The jsonPaths parameter accepts a list of JSON paths that specify which fields you want to track for changes.

Example: ATS Application Webhook Data

Consider the following example eventData from an ATS Application webhook:

{
  "info": {
    "id": "lRQ03MnbWBSTKHX",
    "status": "ACTIVE",
    "candidate": {
      "id": "X73cKg1NAFUJTec",
      "firstName": "ABC",
      "lastName": "DEF",
      "phones": [
        {
          "type": "PERSONAL",
          "phoneNumber": "000-000-00"
        },
        {
          "type": "WORK",
          "phoneNumber": "000-000-00"
        }
      ],
      "emails": [
        {
          "type": "PERSONAL",
          "email": "[email protected]"
        }
      ],
      "links": [
        "www.blog.com",
        "www.linkedin.com/abc"
      ],
      "location": "Delhi, India"
    },
    "origin": "EXTERNAL",
    "appliedAt": "1970-01-01T00:00:00Z",
    "updatedAt": "1970-01-01T00:00:00Z",
    "jobId": "Ty60CurNfqp5I9r",
    "owner": {
      "id": "tDWso22iFg8iN56",
      "email": "[email protected]",
      "employeeId": "re8AKBnyujPZ4Yb"
    },
    "creditedTo": {
      "id": "UxXF6C3PwZ4gD4c",
      "email": "[email protected]",
      "employeeId": "ChdsLhmoelplUGN"
    }
  },
  "currentStage": {
    "id": "JLUnI5TFKWbhQ1k",
    "text": "Technical Test"
  },
  "interviews": [
    // data
  ],
  "rejection": {
    // data
  },
  "offers": [
    // data
  ],
  "attachments": [
    // data
  ],
  "questionResponses": [
    // data
  ]
}

Tracking Specific Fields

If you want to track changes only in the currentStage field, you would use the following JSONPaths:

{
  "dataType": "ats_applications",
  "jsonPaths": [
    "$.currentStage.id",
    "$.currentStage.text"
  ]
}

With this configuration, Knit will send a record.modified webhook only when either currentStage.id or currentStage.text changes. Changes to other fields will not trigger webhooks.

JSONPath Tools

You can use online tools like JSONPath.com to evaluate and construct the JSONPath expressions required for your specific fields.

Summary

Watch Fields functionality allows you to:

  • Monitor only specific fields within your unified data models
  • Reduce webhook noise by filtering out irrelevant field changes
  • Focus on business-critical data changes like status updates, stage progressions, and key field modifications
  • Customize tracking per data type using JSONPath expressions

By implementing selective field monitoring, you can create more efficient integrations that respond only to the changes that matter most to your application.