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

# Update Trigger

> Update an existing trigger.

Updates the specified trigger with the provided data. Only non-null fields
in the request will be updated. If channel_credentials are provided,
they replace the existing credentials in the secret store.

Args:
    trigger_id: The unique identifier of the trigger.
    payload: Trigger update DTO (single source of truth shared with MCP toolset).
    user_context: Authentication context.
    trigger_service: Injected trigger service.
    secret_manager: Injected secret manager for credential storage.

Returns:
    The updated trigger.

Raises:
    HTTPException: If trigger not found or validation fails.



## OpenAPI

````yaml /api-reference/openapi.json put /v1/triggers/{trigger_id}
openapi: 3.1.0
info:
  description: >-
    Modular and extensible framework for building AI agents. This API requires
    JWT Bearer token authentication for most endpoints. Include your JWT token
    in the Authorization header. Public endpoints include /, /health, /docs,
    /redoc, and /openapi.json.
  title: AgentArea API
  version: 0.1.0
servers: []
security:
  - bearer: []
paths:
  /v1/triggers/{trigger_id}:
    put:
      tags:
        - v1
        - protected
        - triggers
      summary: Update Trigger
      description: >-
        Update an existing trigger.


        Updates the specified trigger with the provided data. Only non-null
        fields

        in the request will be updated. If channel_credentials are provided,

        they replace the existing credentials in the secret store.


        Args:
            trigger_id: The unique identifier of the trigger.
            payload: Trigger update DTO (single source of truth shared with MCP toolset).
            user_context: Authentication context.
            trigger_service: Injected trigger service.
            secret_manager: Injected secret manager for credential storage.

        Returns:
            The updated trigger.

        Raises:
            HTTPException: If trigger not found or validation fails.
      operationId: update_trigger_v1_triggers__trigger_id__put
      parameters:
        - in: path
          name: trigger_id
          required: true
          schema:
            format: uuid
            title: Trigger Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TriggerUpdate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    TriggerUpdate:
      additionalProperties: false
      description: Patch payload for a trigger. All fields optional — unset = unchanged.
      properties:
        allowed_methods:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Methods
        channel_credentials:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: Channel credentials to update. Pass to rotate credentials.
          title: Channel Credentials
        conditions:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Conditions
        cron_expression:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Expression
        description:
          anyOf:
            - maxLength: 1000
              type: string
            - type: 'null'
          title: Description
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            Toggle the trigger active state. Maps to ``is_active`` server-side.
            REST clients may pass either ``enabled`` (canonical) or
            ``is_active`` (alias).
          title: Enabled
        failure_threshold:
          anyOf:
            - maximum: 100
              minimum: 1
              type: integer
            - type: 'null'
          title: Failure Threshold
        name:
          anyOf:
            - maxLength: 255
              minLength: 1
              type: string
            - type: 'null'
          title: Name
        task_parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task Parameters
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone
        validation_rules:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Validation Rules
        webhook_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Webhook Config
        webhook_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Type
      title: TriggerUpdate
      type: object
    TriggerResponse:
      description: Response model for trigger data.
      properties:
        agent_id:
          format: uuid
          title: Agent Id
          type: string
        allowed_methods:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Methods
        conditions:
          additionalProperties: true
          title: Conditions
          type: object
        consecutive_failures:
          title: Consecutive Failures
          type: integer
        created_at:
          title: Created At
          type: string
        created_by:
          title: Created By
          type: string
        cron_expression:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Expression
        data_extractor:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Extractor
        description:
          title: Description
          type: string
        event_types:
          items:
            type: string
          title: Event Types
          type: array
        failure_threshold:
          title: Failure Threshold
          type: integer
        has_channel_credentials:
          default: false
          title: Has Channel Credentials
          type: boolean
        id:
          format: uuid
          title: Id
          type: string
        is_active:
          title: Is Active
          type: boolean
        last_execution_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Execution At
        name:
          title: Name
          type: string
        next_run_time:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Run Time
        task_parameters:
          additionalProperties: true
          title: Task Parameters
          type: object
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone
        trigger_type:
          title: Trigger Type
          type: string
        updated_at:
          title: Updated At
          type: string
        validation_rules:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Validation Rules
        webhook_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Webhook Config
        webhook_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Id
        webhook_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Type
      required:
        - id
        - name
        - description
        - agent_id
        - trigger_type
        - is_active
        - task_parameters
        - conditions
        - created_at
        - updated_at
        - created_by
        - failure_threshold
        - consecutive_failures
      title: TriggerResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearer:
      bearerFormat: JWT
      description: JWT Bearer token for authentication
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````