Skip to main content
Webhooks let your server receive real-time notifications when things happen on Hitorino — a stream goes live, a video is published, a viewer subscribes. Instead of polling the API repeatedly, you register a URL and Hitorino delivers a signed HTTP 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.

Register a Webhook

Registers a new webhook endpoint. Hitorino immediately sends a POST 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

string
required
The HTTPS URL of your webhook endpoint. Must use https://. Hitorino does not support http:// endpoints.
array
required
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

Returns 201 Created with the newly registered webhook object.
string
Unique identifier for the webhook registration, prefixed with wh_.
string
The HTTPS endpoint URL you registered.
array
Array of event type strings this webhook is subscribed to.
string
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.
string
Current status of the webhook registration. One of active or disabled. Hitorino may automatically disable a webhook after repeated delivery failures.
string
ISO 8601 timestamp of when the webhook was registered.
Copy the secret immediately. It is displayed exactly once in the registration response. Store it in your secrets manager alongside your API key.

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

string
required
The unique webhook ID to remove (e.g., wh_01HWBK1234).

Request Examples

Response

Returns 200 OK with a confirmation object.

Webhook Payload

When a subscribed event occurs, Hitorino sends a POST request to your endpoint with a JSON body structured as follows.
string
Unique identifier for this event delivery, prefixed with evt_. Use this for idempotency checks in your handler.
string
The event type string that triggered this delivery (e.g., stream.started).
string
ISO 8601 timestamp of when the event was generated by Hitorino.
object
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 an X-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

  1. Hitorino computes HMAC-SHA256(rawBody, secret) and hex-encodes the result.
  2. The hex digest is sent in the X-Hitorino-Signature header.
  3. 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.
Always verify the signature before deserializing or acting on the webhook payload. Skipping this step makes your endpoint vulnerable to forged events.

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.
To handle retries safely, use the id field of the webhook payload as an idempotency key. Store processed event IDs in your database and skip any event whose id you’ve already handled.