> ## Documentation Index
> Fetch the complete documentation index at: https://basedash.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update an automation

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



## OpenAPI

````yaml https://charts.basedash.com/api/public/openapi patch /api/public/organizations/{orgId}/automations/{id}
openapi: 3.1.0
info:
  title: Basedash Public API
  version: 0.0.0
  description: >-
    API for programmatic access to Basedash features. Use API keys for
    authentication.
  contact:
    name: Basedash Support
    url: https://basedash.com
    email: support@basedash.com
servers:
  - url: https://charts.basedash.com
    description: Production
security: []
tags:
  - name: Organizations
    description: Manage organizations
  - name: Groups
    description: Manage organization groups and memberships
  - name: Data Sources
    description: Manage database connections and data sources
  - name: MCP servers
    description: Manage MCP server data sources
  - name: Insights
    description: Manage generated insights
  - name: Automations
    description: Manage automations and automation runs
  - name: Skills
    description: Manage organization skills
  - name: Definitions
    description: Manage reusable SQL definitions
paths:
  /api/public/organizations/{orgId}/automations/{id}:
    patch:
      tags:
        - Automations
      summary: Update an automation
      description: Updates an automation by ID. Requires admin access to the organization.
      parameters:
        - schema:
            type: string
            description: Organization ID
          required: true
          description: Organization ID
          name: orgId
          in: path
        - schema:
            type: string
            description: Automation ID
          required: true
          description: Automation ID
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAutomationInput'
      responses:
        '200':
          description: Automation updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAutomationResponse'
        '400':
          description: Bad request - Invalid JSON body or validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found - Automation not found or no admin access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded - Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateAutomationInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        icon:
          type: string
        color:
          type: string
        instructions:
          type: string
        active:
          type: boolean
        triggerType:
          type: string
          enum:
            - MANUAL
            - SCHEDULE
            - DATA_CHANGE
        frequency:
          type: string
          enum:
            - DAILY
            - WEEKDAYS
            - WEEKLY
            - MONTHLY
            - QUARTERLY
        preferredHour:
          type: integer
          minimum: 0
          maximum: 23
        preferredDayOfWeek:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 6
        preferredDayOfMonth:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 31
        triggerDatabaseConnectionId:
          type:
            - string
            - 'null'
        triggerSqlQuery:
          type: string
        slackChannel:
          type:
            - string
            - 'null'
        emailRecipients:
          type: string
    PublicAutomationResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/PublicAutomation'
      required:
        - data
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - error
    RateLimitErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/RateLimitError'
      required:
        - error
    PublicAutomation:
      type: object
      properties:
        id:
          type: string
          description: Automation ID
        organizationId:
          type: string
          description: Organization ID
        name:
          type: string
          description: Automation name
        icon:
          type: string
          description: Automation icon name
        color:
          type: string
          description: Automation icon color
        instructions:
          type: string
          description: Automation instructions
        active:
          type: boolean
          description: Whether the automation is enabled
        archivedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: Archive timestamp, if archived
        trigger:
          $ref: '#/components/schemas/PublicAutomationTrigger'
        notifications:
          $ref: '#/components/schemas/PublicAutomationNotifications'
        createdByMemberId:
          type: string
          description: Member ID that created the automation
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
      required:
        - id
        - organizationId
        - name
        - icon
        - color
        - instructions
        - active
        - archivedAt
        - trigger
        - notifications
        - createdByMemberId
        - createdAt
        - updatedAt
    ApiError:
      type: object
      properties:
        title:
          type: string
          description: Error type identifier
        detail:
          type: string
          description: Human-readable error description
      required:
        - title
        - detail
    RateLimitError:
      allOf:
        - $ref: '#/components/schemas/ApiError'
        - type: object
          properties:
            title:
              type: string
              enum:
                - RateLimitExceeded
            retryAfterMs:
              type: number
              description: Milliseconds until the rate limit window resets
          required:
            - retryAfterMs
    PublicAutomationTrigger:
      type: object
      properties:
        type:
          type: string
          enum:
            - MANUAL
            - SCHEDULE
            - DATA_CHANGE
          description: Automation trigger type
        frequency:
          type: string
          enum:
            - DAILY
            - WEEKDAYS
            - WEEKLY
            - MONTHLY
            - QUARTERLY
          description: Schedule frequency for scheduled automations
        preferredHour:
          type: integer
          minimum: 0
          maximum: 23
          description: Preferred UTC hour for scheduled runs
        preferredDayOfWeek:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 6
          description: Preferred day of week for weekly schedules, where 0 is Sunday
        preferredDayOfMonth:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 31
          description: Preferred day of month for monthly schedules
        databaseConnectionId:
          type:
            - string
            - 'null'
          description: Data source ID for data change triggers
        sqlQuery:
          type: string
          description: SQL query for data change triggers
      required:
        - type
        - frequency
        - preferredHour
        - preferredDayOfWeek
        - preferredDayOfMonth
        - databaseConnectionId
        - sqlQuery
    PublicAutomationNotifications:
      type: object
      properties:
        slackChannel:
          type:
            - string
            - 'null'
          description: Slack channel for automation notifications
        emailRecipients:
          type: string
          description: Comma-separated email recipients for automation notifications
      required:
        - slackChannel
        - emailRecipients
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication using Bearer token format: `Bearer
        <basedash_api_key>`

````