Api referencePresets
Create Preset
Create a reusable preset that stores FFmpeg command configuration for repeated execution.
Create Preset
POST /api/v1/presetsCreate a reusable preset that encapsulates an FFmpeg command configuration. Presets store the command, input file aliases, and output file definitions so you can execute the same processing pipeline repeatedly by providing only the input files.
Authentication
Requires API key via X-API-KEY header.
Request
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Content-Type | string | Yes | Must be application/json |
X-API-KEY | string | Yes | Your API key with ffsk_ prefix |
Body
interface CreatePresetRequest {
name: string;
description?: string;
command_type?: "FFMPEG_COMMAND" | "CHAINED_COMMAND" | "MULTIPLE_COMMAND";
ffmpeg_command?: string;
ffmpeg_commands?: string[];
input_file_keys: string[];
output_file_definitions: Record<string, string>;
metadata?: Record<string, string | number | boolean>;
}| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | A descriptive name for the preset. |
description | string | No | Optional description of what the preset does. |
command_type | string | No | One of FFMPEG_COMMAND, CHAINED_COMMAND, or MULTIPLE_COMMAND. Defaults to FFMPEG_COMMAND. |
ffmpeg_command | string | Conditional | The FFmpeg command with {{alias}} placeholders. Required when command_type is FFMPEG_COMMAND. |
ffmpeg_commands | string[] | Conditional | Array of FFmpeg commands to run sequentially. Required when command_type is CHAINED_COMMAND. |
input_file_keys | string[] | Yes | Array of in_* alias keys that the preset expects as input. |
output_file_definitions | Record<string, string> | Yes | Map of out_* alias names to output filenames. |
metadata | Record<string, string | number | boolean> | No | Arbitrary key-value metadata attached to the preset. Maximum 10 keys. |
Response
201 Created
interface PresetResponse {
preset_id: string;
name: string;
description: string | null;
is_system: boolean;
command_type: "FFMPEG_COMMAND" | "CHAINED_COMMAND" | "MULTIPLE_COMMAND";
ffmpeg_command: string | null;
ffmpeg_commands: string[] | null;
input_file_keys: string[];
output_file_definitions: Record<string, string>;
metadata: Record<string, string | number | boolean> | null;
created_at: string;
updated_at: string;
}| Field | Type | Description |
|---|---|---|
preset_id | string | Unique identifier for the preset. |
name | string | The preset name. |
description | string | null | The preset description, or null if not provided. |
is_system | boolean | Whether this is a system-provided preset. Always false for user-created presets. |
command_type | string | The type of command configuration stored in the preset. |
ffmpeg_command | string | null | The FFmpeg command template, or null if not applicable. |
ffmpeg_commands | string[] | null | The array of FFmpeg commands, or null if not applicable. |
input_file_keys | string[] | The expected input file alias keys. |
output_file_definitions | Record<string, string> | The output file alias-to-filename mapping. |
metadata | Record<string, string | number | boolean> | null | The attached metadata, or null if not provided. |
created_at | string | ISO 8601 timestamp of when the preset was created. |
updated_at | string | ISO 8601 timestamp of when the preset was last updated. |
Error responses
| Status | Error | Description |
|---|---|---|
400 | INVALID_REQUEST | Missing required fields or invalid field values. |
401 | UNAUTHORIZED | Missing or invalid API key. |
422 | VALIDATION_ERROR | Validation failed (e.g., metadata exceeds 10 keys, missing command for command type). |
429 | RATE_LIMITED | Too many requests. Retry after the period indicated in the Retry-After header. |
Examples
curl
curl -X POST https://renderio.dev/api/v1/presets \
-H "Content-Type: application/json" \
-H "X-API-KEY: ffsk_your_api_key_here" \
-d '{
"name": "MP4 to WebM",
"description": "Convert an MP4 video to WebM format using VP9 codec",
"command_type": "FFMPEG_COMMAND",
"ffmpeg_command": "ffmpeg -i {{in_video}} -c:v libvpx-vp9 -crf 30 -b:v 0 {{out_video}}",
"input_file_keys": ["in_video"],
"output_file_definitions": {
"out_video": "result.webm"
},
"metadata": {
"codec": "vp9",
"format": "webm"
}
}'JavaScript (fetch)
const response = await fetch("https://renderio.dev/api/v1/presets", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "ffsk_your_api_key_here",
},
body: JSON.stringify({
name: "MP4 to WebM",
description: "Convert an MP4 video to WebM format using VP9 codec",
command_type: "FFMPEG_COMMAND",
ffmpeg_command:
"ffmpeg -i {{in_video}} -c:v libvpx-vp9 -crf 30 -b:v 0 {{out_video}}",
input_file_keys: ["in_video"],
output_file_definitions: {
out_video: "result.webm",
},
metadata: {
codec: "vp9",
format: "webm",
},
}),
});
const preset = await response.json();
console.log("Preset ID:", preset.preset_id);Python (requests)
import requests
response = requests.post(
"https://renderio.dev/api/v1/presets",
headers={
"Content-Type": "application/json",
"X-API-KEY": "ffsk_your_api_key_here",
},
json={
"name": "MP4 to WebM",
"description": "Convert an MP4 video to WebM format using VP9 codec",
"command_type": "FFMPEG_COMMAND",
"ffmpeg_command": "ffmpeg -i {{in_video}} -c:v libvpx-vp9 -crf 30 -b:v 0 {{out_video}}",
"input_file_keys": ["in_video"],
"output_file_definitions": {
"out_video": "result.webm",
},
"metadata": {
"codec": "vp9",
"format": "webm",
},
},
)
data = response.json()
print("Preset ID:", data["preset_id"])