Skip to content

How to use Sponsorship Policy webhook

Webhook allows you to receive real-time notifications when a sponsorship policy is triggered. You can use webhooks to approve or reject sponsoring userops. Start by going to the sponsorship policies page on the Pimlico dashboard, clicking on the existing policy and clicking on the "Edit button".

Request is sent with POST, where body is a JSON object with the following structure:

const body = {
    type: 'sponsorshipPolicy.webhook',
    data: {
        object: {
            userOperation,
            entryPoint,
            chainId,
            sponsorshipPolicyId: sponsorshipPolicy.id    
        }
    }
};

The returned value should be a JSON with the following structure:

{
    "sponsor": true // Boolean
}