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

# Update Trigger

> Rename a trigger, replace its config, or take it online or offline.



## OpenAPI

````yaml https://platform.tracecat.com/api/openapi.json patch /workspaces/{workspace_id}/triggers/{trigger_id}
openapi: 3.1.0
info:
  title: Tracecat API
  summary: Tracecat API
  description: The open source AI automation platform for security teams and agents.
  termsOfService: >-
    https://docs.google.com/document/d/e/2PACX-1vQvDe3SoVAPoQc51MgfGCP71IqFYX_rMVEde8zC4qmBCec5f8PLKQRdxa6tsUABT8gWAR9J-EVs2CrQ/pub
  contact:
    name: Tracecat Founders
    email: founders@tracecat.com
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  version: '1'
servers:
  - url: /api
security: []
tags:
  - name: public
    description: Public facing endpoints
  - name: workflows
    description: Workflow management
  - name: actions
    description: Action management
  - name: triggers
    description: Workflow triggers
  - name: secrets
    description: Secret management
  - name: variables
    description: Workspace variable management
paths:
  /workspaces/{workspace_id}/triggers/{trigger_id}:
    patch:
      tags:
        - triggers
      summary: Update Trigger
      description: Rename a trigger, replace its config, or take it online or offline.
      operationId: triggers-update_trigger
      parameters:
        - name: trigger_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Trigger Id
        - name: workspace_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Workspace Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TriggerUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerRead'
        '400':
          description: See detail.code
        '404':
          description: See detail.code
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyCookie: []
        - ServiceAccountApiKeyBearer: []
