Skip to main content

Overview

Instead of polling the status endpoint, you can provide a callback_url in your interactive notification request. NextKS will POST the results to your URL when the request finishes.

When callbacks fire

A callback is triggered when:
  • onUserAction mode: All users have responded
  • onTimeout mode: The timeout is reached
  • Either mode: The timeout is reached and some users haven’t responded
A callback fires once, only when the request reaches its final state (status: "finished"). It is never sent for partial or intermediate individual responses — the payload always reflects the completed request.

Signature verification

Every callback request is signed with HMAC-SHA256 so you can verify it came from NextKS. When you send an interactive notification with a callback_url, the API response includes a callback_secret. Store this secret securely — you’ll use it to verify incoming callbacks.

Verification headers

Verification example

Callback payload

NextKS sends a POST request with Content-Type: application/json:

Callback URL requirements

Your callback URL is validated when you submit the notification: If validation fails, the notification request is rejected with a 400 error.

Retries

If a callback delivery fails (network error or non-2xx response), NextKS retries automatically with exponential backoff:
  • Up to 6 total attempts (1 initial + 5 retries)
  • Each attempt is logged with the error message
  • Once successful, no further retries are attempted

Handling callbacks

Your endpoint should:
  1. Return a 2xx status code to acknowledge receipt
  2. Process the payload asynchronously if needed — NextKS has a 10-second timeout
  3. Be idempotent — in rare cases, a callback may be delivered more than once