Update Automation

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

Response Body

Success

TypeScript Definitions

Use the response body type in TypeScript.

metaobject
dataobject
errorobject | null | null
linksobject
const body = JSON.stringify({
  "name": "My Updated Automation",
  "workflow": [
    {
      "kind": "nsfw"
    },
    {
      "kind": "description"
    },
    {
      "kind": "image",
      "width": 480,
      "format": "png",
      "ref": "big_thumbnail"
    },
    {
      "kind": "conditions",
      "conditions": [
        {
          "prop": "media.kind",
          "value": "video"
        }
      ],
      "next": [
        {
          "kind": "subtitle",
          "ref": "subtitle"
        }
      ]
    }
  ],
  "status": "active"
})

fetch("https://api.ittybit.com/automations/auto_abcdefgh1234", {
  headers: {
    "Authorization": "Bearer <token>"
  },
  body
})
{
  "meta": {
    "request_id": "req_abcdefghij1234567890",
    "org_id": "org_abcdefgh1234",
    "project_id": "prj_abcdefgh1234",
    "version": "2025-01-01",
    "type": "object"
  },
  "data": {
    "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"
  },
  "error": null,
  "links": {
    "self": "https://api.ittybit.com/automations/auto_abcdefgh1234",
    "parent": "https://api.ittybit.com/automations"
  }
}