Skip to content
会nokai.studio

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
  }
}
FieldTypeNotes
taskIdstring
modelstring
state"success"Always "success" for this event.
resultJsonstringJSON-encoded { resultUrls: string[] }. Parse it.
creditsConsumedintegerCredits deducted for this job.
completeTimeintegerUnix 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"
  }
}
FieldTypeNotes
taskIdstring
modelstring
state"fail"Always "fail" for this event.
failCodestringMachine-readable failure reason.
failMsgstringHuman-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_..."
  }
}
FieldTypeNotes
customerIdstring
balanceUsdMicrointegerNew balance after top-up.
addedUsdMicrointegerAmount added.
stripeChargeIdstringStripe charge ID for reconciliation.