Webhook events
nokai.studio fires four event types. All events use the same envelope; only the data shape differs.
See Webhooks -> Payloads for complete payload shapes and Webhooks -> Signing for signature verification.
Envelope (all events)
{
"api_version": "v1",
"event_id": "uuid",
"event": "job.completed",
"customer_id": "cust_uuid",
"created_at": "2026-05-29T12:00:00Z",
"data": { ... }
}job.completed
Fires when a generation job reaches success.
{
"data": {
"taskId": "task_01abc...",
"model": "wan-i2v-480p",
"state": "success",
"resultJson": "{\"resultUrls\":[\"https://nokai.studio/f/Qm9XvT2sLp8Zr4Kc7Nw1Jd6Hy3Ga5Ue0Ft9Bo2Mi8Sx4Vk7Rl1Pq6Dz3Cn5Wj0Ey/output.mp4\"]}",
"creditsConsumed": 10,
"completeTime": 1748563200
}
}| Field | Type | Notes |
|---|---|---|
taskId | string | |
model | string | |
state | "success" | Always "success" for this event. |
resultJson | string | JSON-encoded { resultUrls: string[] }. Parse it. |
creditsConsumed | integer | Credits deducted for this job. |
completeTime | integer | Unix timestamp (seconds). |
job.failed
Fires when a generation job reaches fail (after all retries exhausted).
{
"data": {
"taskId": "task_01abc...",
"model": "wan-i2v-480p",
"state": "fail",
"failCode": "CONTENT_POLICY",
"failMsg": "Prompt violates content policy"
}
}| Field | Type | Notes |
|---|---|---|
taskId | string | |
model | string | |
state | "fail" | Always "fail" for this event. |
failCode | string | Machine-readable failure reason. |
failMsg | string | Human-readable failure reason. |
credits.low_balance
Fires when account balance drops below the configured low-balance threshold.
{
"data": {
"customerId": "cust_uuid",
"balanceUsdMicro": 950000,
"thresholdUsdMicro": 1000000
}
}balanceUsdMicro / 1_000_000 = balance in USD.
credits.topped_up
Fires when a Stripe payment completes and credits are added to the account.
{
"data": {
"customerId": "cust_uuid",
"balanceUsdMicro": 25950000,
"addedUsdMicro": 25000000,
"stripeChargeId": "ch_..."
}
}| Field | Type | Notes |
|---|---|---|
customerId | string | |
balanceUsdMicro | integer | New balance after top-up. |
addedUsdMicro | integer | Amount added. |
stripeChargeId | string | Stripe charge ID for reconciliation. |