---
title: "Update an automation rule"
method: PATCH
path: "/api/workspaces/{workspaceId}/automations/{ruleId}"
tags: ["Automations"]
---

# Update an automation rule

`PATCH /api/workspaces/{workspaceId}/automations/{ruleId}`

## Request

- Base URL: `https://hiveship.app/api`
- URL: `https://hiveship.app/api/api/workspaces/{workspaceId}/automations/{ruleId}`
- Auth: API key in cookie `hiveship_access`

## Path parameters

- `workspaceId` string, required
- `ruleId` string, required

## Request body

- object
  - `name` string
  - `description` string
  - `trigger` object
    - `event` 'issue_created' | 'issue_status_changed' | 'issue_labeled' | 'agent_session_completed' | 'agent_session_errored' | 'due_date_approaching' | 'due_date_overdue' | 'issue_stale' | 'recurring_schedule', required
    - `conditions` object[]
      - `field` string, required
      - `operator` 'equals' | 'not_equals' | 'contains' | 'in', required
      - `value` union, required
        - string
        - string[]
    - `params` object
      - `days` integer
      - `status` string
      - `cadence` 'daily' | 'weekly' | 'monthly'
  - `actions` object[]
    - `type` 'change_status' | 'assign_user' | 'delegate_to_agent' | 'add_label' | 'send_notification' | 'create_issue', required
    - `params` object, required
  - `isActive` boolean

## Response `200`

Automation rule updated

- object
  - `success` boolean, required
  - `data` object, required
    - `id` string, cuid, required
    - `name` string, required
    - `description` string, nullable, required
    - `trigger` object, required
      - `event` 'issue_created' | 'issue_status_changed' | 'issue_labeled' | 'agent_session_completed' | 'agent_session_errored' | 'due_date_approaching' | 'due_date_overdue' | 'issue_stale' | 'recurring_schedule', required
      - `conditions` object[], required
        - `field` string, required
        - `operator` 'equals' | 'not_equals' | 'contains' | 'in', required
        - `value` union, required
          - string
          - string[]
      - `params` object
        - `days` integer
        - `status` string
        - `cadence` 'daily' | 'weekly' | 'monthly'
    - `actions` object[], required
      - `type` 'change_status' | 'assign_user' | 'delegate_to_agent' | 'add_label' | 'send_notification' | 'create_issue', required
      - `params` object, required
    - `isActive` boolean, required
    - `projectId` string, cuid, nullable, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

- `403`: Only workspace OWNER or ADMIN can manage automations
- `404`: Rule not found

---

[API](https://skmtc.dev/hiveship/apis/hiveship-api.md) · [All operations](https://skmtc.dev/hiveship/apis/hiveship-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hiveship/apis/hiveship-api/revisions/73d3e26544e4?raw)