components:
  schemas:
    TriggerUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
        config:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/ObjectStorageTriggerConfig'
                - $ref: '#/components/schemas/ScheduleTriggerConfig'
                - $ref: '#/components/schemas/WebhookTriggerConfig'
                - $ref: '#/components/schemas/CaseEventTriggerConfig'
                - $ref: '#/components/schemas/TableTriggerConfig'
              discriminator:
                propertyName: kind
                mapping:
                  case_trigger: '#/components/schemas/CaseEventTriggerConfig'
                  object_storage: '#/components/schemas/ObjectStorageTriggerConfig'
                  schedule: '#/components/schemas/ScheduleTriggerConfig'
                  table: '#/components/schemas/TableTriggerConfig'
                  webhook: '#/components/schemas/WebhookTriggerConfig'
            - type: 'null'
          title: Config
          description: >-
            Replaces the whole config. Its kind must be the trigger's kind,
            which never changes after create.
        status:
          anyOf:
            - $ref: '#/components/schemas/TriggerStatus'
            - type: 'null'
      type: object
      title: TriggerUpdate
    TriggerRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        kind:
          $ref: '#/components/schemas/TriggerKind'
        name:
          type: string
          title: Name
        status:
          $ref: '#/components/schemas/TriggerStatus'
        config:
          oneOf:
            - $ref: '#/components/schemas/ObjectStorageTriggerConfigRead'
            - $ref: '#/components/schemas/ScheduleTriggerConfigRead'
            - $ref: '#/components/schemas/WebhookTriggerConfigRead'
            - $ref: '#/components/schemas/CaseEventTriggerConfigRead'
            - $ref: '#/components/schemas/TableTriggerConfigRead'
          title: Config
          discriminator:
            propertyName: kind
            mapping:
              case_trigger: '#/components/schemas/CaseEventTriggerConfigRead'
              object_storage: '#/components/schemas/ObjectStorageTriggerConfigRead'
              schedule: '#/components/schemas/ScheduleTriggerConfigRead'
              table: '#/components/schemas/TableTriggerConfigRead'
              webhook: '#/components/schemas/WebhookTriggerConfigRead'
        bindings:
          items:
            $ref: '#/components/schemas/TriggerBindingRead'
          type: array
          title: Bindings
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - kind
        - name
        - status
        - config
        - bindings
        - created_at
        - updated_at
      title: TriggerRead
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ObjectStorageTriggerConfig:
      properties:
        kind:
          type: string
          const: object_storage
          title: Kind
        source_id:
          type: string
          format: uuid
          title: Source Id
          description: The event source to read object events from
        key_prefix:
          type: string
          maxLength: 1024
          title: Key Prefix
          description: Only keys starting with this fire. Empty matches every key.
          default: ''
      type: object
      required:
        - kind
        - source_id
      title: ObjectStorageTriggerConfig
      description: Fire once for each object created in a source whose key matches.
    ScheduleTriggerConfig:
      properties:
        cron:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron
          description: A cron expression. Set this or `every`.
        every:
          anyOf:
            - type: string
              format: duration
            - type: 'null'
          title: Every
          description: ISO 8601 interval. Set this or `cron`.
        offset:
          anyOf:
            - type: string
              format: duration
            - type: 'null'
          title: Offset
          description: ISO 8601 delay before the first interval run. Interval only.
        start_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Start At
          description: ISO 8601 datetime before which it does not run
        end_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End At
          description: ISO 8601 datetime after which it stops
        timeout:
          type: number
          minimum: 0
          title: Timeout
          description: Most seconds each run may take. 0 means no timeout.
          default: 0
        inputs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Inputs
          description: The workflow's trigger inputs for each run
        kind:
          type: string
          const: schedule
          title: Kind
        workflow_id:
          anyOf:
            - type: string
              pattern: wf_[0-9a-zA-Z]+
            - type: string
              pattern: wf-[0-9a-f]{32}
          title: Workflow Id
          description: The workflow the schedule runs. Fixed after create.
      type: object
      required:
        - kind
        - workflow_id
      title: ScheduleTriggerConfig
      description: |-
        Run a workflow on a cron expression or a fixed interval.

        The settings of the workflow's schedule (``/schedules``), which the
        trigger shows and edits. Until schedules start their targets through
        bindings, the trigger's one target is this workflow and cannot change.
    WebhookTriggerConfig:
      properties:
        kind:
          type: string
          const: webhook
          title: Kind
        workflow_id:
          anyOf:
            - type: string
              pattern: wf_[0-9a-zA-Z]+
            - type: string
              pattern: wf-[0-9a-f]{32}
          title: Workflow Id
          description: The workflow whose webhook this is. Fixed after create.
        methods:
          items:
            $ref: '#/components/schemas/WebhookMethod'
          type: array
          minItems: 1
          title: Methods
          description: HTTP methods the webhook accepts
        allowlisted_cidrs:
          items:
            type: string
          type: array
          title: Allowlisted Cidrs
          description: >-
            IPv4 addresses or CIDR ranges allowed to call the webhook. Empty
            allows every address.
        include_headers:
          type: boolean
          title: Include Headers
          description: Pass request headers and metadata to the workflow, not only the body
          default: false
        awaitable:
          type: boolean
          title: Awaitable
          description: >-
            Wait mode. On: the webhook starts its own workflow only, and its
            /wait and /draft URLs work. Off: it starts every online target, and
            /wait and /draft answer 409. Turning it off needs the
            trigger_targets plan feature; turning it on needs the webhook's own
            workflow to be its only target.
          default: true
      type: object
      required:
        - kind
        - workflow_id
      title: WebhookTriggerConfig
      description: >-
        Run a workflow for each request to its webhook URL.


        The settings of the workflow's webhook (``/workflows/{id}/webhook``),

        which the trigger shows and edits. Every workflow has one webhook; it

        becomes a trigger when it is turned on. Until webhooks start their
        targets

        through bindings, the trigger's one target is this workflow and cannot

        change. The API key is managed on the workflow's webhook only. Settings

        left out of a create or update keep the webhook's saved values.
    CaseEventTriggerConfig:
      properties:
        kind:
          type: string
          const: case_trigger
          title: Kind
        workflow_id:
          anyOf:
            - type: string
              pattern: wf_[0-9a-zA-Z]+
            - type: string
              pattern: wf-[0-9a-f]{32}
            - type: 'null'
          title: Workflow Id
          description: >-
            The workflow whose case trigger this is, or null for a case trigger
            with no workflow of its own. Fixed after create.
        event_types:
          items:
            $ref: '#/components/schemas/CaseEventType'
          type: array
          title: Event Types
          description: >-
            Case event types that start the targets. Must not be empty while the
            trigger is online.
        tag_filters:
          items:
            type: string
          type: array
          title: Tag Filters
          description: >-
            Case tag refs. When set, only events on cases with one of these tags
            start the targets. Empty matches every case.
      type: object
      required:
        - kind
      title: CaseEventTriggerConfig
      description: |-
        Start the trigger's targets for each case event of the chosen types.

        With ``workflow_id``, the settings of that workflow's case trigger
        (``/workflows/{id}/case-trigger``), which the trigger shows and edits.
        Every workflow has one case trigger; it becomes a trigger when it is
        turned on, or when it is created as one here (it may stay offline).
        Deleting the trigger turns the case trigger off and keeps it. The
        workflow is always one of its targets.

        Without ``workflow_id``, a case trigger of its own that starts only the
        targets bound to it; creating one needs the ``trigger_targets`` plan
        feature. Deleting the trigger deletes it.

        Settings left out of a create or update keep the case trigger's saved
        values. Needs the ``case_addons`` plan feature.
    TableTriggerConfig:
      properties:
        kind:
          type: string
          const: table
          title: Kind
        table_id:
          type: string
          format: uuid
          title: Table Id
          description: The table whose rows fire it
        operations:
          items:
            $ref: '#/components/schemas/TableTriggerOperation'
          type: array
          minItems: 1
          title: Operations
          description: 'The row changes it fires on: `insert`, `update` or both'
        filter:
          anyOf:
            - $ref: '#/components/schemas/Filter-Input'
            - type: 'null'
          description: >-
            Only rows matching this filter fire, checked against the row as
            written. Uses the filter language of table queries, over the table's
            column names and `created_at` or `updated_at`. Null matches every
            row.
      type: object
      required:
        - kind
        - table_id
        - operations
      title: TableTriggerConfig
      description: |-
        Fire once for each inserted or updated row of a table that matches.

        Needs the ``table_triggers`` plan feature, and ``table:read``. The table
        is fixed after create.
    TriggerStatus:
      type: string
      enum:
        - online
        - offline
      title: TriggerStatus
      description: Whether a source, trigger or binding takes part in dispatch.
    TriggerKind:
      type: string
      enum:
        - object_storage
        - schedule
        - webhook
        - case_trigger
        - table
      title: TriggerKind
      description: What a trigger listens to. Each kind has its own source and config.
    ObjectStorageTriggerConfigRead:
      properties:
        kind:
          type: string
          const: object_storage
          title: Kind
        source_id:
          type: string
          format: uuid
          title: Source Id
          description: The event source to read object events from
        key_prefix:
          type: string
          maxLength: 1024
          title: Key Prefix
          description: Only keys starting with this fire. Empty matches every key.
          default: ''
        source_name:
          type: string
          title: Source Name
          description: The event source's display name
      type: object
      required:
        - kind
        - source_id
        - source_name
      title: ObjectStorageTriggerConfigRead
    ScheduleTriggerConfigRead:
      properties:
        cron:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron
          description: A cron expression. Set this or `every`.
        every:
          anyOf:
            - type: string
              format: duration
            - type: 'null'
          title: Every
          description: ISO 8601 interval. Set this or `cron`.
        offset:
          anyOf:
            - type: string
              format: duration
            - type: 'null'
          title: Offset
          description: ISO 8601 delay before the first interval run. Interval only.
        start_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Start At
          description: ISO 8601 datetime before which it does not run
        end_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End At
          description: ISO 8601 datetime after which it stops
        timeout:
          type: number
          minimum: 0
          title: Timeout
          description: Most seconds each run may take. 0 means no timeout.
          default: 0
        inputs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Inputs
          description: The workflow's trigger inputs for each run
        kind:
          type: string
          const: schedule
          title: Kind
        workflow_id:
          type: string
          title: Workflow Id
          description: The workflow the schedule runs
        schedule_id:
          type: string
          title: Schedule Id
          description: The schedule's ID in `/schedules`, which does not change
      type: object
      required:
        - kind
        - workflow_id
        - schedule_id
      title: ScheduleTriggerConfigRead
    WebhookTriggerConfigRead:
      properties:
        kind:
          type: string
          const: webhook
          title: Kind
        workflow_id:
          type: string
          title: Workflow Id
          description: The workflow the webhook runs
        webhook_id:
          type: string
          format: uuid
          title: Webhook Id
          description: The webhook's ID, which does not change
        methods:
          items:
            type: string
          type: array
          title: Methods
          description: HTTP methods the webhook accepts
        allowlisted_cidrs:
          items:
            type: string
          type: array
          title: Allowlisted Cidrs
          description: Addresses allowed to call the webhook. Empty allows all.
        include_headers:
          type: boolean
          title: Include Headers
        awaitable:
          type: boolean
          title: Awaitable
          description: >-
            Wait mode: on, the webhook starts its own workflow only and /wait
            works; off, it starts every online target
        url:
          type: string
          title: Url
          description: The webhook URL. It contains the webhook's secret.
        api_key:
          anyOf:
            - $ref: '#/components/schemas/WebhookApiKeyRead'
            - type: 'null'
          description: The webhook's API key, if it has one (preview only)
      type: object
      required:
        - kind
        - workflow_id
        - webhook_id
        - methods
        - allowlisted_cidrs
        - include_headers
        - awaitable
        - url
        - api_key
      title: WebhookTriggerConfigRead
      description: >-
        The webhook as ``/workflows/{id}/webhook`` shows it.


        Readable only with ``workflow:read``, the scope that shows the same URL
        on

        the workflow page.
    CaseEventTriggerConfigRead:
      properties:
        kind:
          type: string
          const: case_trigger
          title: Kind
        workflow_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Id
          description: >-
            The workflow whose case trigger this is, or null for a case trigger
            with no workflow of its own
        case_trigger_id:
          type: string
          format: uuid
          title: Case Trigger Id
          description: The case trigger's ID, which does not change
        event_types:
          items:
            $ref: '#/components/schemas/CaseEventType'
          type: array
          title: Event Types
          description: Case event types that start the targets
        tag_filters:
          items:
            type: string
          type: array
          title: Tag Filters
          description: Case tag refs that limit which cases match. Empty matches all.
      type: object
      required:
        - kind
        - workflow_id
        - case_trigger_id
        - event_types
        - tag_filters
      title: CaseEventTriggerConfigRead
      description: |-
        The case trigger as ``/workflows/{id}/case-trigger`` shows it.

        Readable only with ``workflow:read`` and the ``case_addons`` plan
        feature, as on the workflow page.
    TableTriggerConfigRead:
      properties:
        kind:
          type: string
          const: table
          title: Kind
        table_id:
          type: string
          format: uuid
          title: Table Id
          description: The table whose rows fire it
        operations:
          items:
            $ref: '#/components/schemas/TableTriggerOperation'
          type: array
          minItems: 1
          title: Operations
          description: 'The row changes it fires on: `insert`, `update` or both'
        filter:
          anyOf:
            - $ref: '#/components/schemas/Filter-Output'
            - type: 'null'
          description: >-
            Only rows matching this filter fire, checked against the row as
            written. Uses the filter language of table queries, over the table's
            column names and `created_at` or `updated_at`. Null matches every
            row.
        table_name:
          type: string
          title: Table Name
          description: The table's name
        filter_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Filter Error
          description: >-
            Set when the filter no longer fits the table, for example after a
            column it uses was deleted. The trigger then matches no rows until
            its filter is replaced. A deleted column shows as its ID.
      type: object
      required:
        - kind
        - table_id
        - operations
        - table_name
      title: TableTriggerConfigRead
    TriggerBindingRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        trigger_id:
          type: string
          format: uuid
          title: Trigger Id
        target_type:
          $ref: '#/components/schemas/TriggerTargetType'
        target_id:
          type: string
          format: uuid
          title: Target Id
          description: The workflow or agent preset ID
        target_name:
          type: string
          title: Target Name
          description: The workflow title or agent preset name
        instruction:
          anyOf:
            - type: string
            - type: 'null'
          title: Instruction
        status:
          $ref: '#/components/schemas/TriggerStatus'
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - trigger_id
        - target_type
        - target_id
        - target_name
        - instruction
        - status
        - created_at
        - updated_at
      title: TriggerBindingRead
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    WebhookMethod:
      type: string
      enum:
        - GET
        - POST
    CaseEventType:
      type: string
      enum:
        - case_created
        - case_updated
        - case_closed
        - case_reopened
        - case_viewed
        - priority_changed
        - severity_changed
        - verdict_changed
        - status_changed
        - fields_changed
        - assignee_changed
        - attachment_created
        - attachment_deleted
        - tag_added
        - tag_removed
        - payload_changed
        - task_created
        - task_deleted
        - task_status_changed
        - task_priority_changed
        - task_workflow_changed
        - task_assignee_changed
        - dropdown_value_changed
        - table_row_linked
        - table_row_unlinked
        - comment_created
        - comment_updated
        - comment_deleted
        - comment_reply_created
        - comment_reply_updated
        - comment_reply_deleted
        - parent_changed
        - sub_cases_added
        - sub_cases_removed
      title: CaseEventType
      description: Case activity type values.
    TableTriggerOperation:
      type: string
      enum:
        - insert
        - update
      title: TableTriggerOperation
      description: A row change a ``table`` trigger fires on.
    Filter-Input:
      oneOf:
        - $ref: '#/components/schemas/Condition-Input'
        - $ref: '#/components/schemas/AndClause-Input'
        - $ref: '#/components/schemas/OrClause-Input'
        - $ref: '#/components/schemas/NotClause-Input'
    WebhookApiKeyRead:
      properties:
        preview:
          type: string
          title: Preview
        created_at:
          type: string
          format: date-time
          title: Created At
        last_used_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Used At
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
        is_active:
          type: boolean
          title: Is Active
          default: false
      type: object
      required:
        - preview
        - created_at
      title: WebhookApiKeyRead
    Filter-Output:
      oneOf:
        - $ref: '#/components/schemas/Condition-Output'
        - $ref: '#/components/schemas/AndClause-Output'
        - $ref: '#/components/schemas/OrClause-Output'
        - $ref: '#/components/schemas/NotClause-Output'
    TriggerTargetType:
      type: string
      enum:
        - workflow
        - agent
      title: TriggerTargetType
      description: What a trigger binding starts.
    Condition-Input:
      properties:
        field:
          type: string
          minLength: 1
          title: Field
        op:
          $ref: '#/components/schemas/FilterOp'
        value:
          anyOf:
            - $ref: '#/components/schemas/FilterValue'
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - field
        - op
      title: Condition
      description: A predicate over one resolver-defined field.
    AndClause-Input:
      properties:
        and:
          items:
            $ref: '#/components/schemas/Filter-Input'
          type: array
          minItems: 1
          title: And
      additionalProperties: false
      type: object
      required:
        - and
      title: AndClause
      description: A conjunction of one or more filters.
    OrClause-Input:
      properties:
        or:
          items:
            $ref: '#/components/schemas/Filter-Input'
          type: array
          minItems: 1
          title: Or
      additionalProperties: false
      type: object
      required:
        - or
      title: OrClause
      description: A disjunction of one or more filters.
    NotClause-Input:
      properties:
        not:
          $ref: '#/components/schemas/Filter-Input'
      additionalProperties: false
      type: object
      required:
        - not
      title: NotClause
      description: The negation of one filter.
    Condition-Output:
      properties:
        field:
          type: string
          minLength: 1
          title: Field
        op:
          $ref: '#/components/schemas/FilterOp'
        value:
          anyOf:
            - $ref: '#/components/schemas/FilterValue'
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - field
        - op
      title: Condition
      description: A predicate over one resolver-defined field.
    AndClause-Output:
      properties:
        and:
          items:
            $ref: '#/components/schemas/Filter-Output'
          type: array
          minItems: 1
          title: And
      additionalProperties: false
      type: object
      required:
        - and
      title: AndClause
      description: A conjunction of one or more filters.
    OrClause-Output:
      properties:
        or:
          items:
            $ref: '#/components/schemas/Filter-Output'
          type: array
          minItems: 1
          title: Or
      additionalProperties: false
      type: object
      required:
        - or
      title: OrClause
      description: A disjunction of one or more filters.
    NotClause-Output:
      properties:
        not:
          $ref: '#/components/schemas/Filter-Output'
      additionalProperties: false
      type: object
      required:
        - not
      title: NotClause
      description: The negation of one filter.
    FilterOp:
      type: string
      enum:
        - eq
        - ne
        - in
        - not_in
        - gt
        - gte
        - lt
        - lte
        - contains
        - starts_with
        - is_null
      title: FilterOp
      description: Operations supported by the shared filter language.
    FilterValue:
      anyOf:
        - $ref: '#/components/schemas/FilterScalar'
        - items:
            $ref: '#/components/schemas/FilterScalar'
          type: array
    FilterScalar:
      anyOf:
        - type: string
        - type: integer
        - type: number
        - type: boolean
        - type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
        - type: string
          format: date-time
        - type: string
          format: date
        - type: string
          format: uuid
  securitySchemes:
    APIKeyCookie:
      type: apiKey
      in: cookie
      name: fastapiusersauth
    ServiceAccountApiKeyBearer:
      type: http
      description: Tracecat service account API key.
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.