---
title: "Update trigger"
method: PATCH
path: "/projects/{project_id}/triggers/{trigger_id}"
tags: ["Trigger"]
---

# Update trigger

`PATCH /projects/{project_id}/triggers/{trigger_id}`

Update a trigger. Currently only supported for triggers where `event_source.provider` is `github_oauth`, `github_app`, `github_server`, `bitbucket_dc`, `webhook`, or `schedule`. [Share feedback](https://circleci.canny.io/cloud-feature-requests/p/project-administration-apis) about our Project Administration APIs.

## Path parameters

- `project_id` string, required
- `trigger_id` string, required

## Request body

- UpdateTriggerRequest
  - `event_preset` 'all-pushes' | 'only-tags' | 'default-branch-pushes' | 'only-build-prs' | 'only-open-prs' | 'only-labeled-prs' | 'only-merged-prs' | 'only-ready-for-review-prs' | 'only-build-pushes-to-non-draft-prs' | 'only-merged-or-closed-prs' | 'pr-comment-equals-run-ci' | 'non-draft-pr-opened' | 'pushes-to-merge-queues' — The name of the event preset to use when filtering events for this trigger. When `event_source.provider` is `github_app` or `github_server`, all preset values are supported. When `event_source.provider` is `github_oauth`, this field is **required** and only the following values are accepted: `all-pushes`, `only-build-prs`. Not applicable when `event_source.provider` is `webhook` or `schedule`.
  - `checkout_ref` string — The ref to use when checking out code for pipeline runs created from this trigger.
  - `config_ref` string — The ref to use when fetching config for pipeline runs created from this trigger.
  - `event_name` string — The name of the triggering event. Required when `provider` is `webhook` or `schedule`. Should not be set for other providers.
  - `disabled` boolean — A flag indicating whether the trigger is disabled or not. Not supported for triggers where `event_source.provider` is `github_oauth`.
  - `event_source` object
    - `webhook` object
      - `sender` string — The sender of the webhook. This can only be set for triggers where `provider` is `webhook`.
    - `schedule` object — Schedule configuration to update for this trigger. Only applicable when `provider` is `schedule`.
      - `cron_expression` string — A cron expression defining when the trigger fires (e.g. `*/5 * * * *` for every 5 minutes).
      - `attribution_actor` 'current' | 'system' — The actor to attribute pipeline runs to. Use `current` to attribute runs to the user who sends this update request, or `system` to attribute runs to the CircleCI system actor.
  - `parameters` object — Pipeline parameters to pass when running pipelines from this trigger. Currently only supported for triggers where `event_source.provider` is `schedule`.

## Response `200`

Successful response.

- Trigger
  - `id` string, uuid — The unique ID of the trigger.
  - `event_name` string — The name of the event that will trigger the pipeline.
  - `event_source` object — The source of events to use for this trigger. Will contain either a `repo`, `webhook`, or `schedule` object depending on the `provider`. (The `github_app`, `github_server`, and `github_oauth` providers imply a `repo`, `webhook` implies a `webhook`, and `schedule` implies a `schedule`.)
    - `provider` string — The integration provider for this resource. One of `github_app`, `github_server`, `github_oauth`, `webhook`, or `schedule`.
    - `repo` object — Information pertaining to the repository used as a source of events for this trigger, if applicable.
      - `full_name` string — The fully-qualified name of the repository.
      - `external_id` string — External identifier for the repository, as defined by the respective version control provider.
    - `webhook` object — Information pertaining to the custom webhook used as a source of events for this trigger, if applicable.
      - `url` string — The URL to use when triggering this webhook.
      - `sender` string — The name of the webhook sender.
    - `schedule` object — Information pertaining to the schedule used as a source of events for this trigger, if applicable.
      - `cron_expression` string — The cron expression defining when this trigger fires.
      - `attribution_actor` object — The actor that pipeline runs from this trigger are attributed to. On creation, callers supply `current` or `system` as a string; the response returns the resolved actor as an object containing their user ID.
        - `id` string, uuid — The unique ID of the user that pipeline runs are attributed to.
  - `event_preset` 'all-pushes' | 'only-tags' | 'default-branch-pushes' | 'only-build-prs' | 'only-open-prs' | 'only-labeled-prs' | 'only-merged-prs' | 'only-ready-for-review-prs' | 'only-build-pushes-to-non-draft-prs' | 'only-merged-or-closed-prs' | 'pr-comment-equals-run-ci' | 'non-draft-pr-opened' | 'pushes-to-merge-queues' — The name of the event preset to use when filtering events for this trigger. When `event_source.provider` is `github_app` or `github_server`, all preset values are supported. When `event_source.provider` is `github_oauth`, this field is **required** and only the following values are accepted: `all-pushes`, `only-build-prs`. Not applicable when `event_source.provider` is `webhook` or `schedule`.
  - `checkout_ref` string — The ref to use when checking out code for pipeline runs created from this trigger. If empty, the ref provided in the trigger event is used.
  - `config_ref` string — The ref to use when fetching config for pipeline runs created from this trigger. If empty, the ref provided in the trigger event is used.
  - `disabled` boolean — Whether the trigger is disabled. Not supported for triggers where `event_source.provider` is `github_oauth`.
  - `parameters` object — Pipeline parameters passed when running pipelines from this trigger. Currently only supported for triggers where `event_source.provider` is `schedule`.

## Other responses

- `400` — Unexpected request body provided.
- `401` — Credentials provided are invalid.
- `404` — Entity not found.
- `500` — Internal server error.

---

[API](https://skmtc.net/circleci/apis/api-v2.md) · [All operations](https://skmtc.net/circleci/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/circleci/api-v2/revisions/b9c0e0c24058/schema)
