Skip to content
会nokai.studio

Webhook event payloads

Every webhook body uses the same envelope:

{
  "api_version": "v1",
  "event_id": "uuid",
  "event": "job.completed",
  "customer_id": "cust_uuid",
  "created_at": "2026-05-29T12:00:00Z",
  "data": { ... }
}
FieldNotes
api_versionAlways "v1" for now.
event_idUUID, stable across retries. Use as your dedupe key.
eventEvent name. See event types below.
customer_idYour account UUID.
created_atWhen the event was emitted (ISO 8601).
dataEvent-specific payload. Schemas below.

job.completed

{
  "api_version": "v1",
  "event_id": "uuid",
  "event": "job.completed",
  "customer_id": "cust_uuid",
  "created_at": "2026-05-29T12:00:00Z",
  "data": {
    "taskId": "task_01abc...",
    "model": "wan-i2v-480p",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://nokai.studio/f/Qm9XvT2sLp8Zr4Kc7Nw1Jd6Hy3Ga5Ue0Ft9Bo2Mi8Sx4Vk7Rl1Pq6Dz3Cn5Wj0Ey/output.mp4\"]}",
    "creditsConsumed": 10,
    "completeTime": 1748563200
  }
}

Parse data.resultJson to get resultUrls.


job.failed

{
  "api_version": "v1",
  "event_id": "uuid",
  "event": "job.failed",
  "customer_id": "cust_uuid",
  "created_at": "2026-05-29T12:00:00Z",
  "data": {
    "taskId": "task_01abc...",
    "model": "wan-i2v-480p",
    "state": "fail",
    "failCode": "CONTENT_POLICY",
    "failMsg": "Prompt violates content policy"
  }
}

credits.low_balance

{
  "api_version": "v1",
  "event_id": "uuid",
  "event": "credits.low_balance",
  "customer_id": "cust_uuid",
  "created_at": "2026-05-29T12:00:00Z",
  "data": {
    "customerId": "cust_uuid",
    "balanceUsdMicro": 950000,
    "thresholdUsdMicro": 1000000
  }
}

balanceUsdMicro / 1_000_000 = balance in USD.


credits.topped_up

{
  "api_version": "v1",
  "event_id": "uuid",
  "event": "credits.topped_up",
  "customer_id": "cust_uuid",
  "created_at": "2026-05-29T12:00:00Z",
  "data": {
    "customerId": "cust_uuid",
    "balanceUsdMicro": 25950000,
    "addedUsdMicro": 25000000,
    "stripeChargeId": "ch_..."
  }
}

Headers your endpoint receives

POST /your/endpoint HTTP/1.1
Content-Type: application/json
X-Webhook-Timestamp: 1748563200
X-Webhook-Signature: <base64_hmac>
X-Webhook-Event: job.completed

Verify X-Webhook-Signature before trusting the payload. See Webhooks -> Signature verification.