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

# Update trigger

> Changes a schedule or settings, or turns a trigger on or off.



## OpenAPI

````yaml /api-reference/openapi.json patch /api/projects/{id}/triggers/{triggerId}
openapi: 3.0.0
info:
  title: Open Attack Surface Management
  description: Open-source platform for cybersecurity Attack Surface Management (ASM)
  version: '1.0'
  contact: {}
servers:
  - url: https://{baseUrl}/api/v1
    variables:
      baseUrl:
        default: localhost:3000
        description: API server hostname with port (e.g. localhost:3000, api.example.com)
security: []
tags: []
externalDocs:
  description: Authentication Docs
  url: auth/docs
paths:
  /api/projects/{id}/triggers/{triggerId}:
    patch:
      tags:
        - Projects
      summary: Update trigger
      description: Changes a schedule or settings, or turns a trigger on or off.
      operationId: ProjectsController_updateTrigger
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-Workspace-Id
          in: header
          description: Workspace ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProjectTriggerDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectWorkflowTrigger'
                allOf:
                  - $ref: '#/components/schemas/AppResponseSerialization'
components:
  schemas:
    UpdateProjectTriggerDto:
      type: object
      properties:
        cron:
          type: string
          example: 0 2 * * 1
        config:
          $ref: '#/components/schemas/AssetsAddedTriggerConfigDto'
        enabled:
          type: boolean
    ProjectWorkflowTrigger:
      type: object
      properties:
        id:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        projectWorkflowId:
          type: string
        type:
          allOf:
            - $ref: '#/components/schemas/ProjectTriggerType'
        cron:
          type: string
          nullable: true
        config:
          $ref: '#/components/schemas/AssetsAddedTriggerConfig'
        enabled:
          type: boolean
        lastFiredAt:
          type: string
          format: date-time
          nullable: true
      required:
        - id
        - createdAt
        - updatedAt
        - projectWorkflowId
        - type
        - config
        - enabled
    AppResponseSerialization:
      type: object
      properties: {}
    AssetsAddedTriggerConfigDto:
      type: object
      properties:
        windowMinutes:
          type: number
          default: 10
          description: Minutes to gather new assets into one run
        maxAssets:
          type: number
          default: 200
          description: Most assets one run takes; more start further runs
        targetTypes:
          type: array
          description: Only assets of these target types; empty = all
          items:
            $ref: '#/components/schemas/TargetType'
    ProjectTriggerType:
      type: string
      enum:
        - cron
        - assets_added
    AssetsAddedTriggerConfig:
      type: object
      properties:
        windowMinutes:
          type: number
          minimum: 0
          maximum: 1440
        maxAssets:
          type: number
          minimum: 1
          maximum: 5000
        targetTypes:
          type: array
          items:
            type: string
    TargetType:
      type: string
      enum:
        - DOMAIN
        - CIDR
        - IP
        - GIT_ORG
      description: The type of target (DOMAIN, CIDR, or IP)

````

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