Webhooks and signature verification
Receive signed job and voice events. Stripe-style HMAC-SHA256 signatures with a timestamp, retries with backoff, a delivery log and secret rotation.
Register an https endpoint per mode and pick the events you want. Every delivery is a JSON event signed with your endpoint's secret.
| Event | When |
|---|---|
job.completed | A job completed; fetch it for download URLs. |
job.failed | A job failed (nothing charged). |
job.canceled | A queued job was canceled. |
voice.awaiting_activation | A voice was approved and waits for activate. |
voice.ready | A voice can be used. |
voice.failed | A voice was rejected or could not be created. |
/api/v1/webhook_endpointsCreate a webhook endpoint
Registers an https URL for events in this mode. The signing secret is returned once.
Body
| Field | Type | Description |
|---|---|---|
url required | URL (0–2048 chars) | A public https URL on port 443. |
enabled_events required | array of "job.completed" | "job.failed" | "job.canceled" | "voice.awaiting_activation" | "voice.ready" | "voice.failed" | "*" | Event types to send, or ["*"] for all. |
description | string (0–200 chars) |
Headers: Authorization, Idempotency-Key, Content-Type: application/json
curl -X POST https://www.omegahumanizer.cloud/api/v1/webhook_endpoints \
-H "Authorization: Bearer $OMEGA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/omega/webhooks",
"enabled_events": [
"job.completed",
"job.failed"
],
"description": "Production listener"
}'Response 201
{
"id": "we_4Er6Ty8Ui1Op3As5Df7Gh9Jk",
"object": "webhook_endpoint",
"livemode": true,
"url": "https://example.com/omega/webhooks",
"enabled_events": [
"job.completed",
"job.failed"
],
"description": "Production listener",
"status": "enabled",
"secret": "whsec_3q2-7LmN0pQrStUvWxYz1A2b3C4d5E6f7G8h9I0jK1l",
"created_at": "2026-11-06T10:00:00.000Z"
}Errors: idempotency_key_required, idempotency_key_invalid, idempotency_key_in_use, idempotency_key_reused, invalid_json, parameter_unknown, parameter_missing, parameter_invalid, url_not_allowed, state_conflict, service_unavailable
Verifying signatures
Each request carries Omega-Signature: t=<unix seconds>,v1=<hex>. The signature is HMAC-SHA256 over t + "." + rawBody, keyed by the UTF-8 bytes of your full secret including the whsec_ prefix. Reject timestamps more than 300 seconds from now, compare in constant time, and use the raw body — not re-serialized JSON.
import crypto from "node:crypto";
// secret: the endpoint's whsec_… signing secret. rawBody: the exact request body string.
export function verifyOmegaSignature(rawBody, header, secret, toleranceSeconds = 300) {
let timestamp = null;
const signatures = [];
for (const item of String(header).split(",")) {
const [key, value] = item.split("=", 2);
if (key === "t") timestamp = Number(value);
if (key === "v1") signatures.push(value);
}
if (!Number.isFinite(timestamp) || signatures.length === 0) return false;
if (Math.abs(Math.floor(Date.now() / 1000) - timestamp) > toleranceSeconds) return false;
const expected = crypto
.createHmac("sha256", Buffer.from(secret, "utf8"))
.update(`${timestamp}.${rawBody}`, "utf8")
.digest();
return signatures.some((signature) => {
const candidate = Buffer.from(signature, "hex");
return candidate.length === expected.length && crypto.timingSafeEqual(candidate, expected);
});
}
Other headers: Omega-Event-Id, Omega-Event-Type, Omega-Delivery-Id, User-Agent: Omega-Webhooks/1.0. Deduplicate on the event id: a delivery can arrive more than once.
Retries
Answer 2xx within 10 seconds. Otherwise we retry 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h after the previous attempt, then mark the delivery failed (8 attempts in total). Redirects are not followed. An endpoint whose last 20 deliveries all failed is disabled; re-enable it in the dashboard. GET /v1/events/{id} shows every attempt.
Rotating the secret
POST /v1/webhook_endpoints/{id}/rotate_secret returns a new secret. For 24 hours each delivery is signed with both secrets (two v1 values, newest first), so you can deploy the new one without dropping events.
/api/v1/webhook_endpoints/{endpoint_id}/rotate_secretRotate the signing secret
Returns a new secret. The old secret keeps signing for 24 hours, so both verify during the switch.
Path parameters
| Field | Type | Description |
|---|---|---|
endpoint_id required | string (we_…) | The webhook endpoint id. |
Headers: Authorization, Idempotency-Key
curl -X POST https://www.omegahumanizer.cloud/api/v1/webhook_endpoints/we_4Er6Ty8Ui1Op3As5Df7Gh9Jk/rotate_secret \
-H "Authorization: Bearer $OMEGA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"Response 200
{
"id": "we_4Er6Ty8Ui1Op3As5Df7Gh9Jk",
"object": "webhook_endpoint",
"livemode": true,
"url": "https://example.com/omega/webhooks",
"enabled_events": [
"job.completed",
"job.failed"
],
"description": "Production listener",
"status": "enabled",
"secret": "whsec_3q2-7LmN0pQrStUvWxYz1A2b3C4d5E6f7G8h9I0jK1l",
"created_at": "2026-11-06T10:00:00.000Z"
}Errors: idempotency_key_required, idempotency_key_invalid, idempotency_key_in_use, idempotency_key_reused, invalid_json, parameter_unknown, resource_missing, service_unavailable
/api/v1/eventsList events
Lists events in this mode for the last 30 days, newest first.
Query parameters
| Field | Type | Description |
|---|---|---|
type | "job.completed" | "job.failed" | "job.canceled" | "voice.awaiting_activation" | "voice.ready" | "voice.failed" | |
limit | integer 1–100 | Page size, 1 to 100. Default: 20. |
starting_after | string (0–40 chars) | The id of the last object of the previous page. |
curl https://www.omegahumanizer.cloud/api/v1/events \
-H "Authorization: Bearer $OMEGA_API_KEY"Response 200
{
"object": "list",
"data": [
{
"id": "evt_1As3Df5Gh7Jk9Lz2Xc4Vb6Nm",
"object": "event",
"type": "job.completed",
"livemode": true,
"created_at": "2026-11-06T10:03:12.000Z",
"api_version": "2026-11-05",
"data": {
"object": {
"id": "job_4f8Qk2Lr0aZp7Ycm1NvS6tWu",
"object": "job",
"type": "song",
"status": "completed",
"livemode": true,
"created_at": "2026-11-06T10:00:00.000Z",
"started_at": "2026-11-06T10:00:03.000Z",
"completed_at": "2026-11-06T10:03:12.000Z",
"input": {
"kind": "original",
"style": "warm acoustic pop, soft female vocal, nylon guitar, 92 bpm",
"language": "Hindi",
"lyrics": "[Verse]\nBaarish ki boondon mein tera naam likha",
"instrumental": false,
"vocal_gender": "female",
"duration_seconds": null,
"bpm": null,
"key": null,
"seed": 1188,
"title": "Monsoon letters",
"voice_id": null
},
"output": {
"expires_at": "2026-11-08T10:03:12.000Z",
"expired": false,
"usage_restriction": null,
"files": [
{
"id": "song_wav",
"kind": "song",
"format": "wav",
"url": null,
"url_expires_at": null,
"bytes": 53913668,
"sha256": "9b1f3f0e4c2d6a8b7e5f1a3c9d0b2e4f6a8c1e3d5b7f9a0c2e4d6f8b1a3c5e7d",
"duration_seconds": 187.2
},
{
"id": "song_mp3",
"kind": "song",
"format": "mp3",
"url": null,
"url_expires_at": null,
"bytes": 7488000,
"sha256": "1c3e5a7f9b0d2c4e6a8b0d1f3e5c7a9b2d4f6e8a0c1e3d5f7b9a2c4e6d8f0b1a",
"duration_seconds": 187.2
}
]
},
"usage": {
"metered_on": "output_audio",
"measured_seconds": 187.2,
"billed_seconds": 188,
"minimum_seconds": 60,
"tracks": null,
"rate_per_minute": "0.200000",
"voice_rate_per_minute": null,
"amount": "0.626667",
"max_charge": "1.200000",
"currency": "usd"
},
"error": null,
"metadata": {
"order_id": "A-1042"
}
}
}
}
],
"has_more": false,
"url": "/v1/events"
}Errors: parameter_invalid, parameter_unknown, resource_missing
/api/v1/events/{event_id}Retrieve an event
Returns the event and its delivery attempts.
Path parameters
| Field | Type | Description |
|---|---|---|
event_id required | string (evt_…) | The event id. |
curl https://www.omegahumanizer.cloud/api/v1/events/evt_1As3Df5Gh7Jk9Lz2Xc4Vb6Nm \
-H "Authorization: Bearer $OMEGA_API_KEY"Response 200
{
"id": "evt_1As3Df5Gh7Jk9Lz2Xc4Vb6Nm",
"object": "event",
"type": "job.completed",
"livemode": true,
"created_at": "2026-11-06T10:03:12.000Z",
"api_version": "2026-11-05",
"data": {
"object": {
"id": "job_4f8Qk2Lr0aZp7Ycm1NvS6tWu",
"object": "job",
"type": "song",
"status": "completed",
"livemode": true,
"created_at": "2026-11-06T10:00:00.000Z",
"started_at": "2026-11-06T10:00:03.000Z",
"completed_at": "2026-11-06T10:03:12.000Z",
"input": {
"kind": "original",
"style": "warm acoustic pop, soft female vocal, nylon guitar, 92 bpm",
"language": "Hindi",
"lyrics": "[Verse]\nBaarish ki boondon mein tera naam likha",
"instrumental": false,
"vocal_gender": "female",
"duration_seconds": null,
"bpm": null,
"key": null,
"seed": 1188,
"title": "Monsoon letters",
"voice_id": null
},
"output": {
"expires_at": "2026-11-08T10:03:12.000Z",
"expired": false,
"usage_restriction": null,
"files": [
{
"id": "song_wav",
"kind": "song",
"format": "wav",
"url": null,
"url_expires_at": null,
"bytes": 53913668,
"sha256": "9b1f3f0e4c2d6a8b7e5f1a3c9d0b2e4f6a8c1e3d5b7f9a0c2e4d6f8b1a3c5e7d",
"duration_seconds": 187.2
},
{
"id": "song_mp3",
"kind": "song",
"format": "mp3",
"url": null,
"url_expires_at": null,
"bytes": 7488000,
"sha256": "1c3e5a7f9b0d2c4e6a8b0d1f3e5c7a9b2d4f6e8a0c1e3d5f7b9a2c4e6d8f0b1a",
"duration_seconds": 187.2
}
]
},
"usage": {
"metered_on": "output_audio",
"measured_seconds": 187.2,
"billed_seconds": 188,
"minimum_seconds": 60,
"tracks": null,
"rate_per_minute": "0.200000",
"voice_rate_per_minute": null,
"amount": "0.626667",
"max_charge": "1.200000",
"currency": "usd"
},
"error": null,
"metadata": {
"order_id": "A-1042"
}
}
},
"deliveries": [
{
"id": "whd_2Xc4Vb6Nm8Qw1Er3Ty5Ui7Op",
"endpoint_id": "we_4Er6Ty8Ui1Op3As5Df7Gh9Jk",
"state": "succeeded",
"attempts": 1,
"next_attempt_at": null,
"log": [
{
"at": "2026-11-06T10:03:13.000Z",
"status": 200,
"ms": 182,
"error": null
}
]
}
]
}Errors: resource_missing