PlayVideo

Real-time notifications for upload and processing events.

Events

  • video.completed
  • video.failed

Create a Webhook

curl -X POST https://api.playvideo.dev/v1/webhooks \
  -H "Authorization: Bearer play_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/webhooks/playvideo",
    "events": ["video.completed", "video.failed"]
  }'

Signature Verification

Every webhook includes a signature header. Use your webhook secret to validate:

import crypto from 'crypto';

const signature = req.headers['x-playvideo-signature'];
const body = JSON.stringify(req.body);
const expected = crypto
  .createHmac('sha256', process.env.PLAYVIDEO_WEBHOOK_SECRET)
  .update(body)
  .digest('hex');

if (signature !== expected) {
  throw new Error('Invalid signature');
}

Retry Behavior

Failed deliveries are retried with exponential backoff. Ensure your endpoint responds within 10 seconds.