Your API Key

Your key is stored locally. Get one from the developer dashboard.

Webhooks

Receive real‑time notifications for events like new sales, chapter releases, or author messages. Webhooks are available for Pro tier and above.

Quick Start

  1. Create a webhook endpoint in your developer dashboard.
  2. Subscribe to events (e.g., book.purchased).
  3. InceNar will send a POST request with a signature header.
  4. Verify the signature using your webhook secret.
POST/v1/webhooksPro+

Create a new webhook endpoint.

Parameters

NameTypeDefaultDescription
url*stringHTTPS endpoint URL
events*arrayList of event types to subscribe to (see below)
descriptionstringOptional description

Response Example

{ "data": { "id": "wh_123", "url": "...", "secret": "whsec_..." } }
GET/v1/webhooksPro+

List all webhook endpoints for the authenticated API key.

Response Example

{ "data": [ { "id": "wh_123", "url": "...", "events": ["book.purchased"] } ] }

Event Types

book.purchased

A user bought a book

chapter.published

New chapter of a serial book

author.followed

User followed an author

review.created

New book review

Verifying Signatures

Each webhook request includes a X-Webhook-Signature header. Compute the HMAC‑SHA256 of the raw request body using your webhook secret and compare.

const crypto = require('crypto');
const signature = req.headers['x-webhook-signature'];
const expected = crypto
  .createHmac('sha256', webhookSecret)
  .update(JSON.stringify(req.body))
  .digest('hex');
if (signature !== `sha256=${expected}`) {
  throw new Error('Invalid signature');
}