Automations

Manage automated workflows

Get all automations

Retrieves a list of all automations for the current project

GET
/automations

Authorization

AuthorizationRequiredBearer <token>

Requires a Bearer token in the Authorization header. Format: Authorization: Bearer YOUR_API_KEY

In: header

Response Body

A list of automations

TypeScript Definitions

Use the response body type in TypeScript.

metaobject
dataarray<object>
linksobject
curl -X GET "https://api.ittybit.com/automations" \
  -H "Authorization: Bearer <token>"
{
  "meta": {
    "id": "req_listAuto123",
    "status": 200,
    "object": "list",
    "total": 1,
    "page": 1,
    "limit": 20,
    "pages": 1
  },
  "data": [
    {
      "id": "auto_abc123",
      "name": "Example Automation",
      "status": "active",
      "trigger": {
        "event": "media.ready",
        "conditions": [
          {
            "prop": "media.kind",
            "value": "video"
          }
        ]
      },
      "workflow": [
        {
          "kind": "video",
          "format": "mp4",
          "width": 1280,
          "height": 720
        }
      ],
      "created": "2023-05-21T14:22:10Z",
      "updated": "2023-05-21T14:22:10Z"
    }
  ],
  "links": {
    "self": "/automations?page=1"
  }
}

Create a new automation

Creates a new automation for the current project

POST
/automations

Authorization

AuthorizationRequiredBearer <token>

Requires a Bearer token in the Authorization header. Format: Authorization: Bearer YOUR_API_KEY

In: header

Request Body

application/jsonRequired

Automation definition to create.

bodyRequiredunknown

Response Body

Automation created successfully

TypeScript Definitions

Use the response body type in TypeScript.

metaobject
dataobject
linksobject
curl -X POST "https://api.ittybit.com/automations" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Transcode Videos to MP4/WebM",
    "description": "Creates web-friendly versions upon video upload.",
    "trigger": {
      "event": "upload.completed",
      "conditions": [
        {
          "prop": "file.type",
          "value": "video/*"
        }
      ]
    },
    "workflow": [
      {
        "kind": "video",
        "format": "mp4",
        "resize": "fit",
        "width": 1920,
        "height": 1080,
        "label": "web_1080p_mp4"
      },
      {
        "kind": "video",
        "format": "webm",
        "resize": "fit",
        "width": 1920,
        "height": 1080,
        "label": "web_1080p_webm"
      }
    ]
  }'
{
  "meta": {
    "id": "req_createAuto789",
    "status": 201,
    "object": "automation"
  },
  "data": {
    "id": "auto_newlyCreatedId",
    "name": "New Automation",
    "status": "active",
    "trigger": {
      "event": "upload.completed",
      "conditions": [
        {
          "prop": "file.type",
          "value": "video/*"
        }
      ]
    },
    "workflow": [
      {
        "kind": "video",
        "format": "mp4",
        "width": 1280,
        "height": 720
      }
    ],
    "created": "2023-05-22T09:15:30Z",
    "updated": "2023-05-22T09:15:30Z"
  },
  "links": {
    "self": "/automations/auto_newlyCreatedId"
  }
}

Get automation by ID

Retrieves a specific automation by its ID

GET
/automations/{id}

Authorization

AuthorizationRequiredBearer <token>

Requires a Bearer token in the Authorization header. Format: Authorization: Bearer YOUR_API_KEY

In: header

Path Parameters

idRequiredstring

The automation ID

Response Body

Automation details

TypeScript Definitions

Use the response body type in TypeScript.

metaobject
dataobject
linksobject
curl -X GET "https://api.ittybit.com/automations/string" \
  -H "Authorization: Bearer <token>"
{
  "meta": {
    "id": "req_getAuto456",
    "status": 200,
    "object": "automation"
  },
  "data": {
    "id": "auto_abc123",
    "name": "Example Automation",
    "status": "active",
    "trigger": {
      "event": "media.ready",
      "conditions": [
        {
          "prop": "media.kind",
          "value": "video"
        }
      ]
    },
    "workflow": [
      {
        "kind": "video",
        "format": "mp4",
        "width": 1280,
        "height": 720
      }
    ],
    "created": "2023-05-21T14:22:10Z",
    "updated": "2023-05-21T14:22:10Z"
  },
  "links": {
    "self": "/automations/auto_abc123"
  }
}

Delete an automation

Deletes an automation by its ID

DELETE
/automations/{id}

Authorization

AuthorizationRequiredBearer <token>

Requires a Bearer token in the Authorization header. Format: Authorization: Bearer YOUR_API_KEY

In: header

Path Parameters

idRequiredstring

The automation ID

Response Body

Automation deleted successfully

curl -X DELETE "https://api.ittybit.com/automations/string" \
  -H "Authorization: Bearer <token>"
Empty

Update an automation

Updates an existing automation by its ID

PUT
/automations/{id}

Authorization

AuthorizationRequiredBearer <token>

Requires a Bearer token in the Authorization header. Format: Authorization: Bearer YOUR_API_KEY

In: header

Request Body

application/jsonRequired

Automation definition properties to update.

nameRequiredstring
descriptionstring
triggerobject

Defines the trigger event and conditions. To clear/remove a trigger, provide null. To update, provide the new trigger object.

workflowarray<object>

The updated sequence of tasks for the automation.

Path Parameters

idRequiredstring

The ID of the automation to update.

Response Body

Automation updated successfully

TypeScript Definitions

Use the response body type in TypeScript.

metaobject
dataobject
linksobject
curl -X PUT "https://api.ittybit.com/automations/string" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Transcoder Example",
    "status": "inactive",
    "trigger": {
      "event": "upload.completed",
      "conditions": [
        {
          "prop": "file.type",
          "value": "image/*"
        }
      ]
    },
    "workflow": [
      {
        "kind": "image",
        "format": "webp",
        "label": "archive_image"
      }
    ]
  }'
{
  "meta": {
    "id": "req_updateAutoABC",
    "status": 200,
    "object": "automation"
  },
  "data": {
    "id": "auto_abc123",
    "name": "Updated Name",
    "status": "inactive",
    "trigger": {
      "event": "media.ready",
      "conditions": [
        {
          "prop": "media.kind",
          "value": "image"
        }
      ]
    },
    "workflow": [
      {
        "kind": "image",
        "format": "webp",
        "width": 800
      }
    ],
    "created": "2023-05-21T14:22:10Z",
    "updated": "2023-05-23T11:45:22Z"
  }
}