# Welcome Source: https://docs.videoaiditor.com/api-reference/introduction Welcome to the VideoAiditor API documentation. *** ## About VideoAiditor offers a powerful REST API, enables you to programmatically create, edit, and render professional videos at scale. Whether you're building an AI video platform, automating content creation, or integrating video capabilities into your application, our API provides the tools you need to succeed. ## Authentication All API endpoints are authenticated using API keys. Include your API key in the request header as `x-api-key`. # Rate Limits Source: https://docs.videoaiditor.com/api-reference/ratelimits API rate limits and quotas for VideoAiditor VideoAiditor enforces rate limits to ensure fair usage of our APIs. During the testing phase, the following limits apply per user: ### Daily Limit * 1,000 requests per day (24-hour period) ### Hourly Limit * 300 requests per hour ### Per Minute Limit * 10 requests per minute If you exceed any of these limits, the API will return a `429 Too Many Requests` response. We recommend implementing exponential backoff in your application to handle rate limiting gracefully. ## Why These Limits? As we are currently in the testing phase, these limits are in place to help us monitor and adjust our system. Once we officially launch, you will be able to obtain your own API key, with rate limits as per your specific use case. # Create Render Source: https://docs.videoaiditor.com/api-reference/renders/create POST /v1/renders # Create Render By Video Id Source: https://docs.videoaiditor.com/api-reference/renders/createById POST /v1/renders/{videoId} # Get All render by video Id Source: https://docs.videoaiditor.com/api-reference/renders/get GET /v1/renders # Get Render By Render Id Source: https://docs.videoaiditor.com/api-reference/renders/getById GET /v1/renders/{id} # Create Videos Source: https://docs.videoaiditor.com/api-reference/videos/create POST /v1/videos # Get Videos Source: https://docs.videoaiditor.com/api-reference/videos/get GET /v1/videos # Get Videos By Id Source: https://docs.videoaiditor.com/api-reference/videos/getById GET /v1/videos/{id} # Update Videos Source: https://docs.videoaiditor.com/api-reference/videos/update PATCH /v1/videos/{id} # Webhook Integration Source: https://docs.videoaiditor.com/api-reference/webhook Webhooks allow you to receive real-time notifications when video renders are completed or failed. Instead of polling our API, webhooks will send HTTP requests to your server when these events occur.. ## Events The following webhook events are available: * `render.completed`: Triggered when a video render completes successfully * `render.failed`: Triggered when a video render fails ## Setting up Webhooks ### 1. Create a Webhook Endpoint First, create an endpoint on your server to receive webhook events. The endpoint should be publicly accessible. ### 2. Register the Webhook Register the webhook using the dashboard. Go to dashboard in the webhook panel and add your webhook endpoint. ## Webhook Payload When an event occurs, you'll receive a POST request with the following payload structure: ```json theme={null} { "event": "render.completed", "data": { "_id": "render-id", "status": "completed", "outputUrl": "https://cdn.example.com/video.mp4", "error": "", "videoId": "video-id", "videoVersion": 1 "videoData": { // ... complete video data }, "createdAt": "2024-03-20T10:30:00Z", "updatedAt": "2024-03-20T10:31:00Z" } } ``` ## Security ### Verifying Webhook Signatures To ensure the webhook request came from us, we include a signature in the `X-Signature` header. Here's how to verify it: ```javascript theme={null} const crypto = require("crypto"); function verifyWebhookSignature(payload, signature, secret) { const expectedSignature = crypto .createHmac("sha256", secret) .update(JSON.stringify(payload)) .digest("hex"); return crypto.timingSafeEqual( Buffer.from(signature), Buffer.from(expectedSignature) ); } // In your webhook handler: app.post("/webhook", (req, res) => { const signature = req.headers["X-Signature"]; const payload = req.body; if (!verifyWebhookSignature(payload, signature, "your-webhook-secret")) { return res.status(401).send("Invalid signature"); } // Process the webhook console.log("Received valid webhook:", payload.event); res.status(200).send("OK"); }); ``` ### Best Practices 1. Always verify the webhook signature 2. Handle duplicate events (use the render ID as an idempotency key) 3. Store your webhook secret securely # Webhook Integration Guide Source: https://docs.videoaiditor.com/guides/How to access webhook Webhooks allow you to receive real-time notifications when video renders are completed or failed. Instead of polling our API, webhooks will send HTTP requests to your server when these events occur.. ## Events The following webhook events are available: * `render.completed`: Triggered when a video render completes successfully * `render.failed`: Triggered when a video render fails ## Setting up Webhooks ### 1. Create a Webhook Endpoint First, create an endpoint on your server to receive webhook events. The endpoint should be publicly accessible. ### 2. Register the Webhook Register the webhook using the dashboard. Go to dashboard in the webhook panel and add your webhook endpoint. ## Webhook Payload When an event occurs, you'll receive a POST request with the following payload structure: ```json theme={null} { "event": "render.completed", "data": { "_id": "render-id", "status": "completed", "outputUrl": "https://cdn.example.com/video.mp4", "error": "", "videoId": "video-id", "videoVersion": 1 "videoData": { // ... complete video data }, "createdAt": "2024-03-20T10:30:00Z", "updatedAt": "2024-03-20T10:31:00Z" } } ``` ## Security ### Verifying Webhook Signatures To ensure the webhook request came from us, we include a signature in the `X-Signature` header. Here's how to verify it: ```javascript theme={null} const crypto = require("crypto"); function verifyWebhookSignature(payload, signature, secret) { const expectedSignature = crypto .createHmac("sha256", secret) .update(JSON.stringify(payload)) .digest("hex"); return crypto.timingSafeEqual( Buffer.from(signature), Buffer.from(expectedSignature) ); } // In your webhook handler: app.post("/webhook", (req, res) => { const signature = req.headers["X-Signature"]; const payload = req.body; if (!verifyWebhookSignature(payload, signature, "your-webhook-secret")) { return res.status(401).send("Invalid signature"); } // Process the webhook console.log("Received valid webhook:", payload.event); res.status(200).send("OK"); }); ``` ### Best Practices 1. Always verify the webhook signature 2. Handle duplicate events (use the render ID as an idempotency key) 3. Store your webhook secret securely # How to use API Source: https://docs.videoaiditor.com/guides/How to use the API Follow these steps to create a video using the API and share video using VideoAiditor. ## Use the API to Create the Video Send your video template JSON, created via the editor, and get the link for further editing, use the following API endpoint: Add your API key to the request header as follows: * `x-api-key: YOUR_API_KEY` Send a `POST` request to `https://api.videoaiditor.com/v1/videos` with the JSON body and the appropriate headers. ## Request Body Example ```json theme={null} { "version": "", "metadata": { "name": "", "backgroundColor": "", "duration": 123, "fps": 123, "canvas": { "width": 123, "height": 123 } }, "clips": [ { "id": "", "type": "", "name": "", "source": "", "timeFrame": { "start": 123, "end": 123 }, "position": { "x": 123, "y": 123, "z": 123 }, "transform": { "scale": { "x": 123, "y": 123 }, "rotation": 123 }, "size": { "width": 123, "height": 123 }, "effects": { "opacity": 0.5 }, "textProperties": { "content": "", "fontSize": 123, "fontWeight": 123, "fontFamily": "", "color": "", "backgroundColor": "", "textAlign": "", "fontStyle": "", "lineHeight": 123, "underline": true } } ], "additional": {} } ``` ## Handle the Response Once you send the request, the API will return a response that includes data in the following format: ```json theme={null} { "data": { "metadata": { "redirectUrl": "https://videoaiditor.com/editor/{unique-id}", ... } ... ... } } ``` ### Important: Save the `redirectUrl` The response will contain a `redirectUrl` field in the metadata. **Save this URL** — it's a special link that will allow you to continue editing the video. * The URL is **public** but only accessible to users who have the link. * You can share this URL with others to allow them to edit the video. Since it's a presigned URL, no one else will be able to access it without the exact link. ## Final Notes * **Security:** Be cautious when sharing the `redirectUrl` since it provides direct access to that video in video editor. * **Public Access:** Ensure the asset URLs you provide in the JSON are publicly accessible. If they are private or restricted, the video may not load correctly when editing. * **API Key:** Keep your API key secure. Do not share it in public forums or expose it in client-side code. # How to use Source: https://docs.videoaiditor.com/guides/HowToUse How to use the VideoAiditor ## How to Create and Edit a Video Using VideoAiditor Follow these steps to upload assets, create a video, and use the API to manage and share video edits using VideoAiditor. ### Step 1: Edit a Video in the Editor 1. Go to [https://editor.videoaiditor.com](https://editor.videoaiditor.com). 2. Start by uploading your assets (e.g., images, videos, audio). 3. Edit your video using the available tools in the editor. **Note:** These uploads are client-side only — no data is actually sent to the server. ### Step 2: Export the Video Once you've created your video, go to the **Export** tab. Export Tab You have two options for exporting: * **MP4:** Choose this option if you want to download the video as an MP4 file. * **JSON:** If you want to use the video as a template for your AI platform, export the video as a JSON file. ## Replace Asset URLs in the JSON If you've chosen to export as JSON, you will need to modify the file before sending it to the API: * Open the exported JSON file. * Replace the source URLs of the assets with valid, publicly accessible URLs (e.g., links to images or video files). * Ensure that the URLs are publicly accessible; otherwise, the video may not load correctly. ## Step 3: Use the API to Create the Video Send your edited video JSON and get the link for further editing, use the following API endpoint: Add your API key to the request header as follows: * `x-api-key: YOUR_API_KEY` Send a `POST` request to `https://api.videoaiditor.com/v1/videos` with the JSON body and the appropriate headers. ### Request Body Example ```json theme={null} { "version": "", "metadata": { "name": "", "backgroundColor": "", "duration": 123, "fps": 123, "canvas": { "width": 123, "height": 123 } }, "clips": [ { "id": "", "type": "", "name": "", "source": "", "timeFrame": { "start": 123, "end": 123 }, "position": { "x": 123, "y": 123, "z": 123 }, "transform": { "scale": { "x": 123, "y": 123 }, "rotation": 123 }, "size": { "width": 123, "height": 123 }, "effects": { "opacity": 0.5 }, "textProperties": { "content": "", "fontSize": 123, "fontWeight": 123, "fontFamily": "", "color": "", "backgroundColor": "", "textAlign": "", "fontStyle": "", "lineHeight": 123, "underline": true } } ], "additional": {} } ``` ## Step 4: Handle the Response Once you send the request, the API will return a response that includes data in the following format: ```json theme={null} { "data": { "metadata": { "redirectUrl": "https://videoaiditor.com/editor/{unique-id}", ... } ... ... } } ``` ### Important: Save the `redirectUrl` The response will contain a `redirectUrl` field in the metadata. **Save this URL** — it's a special link that will allow you to continue editing the video. * The URL is **public** but only accessible to users who have the link. * You can share this URL with others to allow them to edit the video. Since it's a presigned URL, no one else will be able to access it without the exact link. ## Final Notes * **Security:** Be cautious when sharing the `redirectUrl` since it provides direct access to that video in video editor. * **Public Access:** Ensure the asset URLs you provide in the JSON are publicly accessible. If they are private or restricted, the video may not load correctly when editing. * **API Key:** Keep your API key secure. Do not share it in public forums or expose it in client-side code. # Introduction Source: https://docs.videoaiditor.com/introduction Welcome to the videoaiditor.com API documentation ## API Reference Our user-friendly REST API documentation will guide you every step of the way. ## Screenshot Hero Light Hero Dark