POST request to it whenever a matching event occurs. This page covers how to register, list, and remove webhook endpoints, as well as how to verify incoming payloads.
Webhook Events
Hitorino emits the following event types. You specify which events a webhook endpoint should receive when you register it.| Event | Trigger |
|---|---|
stream.started | A live stream transitions from scheduled or standby to live. |
stream.ended | A live stream ends and transitions to ended. |
video.published | A new on-demand video is made publicly available. |
subscription.created | A viewer subscribes to a creator. |
subscription.cancelled | A viewer cancels their subscription to a creator. |
Register a Webhook
Registers a new webhook endpoint. Hitorino immediately sends aPOST request to your URL with a ping event to verify it’s reachable. Your endpoint must respond with 2xx within 5 seconds.
This endpoint requires a write-scoped API key.
Request Body
The HTTPS URL of your webhook endpoint. Must use
https://. Hitorino does not support http:// endpoints.Array of event type strings to subscribe to. Must contain at least one item. Use
["*"] to subscribe to all current and future events.Request Examples
Response
Returns201 Created with the newly registered webhook object.
Unique identifier for the webhook registration, prefixed with
wh_.The HTTPS endpoint URL you registered.
Array of event type strings this webhook is subscribed to.
A webhook signing secret used to verify incoming payloads. This value is returned only once, at creation time. Store it securely — you cannot retrieve it again. If you lose it, delete this webhook and create a new one.
Current status of the webhook registration. One of
active or disabled. Hitorino may automatically disable a webhook after repeated delivery failures.ISO 8601 timestamp of when the webhook was registered.
List Webhooks
Returns all webhook endpoints registered to your account.Request Examples
Response
The
secret field is not returned on list responses. Only the registration response (POST /webhooks) includes the secret.Delete a Webhook
Permanently removes a webhook registration. Hitorino immediately stops delivering events to the registered URL. This action cannot be undone.This endpoint requires a write-scoped API key.
Path Parameters
The unique webhook ID to remove (e.g.,
wh_01HWBK1234).Request Examples
Response
Returns200 OK with a confirmation object.
Webhook Payload
When a subscribed event occurs, Hitorino sends aPOST request to your endpoint with a JSON body structured as follows.
Unique identifier for this event delivery, prefixed with
evt_. Use this for idempotency checks in your handler.The event type string that triggered this delivery (e.g.,
stream.started).ISO 8601 timestamp of when the event was generated by Hitorino.
The event payload. The shape of this object varies by event type and mirrors the corresponding API resource object (stream, video, or subscription).
Signature Verification
Every webhook delivery includes anX-Hitorino-Signature header containing an HMAC-SHA256 signature of the raw request body, signed with your webhook secret. You should always verify this signature before processing the payload to ensure the request genuinely came from Hitorino.
How Signatures Work
- Hitorino computes
HMAC-SHA256(rawBody, secret)and hex-encodes the result. - The hex digest is sent in the
X-Hitorino-Signatureheader. - Your server recomputes the same HMAC using the raw request body and your stored secret, then compares it to the header value using a constant-time comparison.
Verification Examples
Retry Behavior
If your endpoint responds with a non-2xx status code or times out (after 5 seconds), Hitorino retries the delivery with exponential backoff up to 5 attempts over approximately 24 hours. After all retries are exhausted, the event is marked as failed and no further attempts are made.