---
title: "Update an automation"
method: PATCH
path: "/api/public/organizations/{orgId}/automations/{id}"
tags: ["Automations"]
---

# Update an automation

`PATCH /api/public/organizations/{orgId}/automations/{id}`

## Request

- Base URL: `https://charts.basedash.com`
- URL: `https://charts.basedash.com/api/public/organizations/{orgId}/automations/{id}`
- Auth: HTTP bearer

Updates an automation by ID. Requires admin access to the organization.

## Path parameters

- `orgId` string, required: Organization ID
- `id` string, required: Automation ID

## Request body

- UpdateAutomationInput
  - `name` string
  - `icon` string
  - `color` string
  - `instructions` string
  - `active` boolean
  - `triggerType` 'MANUAL' | 'SCHEDULE' | 'DATA_CHANGE'
  - `frequency` 'DAILY' | 'WEEKDAYS' | 'WEEKLY' | 'MONTHLY' | 'QUARTERLY'
  - `preferredHour` integer
  - `preferredDayOfWeek` integer, nullable
  - `preferredDayOfMonth` integer, nullable
  - `triggerDatabaseConnectionId` string, nullable
  - `triggerSqlQuery` string
  - `slackChannel` string, nullable
  - `emailRecipients` string

## Response `200`

Automation updated successfully

- PublicAutomationResponse
  - `data` PublicAutomation, required
    - `id` string, required: Automation ID
    - `organizationId` string, required: Organization ID
    - `name` string, required: Automation name
    - `icon` string, required: Automation icon name
    - `color` string, required: Automation icon color
    - `instructions` string, required: Automation instructions
    - `active` boolean, required: Whether the automation is enabled
    - `archivedAt` string, date-time, nullable, required: Archive timestamp, if archived
    - `trigger` PublicAutomationTrigger, required
      - `type` 'MANUAL' | 'SCHEDULE' | 'DATA_CHANGE', required: Automation trigger type
      - `frequency` 'DAILY' | 'WEEKDAYS' | 'WEEKLY' | 'MONTHLY' | 'QUARTERLY', required: Schedule frequency for scheduled automations
      - `preferredHour` integer, required: Preferred UTC hour for scheduled runs
      - `preferredDayOfWeek` integer, nullable, required: Preferred day of week for weekly schedules, where 0 is Sunday
      - `preferredDayOfMonth` integer, nullable, required: Preferred day of month for monthly schedules
      - `databaseConnectionId` string, nullable, required: Data source ID for data change triggers
      - `sqlQuery` string, required: SQL query for data change triggers
    - `notifications` PublicAutomationNotifications, required
      - `slackChannel` string, nullable, required: Slack channel for automation notifications
      - `emailRecipients` string, required: Comma-separated email recipients for automation notifications
    - `createdByMemberId` string, required: Member ID that created the automation
    - `createdAt` string, date-time, required: Creation timestamp
    - `updatedAt` string, date-time, required: Last update timestamp

## Other responses

- `400`: Bad request - Invalid JSON body or validation error
- `401`: Unauthorized - Missing or invalid API key
- `404`: Not found - Automation not found or no admin access
- `429`: Rate limit exceeded - Too many requests
- `500`: Internal server error

---

[API](https://skmtc.dev/basedash/apis/basedash-public-api.md) - [All operations](https://skmtc.dev/basedash/apis/basedash-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/basedash/apis/basedash-public-api/revisions/efb9d40bc6f7?raw)
