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

# Update a trigger

> Partially update a trigger; all fields are optional. When `activation` is changed, the type-specific field rules are re-validated. Returns 404 if the trigger does not exist.



## OpenAPI

````yaml /api-reference/workflows.yaml patch /triggers/{triggerId}
openapi: 3.1.0
info:
  title: Workflows
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /triggers/{triggerId}:
    patch:
      tags:
        - Triggers
      summary: Update a trigger
      description: >-
        Partially update a trigger; all fields are optional. When `activation`
        is changed, the type-specific field rules are re-validated. Returns 404
        if the trigger does not exist.
      operationId: updateTrigger
      parameters:
        - in: path
          name: triggerId
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTriggerBody'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/Trigger'
                      - properties:
                          activation:
                            enum:
                              - event
                              - schedule
                              - custom
                            type: string
                          conditions: {}
                          createdAt:
                            type:
                              - string
                              - 'null'
                          createdBy:
                            format: uuid
                            type:
                              - string
                              - 'null'
                          customPayloadSchema:
                            additionalProperties: {}
                            type:
                              - object
                              - 'null'
                          description:
                            type:
                              - string
                              - 'null'
                          eventType:
                            type:
                              - string
                              - 'null'
                          id:
                            format: uuid
                            type: string
                          name:
                            type: string
                          nextFireTime:
                            type:
                              - string
                              - 'null'
                          ownerId:
                            format: uuid
                            type: string
                          scheduleRule:
                            allOf:
                              - $ref: '#/components/schemas/ScheduleRule'
                              - type:
                                  - object
                                  - 'null'
                          timezone:
                            type:
                              - string
                              - 'null'
                          updatedAt:
                            type:
                              - string
                              - 'null'
                          userId:
                            deprecated: true
                            description: >-
                              Deprecated: use ownerId (tenancy) / createdBy
                              (actor).
                            format: uuid
                            type: string
                required:
                  - data
                type: object
          description: Trigger updated
        '404':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: Not Found
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const trigger = await
            client.workflows.triggers.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(trigger.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            trigger = client.workflows.triggers.update(
                trigger_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(trigger.data)
components:
  schemas:
    UpdateTriggerBody:
      properties:
        activation:
          enum:
            - event
            - schedule
            - custom
          type: string
        conditions:
          properties:
            all:
              items:
                type: object
              type: array
            any:
              items:
                type: object
              type: array
          type:
            - object
            - 'null'
        customPayloadSchema:
          additionalProperties: true
          description: >-
            Optional JSON Schema for validating payloads sent to this custom
            trigger
          type:
            - object
            - 'null'
        description:
          maxLength: 2048
          type: string
        eventType:
          maxLength: 256
          type: string
        name:
          maxLength: 256
          minLength: 1
          type: string
        scheduleRule:
          properties:
            dateTime:
              description: ISO 8601 datetime (for type=once)
              type: string
            expression:
              description: Cron expression (for type=cron)
              type: string
            jitter:
              description: >-
                Optional per-occurrence random window around the nominal
                schedule time
              properties:
                afterMinutes:
                  default: 0
                  maximum: 1440
                  minimum: 0
                  type: integer
                beforeMinutes:
                  default: 0
                  maximum: 1440
                  minimum: 0
                  type: integer
              type: object
            rrule:
              description: RRULE string (for type=recurring)
              type: string
            type:
              enum:
                - once
                - cron
                - recurring
              type: string
          required:
            - type
          type:
            - object
            - 'null'
        timezone:
          type:
            - string
            - 'null'
      type: object
    Trigger:
      properties:
        activation:
          enum:
            - event
            - schedule
            - custom
          type: string
        conditions: {}
        createdAt:
          type:
            - string
            - 'null'
        createdBy:
          format: uuid
          type:
            - string
            - 'null'
        customPayloadSchema:
          additionalProperties: {}
          type:
            - object
            - 'null'
        description:
          type:
            - string
            - 'null'
        eventType:
          type:
            - string
            - 'null'
        id:
          format: uuid
          type: string
        name:
          type: string
        nextFireTime:
          type:
            - string
            - 'null'
        ownerId:
          format: uuid
          type: string
        scheduleRule:
          $ref: '#/components/schemas/ScheduleRule'
        timezone:
          type:
            - string
            - 'null'
        updatedAt:
          type:
            - string
            - 'null'
        userId:
          deprecated: true
          description: 'Deprecated: use ownerId (tenancy) / createdBy (actor).'
          format: uuid
          type: string
      required:
        - id
        - userId
        - ownerId
        - createdBy
        - name
        - description
        - activation
        - scheduleRule
        - timezone
        - eventType
        - customPayloadSchema
        - createdAt
        - updatedAt
      type: object
    ScheduleRule:
      properties:
        dateTime:
          description: ISO 8601 datetime (for type=once)
          type: string
        expression:
          description: Cron expression (for type=cron)
          type: string
        jitter:
          description: >-
            Optional per-occurrence random window around the nominal schedule
            time
          properties:
            afterMinutes:
              default: 0
              maximum: 1440
              minimum: 0
              type: integer
            beforeMinutes:
              default: 0
              maximum: 1440
              minimum: 0
              type: integer
          type: object
        rrule:
          description: RRULE string (for type=recurring)
          type: string
        type:
          enum:
            - once
            - cron
            - recurring
          type: string
      required:
        - type
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````

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