1. Preparation
PixVerse Platform Docs
  • Get Started
    • What Is PixVerse AI?
    • Model Capability Map
    • Billing and Usage
    • Quick Start
    • Contact Us
    • Privacy and Data Protection
  • API
    • Preparation
      • Start Here
      • Concurrency Rules
      • Query Task Status
      • Error Codes
      • FAQ
      • Webhook Callbacks
      • Upload Image
        POST
      • Upload Media (Video and Audio)
        POST
      • Verify Uploaded Audio
        POST
      • Get Effect Template List
        GET
      • Get TTS Speaker List
        GET
      • Get Restyle Effect List
        GET
      • Query Task Status
        GET
      • Get Account Balance
        GET
      • Usage Deduction Query
        POST
      • Create Custom Voice
        POST
      • Delete Custom Voice
        DELETE
    • Core Capabilities
      • Text-to-Video
      • Image-to-Video and Video Templates
      • First and Last Frame Video
      • Reference-to-Video (Fusion)
      • Multi-Transition Video
      • Video Extend
      • Image Template Generation
      • Get Image Generation Result
    • Solutions
      • Video Upscale
      • Video Restyle
      • Lipsync
      • Video Edit (Modify)
      • Image Avatar
      • Select Video Mask
      • Sound Effect
      • Subject Replacement (Swap)
      • Motion Control (Mimic)
      • One-click Real Estate Video
      • One-click VibeMV
  • Pricing
    • PixVerse API Pricing
  • Changelog
    • Changelog
  1. Preparation

Webhook Callbacks

Overview#

PixVerse can send task-status updates to your callback URL whenever the status of a video-generation task changes. Webhooks reduce the need for frequent status polling.

Supported Capabilities#

CapabilityEndpointWebhook support
Text-to-Video/openapi/v2/video/text/generateYes
Image-to-Video/openapi/v2/video/img/generateYes
First and Last Frame/openapi/v2/video/transition/generateYes
Lipsync/openapi/v2/video/lip_sync/generateYes
Video Extend/openapi/v2/video/extend/generateYes
Sound Effect/openapi/v2/video/sound_effect/generateYes
Reference-to-Video (Fusion)/openapi/v2/video/fusion/generateYes
Multi-Transition Video/openapi/v2/video/multi_transition/generateYes
Subject Replacement (Swap)/openapi/v2/video/swap/generateYes
Video Restyle/openapi/v2/video/restyle/generateYes
Motion Control/openapi/v2/video/mimic/generateYes
Video Edit (Modify)/openapi/v2/video/modify/generateYes
Video Upscale/openapi/v2/video/upscale/generateYes

Integration Steps#

1. Create a webhook_id#

Open the Webhook management page, register an HTTPS callback URL, and obtain a webhook_id and Secret Key.

2. Add webhook_id to a generation request#

Pass the configured webhook_id in the request body. The following example uses Text-to-Video:
{
  "aspect_ratio": "16:9",
  "duration": 5,
  "model": "v6",
  "prompt": "A calm evening at a suburban bus station with soft neon lights.",
  "quality": "720p",
  "webhook_id": "1234"
}

3. Verify each callback and return ok#

Verify the signature headers and request body before processing the callback. After successful verification and receipt, return HTTP 200 with the plain-text body ok.

Callback Request#

HTTP Method#

POST

Request Headers#

HeaderTypeDescription
Webhook-TimestampstringUnix timestamp in seconds.
Webhook-Noncestring32-character random lowercase alphanumeric string.
Webhook-SignaturestringBase64-encoded HMAC-SHA256 signature.
Ai-trace-idstringRequest identifier for tracing and troubleshooting.
Content-TypestringFixed value: application/json.

Request Body#

The callback body contains the current task result. Fields may vary by task status and capability.
{
  "id": "123456789",
  "status": 1,
  "url": "https://example.com/video.mp4",
  "size": 10.5,
  "has_audio": true,
  "credits": 100
}
For the authoritative meaning of task states, see Query Task Status. Do not treat HTTP delivery alone as generation success; check the callback status value.

Signature Verification#

1. Construct the signing string#

Join the timestamp, nonce, and URL-encoded payload with newline characters:
{timestamp}\n{nonce}\n{url_encoded_payload}
timestamp: value of the Webhook-Timestamp header
nonce: value of the Webhook-Nonce header
url_encoded_payload: request-body fields sorted by key and encoded as a query string

2. URL-encode the payload#

Convert each JSON field to key=value, sort fields alphabetically by key, and join them with &.
Original payload:
{
  "id": "123456789",
  "status": 1,
  "url": "https://example.com/video.mp4",
  "has_audio": true
}
Encoded payload:
has_audio=true&id=123456789&status=1&url=https%3A%2F%2Fexample.com%2Fvideo.mp4

3. Calculate the signature#

Use the webhook Secret Key to calculate an HMAC-SHA256 digest, then Base64-encode it:
signature = Base64(HMAC-SHA256(secret_key, signing_string))
Compare the result with the Webhook-Signature header using a timing-safe comparison function.

Python Verification Example#

Response Requirements#

ItemRequired value
HTTP status200
Response bodyok
Example:
If the callback endpoint returns a non-200 status or a body other than ok, PixVerse retries delivery.

Retry Policy#

RetryDelay
First2 seconds
Second10 seconds
Third30 seconds
Fourth1 minute
Fifth5 minutes
Sixth15 minutes
Seventh1 hour
Eighth4 hours
Each retry interval may include up to +/-10% jitter. After the final retry, the delivery is marked as failed.

Security Recommendations#

1.
Always verify the signature before processing business logic.
2.
Reject stale Webhook-Timestamp values, for example timestamps outside a five-minute window, to reduce replay risk.
3.
Use HTTPS for the callback URL.
4.
Store the Secret Key securely and never expose it in client-side code or version control.
5.
Use timing-safe comparison functions such as hmac.compare_digest.
6.
Process callbacks idempotently because the same event may be delivered more than once.

Troubleshooting#

SymptomCheck
Signature mismatchConfirm the exact raw field values, alphabetical key ordering, URL encoding, newline separators, and Secret Key.
Repeated callbacksConfirm that the endpoint returns HTTP 200 and the exact body ok.
Missing callbacksConfirm the webhook_id, callback URL accessibility, HTTPS certificate, and firewall rules.
Duplicate processingDeduplicate by task ID and status before applying business changes.
Previous
FAQ
Next
Upload Image