Create firm webhook subscription
/firm-partners/firm/webhooksSubscribes a callback URL to a list of events, or `*`, across every client workspace the key reaches.
Without a `signingSecret`, COUNT generates one and returns it once as `data.webhook.signingSecret`. Takes an `Idempotency-Key` header.
Request body
eventsarrayEvent names to receive, or `["*"]` alone for every event the credential may read, including events added later. Up to 100 entries. Send `events` or `event`, not both.
eventenumA single event to receive, the same as `events: [event]`.
One of: customer.created, customer.updated, customer.deleted, vendor.created, vendor.updated, vendor.deleted, transaction.created, transaction.updated, transaction.deleted, invoice.created, invoice.updated, invoice.deleted, bill.created, bill.updated, bill.deleted, account.created, account.updated, account.deleted, budget.created, budget.updated, budget.deleted, expense_receipt.created, expense_receipt.updated, expense_receipt.deleted, journal_entry.created, journal_entry.updated, journal_entry.deleted, person.created, person.updated, person.deleted, product.created, product.updated, product.deleted, project.created, project.updated, project.deleted, recurring_invoice_template.created, recurring_invoice_template.updated, recurring_invoice_template.deleted, tag.created, tag.updated, tag.deleted, tag_group.created, tag_group.updated, tag_group.deleted, task.created, task.updated, task.deleted, tax.created, tax.updated, tax.deleted, time_entry.created, time_entry.updated, time_entry.deleted, invoice.paid, invoice.payment_failed, bank_feed.synced, payment_batch.approved, payment_batch.file_ready, vendor_bank_account.change_requested, vendor_bank_account.change_approved
callbackUrlstringrequiredPublic HTTPS URL for deliveries.
signingSecretstringSecret for HMAC verification of deliveries (1–512 characters). Leave it out and COUNT generates one and returns it once in the response.
statusenumInitial status. Defaults to active.
One of: active, paused, disabled
Responses
201Subscription created. Returned under data.webhook, with `signingSecret` only when COUNT generated it.400Invalid callback URL or validation error.401Missing signing headers, an invalid HMAC signature, or a timestamp more than 5 minutes off. Troubleshoot403The key was not created by this firm, its scope lacks `webhooks` or read access to the event's records, or the firm permission to manage developer apps is missing. Troubleshoot409Your app already has a firm-wide subscription for this event.429Rate limit exceeded (100 requests per minute per firm user of each app, or 10,000 per minute per app). Troubleshoothttps://api.getcount.com/firm-partners/firm/webhooksimport crypto from 'node:crypto';
const BASE_URL = 'https://api.getcount.com';
const CLIENT_ID = process.env.COUNT_CLIENT_ID;
const CLIENT_SECRET = process.env.COUNT_CLIENT_SECRET;
const method = 'POST';
const signingPath = '/firm/webhooks';
const timestamp = Math.floor(Date.now() / 1000).toString();
const body = {
"events": [
"invoice.updated",
"invoice.paid"
],
"callbackUrl": "https://webhook.site/your-unique-id"
};
const bodyString = JSON.stringify(body);
const bodyHash = crypto.createHash('sha256').update(bodyString).digest('hex');
const baseString = `${method}:${signingPath}:${timestamp}:${bodyHash}`;
const signature = crypto.createHmac('sha256', CLIENT_SECRET).update(baseString).digest('hex');
const response = await fetch(`${BASE_URL}/firm-partners/firm/webhooks`, {
method,
headers: {
'x-client-id': CLIENT_ID,
'x-timestamp': timestamp,
'x-signature': signature,
'Content-Type': 'application/json',
},
body: bodyString,
});
console.log(await response.json());{
"status": "success",
"data": {
"webhook": {
"uuid": "e0f1a2b3-c4d5-6789-ef01-234567890abc",
"event": null,
"events": [
"invoice.updated",
"invoice.paid"
],
"callbackUrl": "https://webhook.site/your-unique-id",
"status": "active",
"hasSigningSecret": true,
"lastDeliveredAt": null,
"lastError": null,
"lastErrorAt": null,
"suspendedAt": null,
"createdAt": "2026-03-01T09:00:00.000Z",
"updatedAt": "2026-03-01T09:00:00.000Z",
"signingSecret": "Zk3v9QyH2pW7sLr0aT5nBc8dXe1fGh4jKm6oPq2RuVw"
}
}
}