---
title: "Update job"
method: PATCH
path: "/v4/automations/jobs/{job_id}"
tags: ["v4", "Automations"]
---

# Update job

`PATCH /v4/automations/jobs/{job_id}`

## Path parameters

- `job_id` union, required
  - string, uuid
  - string

## Request body

- UpdateAutomationJobRequest
  - `name` string, nullable — Job name (unique for resource)
  - `trigger` union — Trigger details
    - AutomationEventTriggerDetailsSchema
      - `type` 'event' — Trigger type
      - `config` union, required — Trigger configuration
        - AutomationOnJobEndEventTriggerConfig — Fires when the referenced upstream doc job completes successfully. `job_id` must reference a same-team doc automation job; save paths enforce this (and acyclicity) via `AutomationJobsTableClient.validate_trigger_references`. The field stays optional here so historical rows saved while the trigger was a no-op (DEF-2903) never break reads -- a null upstream is rejected on write.
          - `type` 'on_job_end' — Trigger configuration type
          - `job_id` union — Upstream doc automation job (same team) whose successful completion triggers this job
            - string, uuid
            - string
        - AutomationOnSyncEndEventTriggerConfig
          - `type` 'on_sync_end' — Trigger configuration type
          - `src_integration_id` union — Source integration ID
            - string, uuid
            - string
        - AutomationOnWebhookEventTriggerConfig
          - `type` 'webhook' — Trigger configuration type
    - AutomationScheduledTriggerDetailsSchema
      - `type` 'schedule' — Trigger type
      - `config` AutomationCronScheduledTriggerConfig, required
        - `type` 'cron' — Schedule type
        - `cron` string — Cron expression for schedule
    - AutomationNoneTriggerDetailsSchema
      - `type` 'none' — Trigger type
  - `destination` union — Destination details
    - AutomationNoneDestinationSchema
      - `skipIfEmpty` boolean — Skip writing to destination if results are empty
      - `type` 'none' — Destination type
    - AutomationSlackDestinationSchema
      - `integrationId` union — Integration ID
        - string, uuid
        - string
      - `format` 'json' | 'parquet' | 'txt' | 'csv' | 'png' | 'pdf' | 'auto' — Export format
      - `skipIfEmpty` boolean — Skip writing to destination if results are empty
      - `type` 'slack' — Destination type
      - `channelId` string, nullable — Channel ID
    - AutomationEmailDestinationSchema
      - `format` 'json' | 'parquet' | 'txt' | 'csv' | 'png' | 'pdf' | 'auto' — Export format
      - `skipIfEmpty` boolean — Skip writing to destination if results are empty
      - `type` 'email' — Destination type
      - `address` string, nullable — Email address
    - AutomationSheetsDestinationSchema
      - `integrationId` union — Integration ID
        - string, uuid
        - string
      - `skipIfEmpty` boolean — Skip writing to destination if results are empty
      - `type` 'sheets' — Destination type
      - `spreadsheetId` string, nullable — Spreadsheet ID
      - `sheet` string, nullable — Sheet name
      - `header` boolean — Include header row
      - `range` string, nullable — Sheet range
      - `overwriteSheet` boolean, nullable — Overwrite sheet
      - `overwriteRange` boolean, nullable — Overwrite range
    - AutomationExcelDestinationSchema
      - `integrationId` union — Integration ID
        - string, uuid
        - string
      - `skipIfEmpty` boolean — Skip writing to destination if results are empty
      - `type` 'excel' — Destination type
      - `workbookId` string, nullable — Workbook ID
      - `worksheet` string, nullable — Worksheet name
      - `header` boolean — Include header row
      - `range` string, nullable — Sheet range
      - `overwriteSheet` boolean, nullable — Overwrite sheet
      - `overwriteRange` boolean, nullable — Overwrite range
    - AutomationGcsDestinationSchema
      - `format` 'json' | 'parquet' | 'txt' | 'csv' | 'png' | 'pdf' | 'auto' — Export format
      - `integrationId` union — Integration ID
        - string, uuid
        - string
      - `skipIfEmpty` boolean — Skip writing to destination if results are empty
      - `type` 'gcs' — Destination type
      - `bucket` string, nullable — Bucket name
      - `blobName` string, nullable — Blob name
    - AutomationWebhookDestinationSchema
      - `skipIfEmpty` boolean — Skip writing to destination if results are empty
      - `type` 'webhook' — Destination type
      - `url` string, required — URL where the data (JSON encoded) will be sent as a POST request
    - AutomationFiThreadDestinationSchema
      - `skipIfEmpty` boolean — Skip writing to destination if results are empty
      - `type` 'fi_thread' — Destination type
      - `thread_id` string, nullable — Thread UUID (required)
      - `row_cap` integer — Maximum rows to include in XML (default 100)
      - `slack_integration_id` string, nullable — Slack integration ID for optional follow-up message
      - `slack_channel_id` string, nullable — Slack channel ID for optional follow-up message
      - `slack_template` object, nullable — Slack message template (blocks + fallback text)
  - `enabled` boolean, nullable — Enable or disable a job from running
  - `maxAttempts` integer, nullable — Optional new max attempts allowed for job run
  - `details` object, nullable — Resource-type-specific configuration. When provided, shallow-merges into the stored details object (provided keys overwrite; omitted keys are preserved). Unknown keys in the PATCH body are rejected. Omit this field entirely to leave details unchanged.

