Attach metadata to jobs

View Markdown

โ€œTapestryโ€ (a UGC platform like Bazaarvoice) processes thousands of user-submitted videos daily. Metadata lets you tag each job with your own IDs, labels, and context so you can match results back to your records.

API

ittybit video \
  -i https://tapestry-app.com/submissions/video-9182.mov \
  --width 1280 \
  --format mp4
const task = {
  input: 'https://tapestry-app.com/submissions/video-9182.mov',
  kind: 'video',
  options: {
    width: 1280,
    format: 'mp4',
  },
  metadata: {
    user_id: 'usr_abc123',
    submission_id: 'sub_9182',
    campaign: 'summer-launch',
  },
};

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://tapestry-app.com/submissions/video-9182.mov",
    "kind": "video",
    "options": {
        "width": 1280,
        "format": "mp4",
    },
    "metadata": {
        "user_id": "usr_abc123",
        "submission_id": "sub_9182",
        "campaign": "summer-launch",
    },
}

res = requests.post(
    "https://api.ittybit.com/jobs",
    headers={"Authorization": f"Bearer {api_key}"},
    json=task,
)
data = res.json()
JOB='{
  "input": "https://tapestry-app.com/submissions/video-9182.mov",
  "kind": "video",
  "options": {
    "width": 1280,
    "format": "mp4"
  },
  "metadata": {
    "user_id": "usr_abc123",
    "submission_id": "sub_9182",
    "campaign": "summer-launch"
  }
}'

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

The metadata object is returned in the job response and webhook payload. Use any string key-value pairs.

Use cases

KeyPurpose
user_idMatch back to your user record
order_idLink to an e-commerce order
campaignGroup jobs by marketing campaign
sourceTrack where the upload came from
priorityYour own priority flag

Metadata in webhooks

When the job completes, the metadata comes back in the webhook payload โ€” no extra lookup needed to figure out which user or record the result belongs to.

{
  "id": "job_abc123",
  "status": "succeeded",
  "metadata": {
    "user_id": "usr_abc123",
    "submission_id": "sub_9182",
    "campaign": "summer-launch"
  },
  "output": {
    "url": "https://cdn.ittybit.com/..."
  }
}