API Overview
Integrate AdFlow's video generation capabilities into your applications using our REST API. Automate content creation, manage videos programmatically, and build custom workflows.
API Access
The AdFlow API is available on the Business plan and above. Contact sales for Enterprise API access with higher rate limits and dedicated support.
Base URL
https://adflow.edwardscg.com/api/v1All API endpoints are relative to this base URL.
Authentication
The AdFlow API uses API keys for authentication. Include your API key in theAuthorizationheader of every request.
curl https://adflow.edwardscg.com/api/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Getting Your API Key
- 1.Go to Settings in your AdFlow dashboard
- 2.Navigate to the API section
- 3.Click "Generate API Key"
- 4.Copy and securely store your key
API keys are shown only once. Store them securely and never share them publicly.
Core Endpoints
/videosList all videos in your organization
/videos/generateGenerate a new video from content
/videos/:idGet details for a specific video
/contentList all content items
/contentCreate a new content item
Example: Generate a Video
Here's a complete example of generating a video via the API:
curl -X POST https://adflow.edwardscg.com/api/v1/videos/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Premium Leather Wallet",
"description": "Handcrafted full-grain leather wallet with RFID blocking. Features 8 card slots and 2 bill compartments.",
"image_url": "https://example.com/wallet.jpg"
}'Response
{
"id": "vid_abc123",
"status": "processing",
"created_at": "2024-01-15T10:30:00Z",
"estimated_completion": "2024-01-15T10:35:00Z",
"content": {
"title": "Premium Leather Wallet",
"description": "Handcrafted full-grain leather..."
}
}Webhooks
Instead of polling for video status, configure webhooks to receive notifications when videos are completed.
Webhook Events
video.completedVideo generation finished successfullyvideo.failedVideo generation failedcontent.createdNew content item added// Webhook payload example
{
"event": "video.completed",
"data": {
"id": "vid_abc123",
"status": "completed",
"video_url": "https://adflow.edwardscg.com/cdn/videos/vid_abc123.mp4",
"thumbnail_url": "https://adflow.edwardscg.com/cdn/thumbnails/vid_abc123.jpg"
},
"timestamp": "2024-01-15T10:35:00Z"
}Webhook Security
All webhook requests include a signature header for verification. Always verify the signature before processing webhook payloads to ensure requests are authentic.
Signature Verification
Header: X-AdFlow-Signature
Algorithm: HMAC-SHA256
Secret: Your webhook signing secret (found in Settings → API)
// Node.js signature verification example
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload, 'utf8')
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}Rate Limits
API requests are rate limited to ensure fair usage and platform stability.
| Plan | Rate Limit | Concurrent Jobs |
|---|---|---|
| Business | 100 requests/minute | 5 |
| Enterprise | 1000 requests/minute | 20+ |
Rate Limit Headers
API responses include X-RateLimit-Remainingand X-RateLimit-Reset headers to help you manage request pacing.
Error Handling
The API uses standard HTTP status codes and returns structured error responses.
400Bad Request
Invalid request parameters
401Unauthorized
Invalid or missing API key
403Forbidden
API access not enabled for your plan
429Too Many Requests
Rate limit exceeded
500Internal Server Error
Something went wrong on our end
SDKs & Libraries
Official SDKs are coming soon. In the meantime, you can use any HTTP client to interact with the API.
JavaScript/Node.js
Coming Soon
Python
Coming Soon
Ruby
Coming Soon