Notify the Partner that a resource changed
PayrollKit sends the information needed to retrieve a changed resource. It also sends notifications when Employer, PAYE Scheme or Employment setup changes through the embedded component.
For each delivery:
- Read
Webhook-Timestampas Unix seconds and reject it if it differs from the current time by more than five minutes. - Build the signed content from the UTF-8 bytes of the timestamp, a full stop and the exact raw request body:
${timestamp}.${rawBody}. - Compute HMAC-SHA256 using the UTF-8 bytes of the signing secret, encode the digest as lowercase hexadecimal and compare
Webhook-Signaturewithv1,<digest>using a constant-time comparison. - Parse the body and confirm that
Webhook-IdmatchesdeliveryId. - Save or enqueue the accepted notification somewhere that survives a restart, using
deliveryIdto detect duplicates. - Return
204within 10 seconds. A duplicate that has already been saved may also receive204.
Retrieve resourceUrl asynchronously using your Partner access token. Follow the URL only when its origin is https://api.payrollkit.co; never send your token to another origin. Treat the retrieved resource as current state and do not assume notifications arrive in the same order as the changes.
A timeout, network failure or response other than 204 causes a retry after 1 minute, 5 minutes, 30 minutes, 2 hours, 12 hours and 24 hours. Retries keep the same body and deliveryId but use a new Webhook-Timestamp and Webhook-Signature. PayrollKit stops after the final retry and does not provide a replay feed. After a longer outage, list or retrieve the PayrollKit resources your product keeps in sync.
Headers
- Type: stringWebhook
- Id min length:1max length:200requiredDelivery ID used to detect duplicates. It matches the body
deliveryIdand remains the same across retries. - Type: integerFormat: int64Webhook
- Timestamp requiredUnix timestamp in seconds for this delivery attempt. Reject it when it differs from the current time by more than five minutes.
- Type: stringWebhook
- Signature requiredHMAC-SHA256 signature for
${timestamp}.${rawBody}in the formv1,<lowercase-hex-digest>.
Body
- Type: stringdelivery
Id min length:1max length:200requiredStable delivery ID used to detect duplicates. Retries use the same value.
- Type: stringemployer
Id min length:1max length:200requiredPayrollKit ID of the Employer that owns the changed resource.
- event
Type const:resource.changedrequiredType of notification.
- Type: stringFormat: date-timeoccurred
At requiredWhen PayrollKit recorded the resource change. This does not indicate when the notification was delivered.
- Type: stringresource
Id min length:1max length:200requiredPayrollKit ID of the changed resource.
- Type: stringenumresource
Type requiredKind of setup, payroll or output resource to retrieve. Changes to nested Employment setup are reported as an Employment change.
valuesemployerpaye_schemeemploymentpay_runcalculationfilingpayslippayslip_deliveryaccounting_exportpension_exportpayment_instruction_file - Type: stringFormat: uriresource
Url requiredAbsolute PayrollKit API URL used to retrieve the current resource with a Partner access token.
Responses
- 204
Notification durably accepted, or a previously accepted duplicate acknowledged
- default
Notification not accepted; PayrollKit retries according to the documented schedule.
{
"deliveryId": "delivery_7c29e4b1",
"eventType": "resource.changed",
"occurredAt": "2026-08-20T09:12:00Z",
"employerId": "er_7d91f2c8",
"resourceType": "employment",
"resourceId": "employment_4b72e190",
"resourceUrl": "https://api.payrollkit.co/v1/employers/er_7d91f2c8/employments/employment_4b72e190"
}