## Response `200`

Success

- SuccessResponseAutomationJobsSchema
  - `success` true, required — Flag for it request was successful
  - `data` AutomationJobsSchema, required
    - `id` union — Job ID
      - string, uuid
      - string
    - `team_id` union, required — Team ID
      - string, uuid
      - string
    - `name` string, required — Job name (unique for resource)
    - `resource_id` union, required — Associated resource ID
      - string, uuid
      - string
    - `resource_type` 'doc' | 'ducklake_integration_maintenance', required — Associated resource type
    - `trigger` union, required — Trigger details
      - AutomationEventTriggerDetailsSchema
        - `type` 'event' — Trigger type
        - `config` union, required — Trigger configuration
          - AutomationOnJobEndEventTriggerConfig — Fires when the referenced upstream doc job completes successfully. `job_id` must reference a same-team doc automation job; save paths enforce this (and acyclicity) via `AutomationJobsTableClient.validate_trigger_references`. The field stays optional here so historical rows saved while the trigger was a no-op (DEF-2903) never break reads -- a null upstream is rejected on write.
            - `type` 'on_job_end' — Trigger configuration type
            - `job_id` union — Upstream doc automation job (same team) whose successful completion triggers this job
              - …
          - AutomationOnSyncEndEventTriggerConfig
            - `type` 'on_sync_end' — Trigger configuration type
            - `src_integration_id` union — Source integration ID
              - …
          - AutomationOnWebhookEventTriggerConfig
            - `type` 'webhook' — Trigger configuration type
      - AutomationScheduledTriggerDetailsSchema
        - `type` 'schedule' — Trigger type
        - `config` AutomationCronScheduledTriggerConfig, required
          - `type` 'cron' — Schedule type
          - `cron` string — Cron expression for schedule
      - AutomationNoneTriggerDetailsSchema
        - `type` 'none' — Trigger type
    - `destination` union — Destination details
      - AutomationNoneDestinationSchema
        - `skipIfEmpty` boolean — Skip writing to destination if results are empty
        - `type` 'none' — Destination type
      - AutomationSlackDestinationSchema
        - `integrationId` union — Integration ID
          - string, uuid
          - string
        - `format` 'json' | 'parquet' | 'txt' | 'csv' | 'png' | 'pdf' | 'auto' — Export format
        - `skipIfEmpty` boolean — Skip writing to destination if results are empty
        - `type` 'slack' — Destination type
        - `channelId` string, nullable — Channel ID
      - AutomationEmailDestinationSchema
        - `format` 'json' | 'parquet' | 'txt' | 'csv' | 'png' | 'pdf' | 'auto' — Export format
        - `skipIfEmpty` boolean — Skip writing to destination if results are empty
        - `type` 'email' — Destination type
        - `address` string, nullable — Email address
      - AutomationSheetsDestinationSchema
        - `integrationId` union — Integration ID
          - string, uuid
          - string
        - `skipIfEmpty` boolean — Skip writing to destination if results are empty
        - `type` 'sheets' — Destination type
        - `spreadsheetId` string, nullable — Spreadsheet ID
        - `sheet` string, nullable — Sheet name
        - `header` boolean — Include header row
        - `range` string, nullable — Sheet range
        - `overwriteSheet` boolean, nullable — Overwrite sheet
        - `overwriteRange` boolean, nullable — Overwrite range
      - AutomationExcelDestinationSchema
        - `integrationId` union — Integration ID
          - string, uuid
          - string
        - `skipIfEmpty` boolean — Skip writing to destination if results are empty
        - `type` 'excel' — Destination type
        - `workbookId` string, nullable — Workbook ID
        - `worksheet` string, nullable — Worksheet name
        - `header` boolean — Include header row
        - `range` string, nullable — Sheet range
        - `overwriteSheet` boolean, nullable — Overwrite sheet
        - `overwriteRange` boolean, nullable — Overwrite range
      - AutomationGcsDestinationSchema
        - `format` 'json' | 'parquet' | 'txt' | 'csv' | 'png' | 'pdf' | 'auto' — Export format
        - `integrationId` union — Integration ID
          - string, uuid
          - string
        - `skipIfEmpty` boolean — Skip writing to destination if results are empty
        - `type` 'gcs' — Destination type
        - `bucket` string, nullable — Bucket name
        - `blobName` string, nullable — Blob name
      - AutomationWebhookDestinationSchema
        - `skipIfEmpty` boolean — Skip writing to destination if results are empty
        - `type` 'webhook' — Destination type
        - `url` string, required — URL where the data (JSON encoded) will be sent as a POST request
      - AutomationFiThreadDestinationSchema
        - `skipIfEmpty` boolean — Skip writing to destination if results are empty
        - `type` 'fi_thread' — Destination type
        - `thread_id` string, nullable — Thread UUID (required)
        - `row_cap` integer — Maximum rows to include in XML (default 100)
        - `slack_integration_id` string, nullable — Slack integration ID for optional follow-up message
        - `slack_channel_id` string, nullable — Slack channel ID for optional follow-up message
        - `slack_template` object, nullable — Slack message template (blocks + fallback text)
    - `enabled` boolean — Job enabled flag
    - `disabled_by` 'user' | 'definite-admin', nullable — Who disabled this job. Null iff enabled=true.
    - `max_attempts` integer — Max attempts for job
    - `details` object — Resource-type-specific job configuration. Must be empty for doc jobs. For ducklake_integration_maintenance: a DuckLakeMaintenanceRequest payload plus optional `created_by` (UUID) for acting-user fallback.
    - `created_at` string, date-time — Job created at timestamp
  - `meta` ResponseMeta
    - `requestId` string — Unique request identifier for tracing
    - `timestamp` string, date-time — Response timestamp (UTC)
    - `durationMs` integer, nullable — Request processing time in milliseconds

## Other responses

- `401` — Auth Invalid Token
- `403` — Forbidden Insufficient Permissions
- `404` — Resource Not Found
- `422` — Validation Failed
- `426` — Business Quota Exceeded
- `500` — Internal Error

---

[API](https://skmtc.dev/definite/apis/defapi.md) · [All operations](https://skmtc.dev/definite/apis/defapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/definite/defapi/revisions/5ea378187147/schema)
