Organize output with path templates

View Markdown

Dumping all output into a flat folder doesn’t scale. Path templates let you route processed files into structured directories automatically.

“Prismatic” (a media agency like Bynder) manages video assets for dozens of clients. They use path templates to keep output organized by date, client, and format.

API

Use template variables in the output path. Ittybit replaces them at processing time:

ittybit video \
  -i https://prismatic-agency.com/uploads/spot-tv-30s.mov \
  -o "s3://prismatic-output/processed/{date}/{filename}.mp4" \
  --width 1920 \
  --format mp4
const task = {
  input: 'https://prismatic-agency.com/uploads/spot-tv-30s.mov',
  kind: 'video',
  options: {
    width: 1920,
    format: 'mp4',
  },
  output: 's3://prismatic-output/processed/{date}/{filename}.mp4',
};

const res = await fetch('https://api.ittybit.com/jobs', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.ITTYBIT_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(task),
});
const data = await res.json();
import requests

task = {
    "input": "https://prismatic-agency.com/uploads/spot-tv-30s.mov",
    "kind": "video",
    "options": {
        "width": 1920,
        "format": "mp4",
    },
    "output": "s3://prismatic-output/processed/{date}/{filename}.mp4",
}

res = requests.post(
    "https://api.ittybit.com/jobs",
    headers={"Authorization": f"Bearer {api_key}"},
    json=task,
)
data = res.json()
TASK='{
  "input": "https://prismatic-agency.com/uploads/spot-tv-30s.mov",
  "kind": "video",
  "options": {
    "width": 1920,
    "format": "mp4"
  },
  "output": "s3://prismatic-output/processed/{date}/{filename}.mp4"
}'

curl -X POST https://api.ittybit.com/jobs \
  -H "Authorization: Bearer $ITTYBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$TASK"

This produces a path like s3://prismatic-output/processed/2026-04-03/spot-tv-30s.mp4.

CLI

ittybit video \
  -i spot-tv-30s.mov \
  -o "s3://prismatic-output/processed/{date}/{filename}.mp4" \
  --width 1920

Template variables

VariableResolves toExample
{filename}Input filename without extensionspot-tv-30s
{ext}Output file extensionmp4
{format}Output formatmp4
{date}Processing date (YYYY-MM-DD)2026-04-03
{year}Processing year2026
{month}Processing month (zero-padded)04
{day}Processing day (zero-padded)03
{id}Task IDtask_abc123
{width}Output width1920
{height}Output height1080

Common patterns

Organize by date:

s3://bucket/processed/{year}/{month}/{day}/{filename}.{ext}
-> s3://bucket/processed/2026/04/03/spot-tv-30s.mp4

Organize by format and resolution:

s3://bucket/{format}/{width}x{height}/{filename}.{ext}
-> s3://bucket/mp4/1920x1080/spot-tv-30s.mp4

Organize by task ID (guaranteed unique):

s3://bucket/output/{id}/{filename}.{ext}
-> s3://bucket/output/task_abc123/spot-tv-30s.mp4

Multi-client structure

Combine templates with metadata to build per-client paths. Pass client info in the path directly:

ittybit video \
  -i https://prismatic-agency.com/uploads/acme-corp/spot-tv-30s.mov \
  -o "s3://prismatic-output/clients/acme-corp/{date}/{filename}.mp4" \
  --width 1920 \
  --format mp4
const clientId = 'acme-corp';

const task = {
  input: `https://prismatic-agency.com/uploads/${clientId}/spot-tv-30s.mov`,
  kind: 'video',
  options: {
    width: 1920,
    format: 'mp4',
  },
  output: `s3://prismatic-output/clients/${clientId}/{date}/{filename}.mp4`,
};

const res = await fetch('https://api.ittybit.com/jobs', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.ITTYBIT_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(task),
});
const data = await res.json();
import requests

client_id = "acme-corp"

task = {
    "input": f"https://prismatic-agency.com/uploads/{client_id}/spot-tv-30s.mov",
    "kind": "video",
    "options": {
        "width": 1920,
        "format": "mp4",
    },
    "output": f"s3://prismatic-output/clients/{client_id}/{{date}}/{{filename}}.mp4",
}

res = requests.post(
    "https://api.ittybit.com/jobs",
    headers={"Authorization": f"Bearer {api_key}"},
    json=task,
)
data = res.json()
TASK='{
  "input": "https://prismatic-agency.com/uploads/acme-corp/spot-tv-30s.mov",
  "kind": "video",
  "options": {
    "width": 1920,
    "format": "mp4"
  },
  "output": "s3://prismatic-output/clients/acme-corp/{date}/{filename}.mp4"
}'

curl -X POST https://api.ittybit.com/jobs \
  -H "Authorization: Bearer $ITTYBIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$TASK"

See also