Prompt
I need a video processing API with retries and job status webhooks
Latest observation
Nov 1, 2026
OpenAI APIWeb search: off
Absolutely — you’ll want an API that supports:
- Video upload / job creation
- Asynchronous processing
- Retry logic for failures
- Job status webhooks so your system gets notified when processing changes state
Here’s a solid design you can use.
Core API flow
1) Create a processing job
POST /v1/video-jobs
Request:
{
"input_url": "https://example.com/video.mp4",
"output_formats": ["mp4", "hls"],
"callback_url": "https://yourapp.com/webhooks/video-jobs",
"metadata": {
"customer_id": "12345"
}
}
Response:
{
"job_id": "job_01JABC123",
"status": "queued",
"created_at": "2026-11-01T12:00:00Z"
}
Job status lifecycle
Typical statuses:
queuedprocessingretryingsucceededfailedcancelled
You can include progress details:
{
"job_id": "job_01JABC123",
"status": "processing",
"progress": 42,
"stage": "transcoding"
}
Retry handling
Use retries for transient failures only, such as:
- network timeouts
- storage upload failures
- third-party encoder errors
- temporary queue unavailability
Recommended retry policy:
- max attempts: 3–5
- backoff: exponential, with jitter
- retryable error codes: 429, 500, 502, 503, timeout
- non-retryable: invalid input, unsupported codec, auth failure, file corruption
Example retry state:
{
"job_id": "job_01JABC123",
"status": "retrying",
"attempt": 2,
"next_retry_at": "2026-11-01T12:05:00Z",
"last_error": {
"code": "ENCODER_TIMEOUT",
"message": "Worker timed out during transcoding"
}
}
Webhook events
Send signed webhook events to the provided callback_url.
Event types
video.job.createdvideo.job.processingvideo.job.retryingvideo.job.succeededvideo.job.failed
Webhook payload example
{
"event_id": "evt_123",
"event_type": "video.job.succeeded",
"created_at": "2026-11-01T12:10:00Z",
"data": {
"job_id": "job_01JABC123",
"status": "succeeded",
"output": {
"mp4_url": "https://cdn.example.com/output/job_01JABC123.mp4",
"hls_manifest_url": "https://cdn.example.com/output/job_01JABC123.m3u8"
}
}
}
Webhook security
- Sign each request with
HMAC-SHA256 - Include headers like:
X-Webhook-SignatureX-Webhook-TimestampX-Webhook-Event-Id
- Require idempotent webhook processing on the client side
Status polling API
Even with webhooks, offer polling:
GET /v1/video-jobs/{job_id}
Response:
{
"job_id": "job_01JABC123",
"status": "succeeded",
"progress": 100,
"attempt": 1,
"created_at": "2026-11-01T12:00:00Z",
"updated_at": "2026-11-01T12:10:00Z"
}
Recommended architecture
- API service to accept jobs
- Queue for async execution
- Worker pool for transcoding/processing
- Retry scheduler or dead-letter queue
- Webhook dispatcher with delivery retries
- Database to persist jobs and event history
Webhook delivery retries
Your webhook sender should also retry delivery if the client endpoint fails.
Suggested policy:
- Retry on non-2xx responses and timeouts
- Exponential backoff
- Stop after 5–10 attempts
- Mark webhook delivery as dead-lettered after exhaustion
Minimal OpenAPI outline
paths:
/v1/video-jobs:
post:
summary: Create video processing job
/v1/video-jobs/{job_id}:
get:
summary: Get job status
/v1/webhooks/test:
post:
summary: Test webhook delivery
Best practices
- Use idempotency keys on job creation
- Store attempt history
- Emit status change events only on state transitions
- Return structured errors
- Make webhooks at-least-once delivery
- Design consumers to handle duplicates
If you want, I can also provide one of these next:
- a full OpenAPI spec
- a database schema
- a Node.js / Python implementation
- a webhook signing and retry example