Update Automation

View Markdown

Update an automation by ID.


PATCH
/automations/{id}

Authorization

AuthorizationRequiredBearer <token>

See API Security for more details.

In: header

Request Body

application/jsonRequired

The request body should contain a properly formatted JSON object. See Automation Objects and Tasks for all the optional props.

namestring
descriptionstring
triggerobject
workflowarray<object>
statusstring
Value in: "active" | "paused"

Path Parameters

idRequiredstring

Header Parameters

Accept-Versionstring

Specifies the API Version

Default: "2025-08-20"Value in: "2025-08-20" | "latest"

Response Body

Success

idRequiredstring
namestring
descriptionstring
triggerRequiredobject
workflowRequiredarray<Any properties in object,object>
statusRequiredstring
Value in: "active" | "paused"
createdRequiredstring
Format: "date-time"
updatedRequiredstring
Format: "date-time"
const body = {
  name: "My Updated Automation",
  workflow: [
    { kind: "nsfw" },
    { kind: "description" },
    { kind: "image", ref: "big_thumbnail" },
    { kind: "video", 
      next: [{ kind: "subtitle", ref: "subtitle" }] 
    }
  ],
  status: "active"
};

const automation = await fetch("https://api.ittybit.com/automations/auto_abcdefgh1234", {
  method: "PATCH",
  headers: { "Authorization": "Bearer ITTYBIT_API_KEY" },
  body: JSON.stringify(body)
})
{
  "id": "auto_abcdefgh1234",
  "object": "automation",
  "name": "My Updated Automation",
  "description": "This workflow will run whenever new media is created.",
  "trigger": {
    "kind": "event",
    "event": "media.created"
  },
  "workflow": [
    {
      "kind": "nsfw"
    },
    {
      "kind": "description"
    },
    {
      "kind": "image",
      "width": 480,
      "format": "png",
      "ref": "big_thumbnail"
    },
    {
      "kind": "conditions",
      "conditions": [
        {
          "prop": "kind",
          "value": "video"
        }
      ],
      "next": [
        {
          "kind": "subtitle",
          "ref": "subtitle"
        }
      ]
    }
  ],
  "created": "2025-01-01T01:23:45Z",
  "updated": "2025-01-02T01:23:45Z",
  "status": "active"
}