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

# Update an agent trigger

> Only the fields you send change. Any trigger can be renamed, reworded, paused and resumed (`name`, `prompt`, `enabled`, `max_failures`). Schedule fields apply to `schedule` triggers and `pass_raw_data` to `webhook` triggers; sending them on another type answers `400 trigger_type_not_editable`. A schedule keeps its kind: send `cron_expression` on a recurring trigger and `run_at` on a one-time one.

Team API keys are not accepted.




## OpenAPI

````yaml patch /agents/{agent_id}/triggers/{trigger_id}
openapi: 3.0.0
info:
  title: Public API
  version: 1.0.0
servers:
  - url: https://api.gumloop.com/api/v1
security: []
paths:
  /agents/{agent_id}/triggers/{trigger_id}:
    patch:
      tags:
        - Agents
      summary: Update an agent trigger
      description: >
        Only the fields you send change. Any trigger can be renamed, reworded,
        paused and resumed (`name`, `prompt`, `enabled`, `max_failures`).
        Schedule fields apply to `schedule` triggers and `pass_raw_data` to
        `webhook` triggers; sending them on another type answers `400
        trigger_type_not_editable`. A schedule keeps its kind: send
        `cron_expression` on a recurring trigger and `run_at` on a one-time one.


        Team API keys are not accepted.
      operationId: updateAgentTrigger
      parameters:
        - in: path
          name: agent_id
          required: true
          schema:
            type: string
          description: ID of a custom agent.
        - in: path
          name: trigger_id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                name:
                  type: string
                cron_expression:
                  type: string
                run_at:
                  type: string
                  format: date-time
                timezone:
                  type: string
                pass_raw_data:
                  type: boolean
                enabled:
                  type: boolean
                max_failures:
                  type: integer
      responses:
        '200':
          description: The updated trigger.
          content:
            application/json:
              schema:
                type: object
                properties:
                  trigger:
                    $ref: '#/components/schemas/AgentTrigger'
        '400':
          description: >-
            `trigger_type_not_editable`, `trigger_schedule_kind_fixed`,
            `trigger_schedule_not_applicable`, an invalid cron or timezone, or
            `agent_not_customizable`.
        '401':
          description: Unauthorized — missing or invalid API key, or a team API key.
        '403':
          description: Forbidden — the caller cannot edit, enable or disable this trigger.
        '404':
          description: Agent or trigger not found.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >
            curl -X PATCH
            'https://api.gumloop.com/api/v1/agents/abc123DEFghiJKL/triggers/trg_7f1a2b'
            \
              -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
              -H 'Content-Type: application/json' \
              -d '{"cron_expression": "0 9 * * 1", "enabled": false}'
        - lang: python
          label: Python
          source: >
            from gumloop import Gumloop


            client = Gumloop(access_token="YOUR_ACCESS_TOKEN")


            client.agents.update_trigger("abc123DEFghiJKL", "trg_7f1a2b",
            cron_expression="0 9 * * 1", enabled=False)
components:
  schemas:
    AgentTrigger:
      type: object
      properties:
        id:
          type: string
          example: trg_7f1a2b
        agent_id:
          type: string
          example: abc123DEFghiJKL
        type:
          type: string
          description: >-
            `schedule` and `webhook` can be created, fully edited and deleted
            through the API. Other types (connector events, agent-built
            triggers) can be renamed, reworded, paused and resumed, but their
            settings live on the trigger page.
          example: schedule
        name:
          type: string
          nullable: true
        prompt:
          type: string
          nullable: true
          description: The message the agent receives when the trigger fires.
        cron_expression:
          type: string
          nullable: true
          description: Five-field cron, for recurring schedules.
          example: 0 9 * * 1-5
        run_at:
          type: string
          format: date-time
          nullable: true
          description: One-time run, for `schedule` triggers created with `run_at`.
        timezone:
          type: string
          nullable: true
          example: America/Los_Angeles
        pass_raw_data:
          type: boolean
          nullable: true
          description: >-
            Webhook only. `true` forwards the request body to the agent instead
            of `prompt`.
        enabled:
          type: boolean
        status:
          type: string
          nullable: true
        max_failures:
          type: integer
          nullable: true
          description: Consecutive failures before the trigger disables itself.
        webhook_url:
          type: string
          nullable: true
          description: >-
            Only on the create response. Fetch it later with `GET
            /agents/{agent_id}/triggers/{trigger_id}/webhook-url`; it embeds the
            trigger's secret.
        created_at:
          type: string
          format: date-time
          nullable: true
        last_run_at:
          type: string
          format: date-time
          nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A personal API key or an [OAuth 2.0](/api-reference/oauth) access token.
        Personal API keys also require the `x-auth-key` header with your user
        ID.

````