πŸ“ΈProfile Update

Learn how to use Airstack webhooks to listen to various use cases on profile updates on the Farcaster network.

Listen To All Profile Updates

You can use Airstack webhooks to listen to all Farcaster profile update events by using the following configuration:

curl -X 'POST' \
  'https://webhooks.airstack.xyz/api/v1/webhooks' \
  -H 'accept: application/json' \
  -H 'Authorization: <YOUR_AIRSTACK_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "endpoint": "https://webhook.site",
  "filter_config": {
    "event_type": "profile.updated"
  }
}'

Listen To All Profile Updates By A Certain FID

You can use Airstack webhooks to listen to all Farcaster profile updates on a certain FID by using the following configuration:

curl -X 'POST' \
  'https://webhooks.airstack.xyz/api/v1/webhooks' \
  -H 'accept: application/json' \
  -H 'Authorization: <YOUR_AIRSTACK_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "endpoint": "https://webhook.site",
  "filter_config": {
    "event_type": "profile.updated",
    "filter": {
      "userId": "602"
    },
    "payload": {    
      "userId": "602",
      "userAddress": "0xa3a736379bfb4a9748c3e4daf5f9af0edfcc6c1a",
      "userAssociatedAddresses": [
        "0xa3a736379bfb4a9748c3e4daf5f9af0edfcc6c1a",
        "Cry3MBYMS34p67Tr6pmart85JuTpdULhgDtaV8rxadng",
        "0xcbfbcbfca74955b8ab75dec41f7b9ef36f329879"
      ],
      "profileName": "betashop.eth",
      "userRecoveryAddress": "0x00000000fcb080a4d6c39a9354da9eb9bc104cd7",
      "isFarcasterPowerUser": false,
      "followingCount": 117,
      "followerCount": 108,
      "socialCapital": {
        "socialCapitalScore": 0.00151243059,
        "socialCapitalRank": 1512
      }
    }
  }
}'

Listen To All Profile Updates Of An Array of FIDs

You can use Airstack webhooks to listen to all Farcaster profile updates on an array of FIDs by using the following configuration:

curl -X 'POST' \
  'https://webhooks.airstack.xyz/api/v1/webhooks' \
  -H 'accept: application/json' \
  -H 'Authorization: <YOUR_AIRSTACK_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "endpoint": "https://webhook.site",
  "filter_config": {
    "event_type": "profile.updated",
    "filter": {
      "userId": {
        "$in": ["602", "2602"]
      }
    },
    "payload": {    
      "userId": "602",
      "userAddress": "0xa3a736379bfb4a9748c3e4daf5f9af0edfcc6c1a",
      "userAssociatedAddresses": [
        "0xa3a736379bfb4a9748c3e4daf5f9af0edfcc6c1a",
        "Cry3MBYMS34p67Tr6pmart85JuTpdULhgDtaV8rxadng",
        "0xcbfbcbfca74955b8ab75dec41f7b9ef36f329879"
      ],
      "profileName": "betashop.eth",
      "userRecoveryAddress": "0x00000000fcb080a4d6c39a9354da9eb9bc104cd7",
      "isFarcasterPowerUser": false,
      "followingCount": 117,
      "followerCount": 108,
      "socialCapital": {
        "socialCapitalScore": 0.00151243059,
        "socialCapitalRank": 1512
      }
    }
  }
}'

Listen To A Certain FID When Receiving Farcaster Power Badge

You can use Airstack webhooks to listen to a certain FID when earning a Farcaster power badge by using the following configuration:

To implement the reverse, that is when losing a Farcaster power badge, simply set isFarcasterPowerUser to false in filter.

curl -X 'POST' \
  'https://webhooks.airstack.xyz/api/v1/webhooks' \
  -H 'accept: application/json' \
  -H 'Authorization: <YOUR_AIRSTACK_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "endpoint": "https://webhook.site",
  "filter_config": {
    "event_type": "profile.updated",
    "filter": {
      "$and": [
        {
          "userId": "602"
        },
        {
          "isFarcasterPowerUser": true
        }
      ]
    },
    "payload": {    
      "userId": "602",
      "userAddress": "0xa3a736379bfb4a9748c3e4daf5f9af0edfcc6c1a",
      "userAssociatedAddresses": [
        "0xa3a736379bfb4a9748c3e4daf5f9af0edfcc6c1a",
        "Cry3MBYMS34p67Tr6pmart85JuTpdULhgDtaV8rxadng",
        "0xcbfbcbfca74955b8ab75dec41f7b9ef36f329879"
      ],
      "profileName": "betashop.eth",
      "userRecoveryAddress": "0x00000000fcb080a4d6c39a9354da9eb9bc104cd7",
      "isFarcasterPowerUser": true,
      "followingCount": 117,
      "followerCount": 108,
      "socialCapital": {
        "socialCapitalScore": 0.00151243059,
        "socialCapitalRank": 1512
      }
    }
  }
}'

Listen To A Certain FID When Follower Count > X

You can use Airstack webhooks to listen to a certain FID when follower count is above certain number by using the following configuration:

curl -X 'POST' \
  'https://webhooks.airstack.xyz/api/v1/webhooks' \
  -H 'accept: application/json' \
  -H 'Authorization: <YOUR_AIRSTACK_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "endpoint": "https://webhook.site",
  "filter_config": {
    "event_type": "profile.updated",
    "filter": {
      "$and": [
        {
          "userId": "602"
        },
        {
          "followerCount": {
            "$gte": 1000
          }
        }
      ]
    },
    "payload": {    
      "userId": "602",
      "userAddress": "0xa3a736379bfb4a9748c3e4daf5f9af0edfcc6c1a",
      "userAssociatedAddresses": [
        "0xa3a736379bfb4a9748c3e4daf5f9af0edfcc6c1a",
        "Cry3MBYMS34p67Tr6pmart85JuTpdULhgDtaV8rxadng",
        "0xcbfbcbfca74955b8ab75dec41f7b9ef36f329879"
      ],
      "profileName": "betashop.eth",
      "userRecoveryAddress": "0x00000000fcb080a4d6c39a9354da9eb9bc104cd7",
      "isFarcasterPowerUser": false,
      "followingCount": 117,
      "followerCount": 1080,
      "socialCapital": {
        "socialCapitalScore": 0.00151243059,
        "socialCapitalRank": 1512
      }
    }
  }
}'

Listen To A Certain FID When Following Count > X

You can use Airstack webhooks to listen to a certain FID when following count is above certain number by using the following configuration:

curl -X 'POST' \
  'https://webhooks.airstack.xyz/api/v1/webhooks' \
  -H 'accept: application/json' \
  -H 'Authorization: <YOUR_AIRSTACK_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "endpoint": "https://webhook.site",
  "filter_config": {