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/v1

All 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. 1.Go to Settings in your AdFlow dashboard
  2. 2.Navigate to the API section
  3. 3.Click "Generate API Key"
  4. 4.Copy and securely store your key

API keys are shown only once. Store them securely and never share them publicly.

Core Endpoints

GET/videos

List all videos in your organization

Returns: Array of video objects with pagination
POST/videos/generate

Generate a new video from content

Requires: content_id or image_url + title + description
GET/videos/:id

Get details for a specific video

Returns: Video object with status, URLs, and metadata
GET/content

List all content items

Returns: Array of content objects with pagination
POST/content

Create a new content item

Requires: title, description, image (URL or base64)

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 successfully
video.failedVideo generation failed
content.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.

PlanRate LimitConcurrent Jobs
Business100 requests/minute5
Enterprise1000 requests/minute20+

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.

400

Bad Request

Invalid request parameters

401

Unauthorized

Invalid or missing API key

403

Forbidden

API access not enabled for your plan

429

Too Many Requests

Rate limit exceeded

500

Internal 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

Related Documentation