Automations API
Ittybit's Automations API allows you to allows you to trigger a Workflowbased on events, running a series of tasks for every upload.
Endpoint
# Automations POST https://api.ittybit.com/automations // Create Automation GET https://api.ittybit.com/automations // List Automations
Sample request
Create an automation that extracts speech and generates a thumbnail track when a video file is uploaded.
const response = await fetch("https://api.ittybit.com/automations", { headers: { Method: "POST", Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json", body: JSON.stringify({ "name": "All video uploads", "trigger": { "event": "media.created", "conditions": [ {"prop": "kind", "value": "video"} ] }, "tasks": [ { "kind": "image", "start": 0 }, { "kind": "video", "width": 600, "format": "mp4", "filename": "600.mp4", "next": [ { "kind": "speech", "next": [ { "kind": "subtitles" } ] }, { "kind": "thumbnails" } ] } ] }), }, });
Sample response
Body Parameters
Required
-
trigger object (required) An object that contains the
event
andconditions
that set off the automation- event string
- The event that the automation listens for.
- conditions array
- An array of objects that contain property-value pairs of the target event media that have to be met for the automation to set off.
- event string
-
tasks array (required) An array of
Tasks
to be executed once theevent
is detected and the conditions are met in theTrigger
-
name string A name for the automation.
List Automations
Returns a list of all automations in your project.
const response = await fetch("https://api.ittybit.com/automations", { headers: { Authorization: `Bearer ${API_KEY}`, }, });
Endpoint
GET https://api.ittybit.com/automations
Body Parameters
-
page integer
The page number to return. Default is 1.
-
limit integer
The number of items to return per page. Default is 12. Maximum is 100.
-
sort string
The field to sort by. Default is
created
. Possible values arecreated
orupdated
-
order string
The order to sort by. Default is
desc
. Possible values areasc
,desc
.