---
title: "Update an automation"
method: PATCH
path: "/automations/{id}"
tags: ["Automations"]
---

# Update an automation

`PATCH /automations/{id}`

## Request

- Base URL: `https://api.parley.so/v1`
- URL: `https://api.parley.so/v1/automations/{id}`
- Auth: HTTP bearer

Rename an automation, replace its instructions, add or remove triggers, pause or resume it, or move it to another project. Omitted fields are left unchanged.

## Path parameters

- `id` string, required: The automation ID.

## Request body

- object
  - `name` string: A new name.
  - `description` string, nullable: A new summary. Pass null to clear it.
  - `instructions` string: New instructions that replace the current ones. They take effect on the next run and don't change a run in progress.
  - `triggers` object: Triggers to add or remove. Triggers you don't mention are left unchanged. To change a trigger, remove it and add its replacement in the same call. An automation can have at most 10.
    - `add` union[]: Triggers to add. One the automation already has is ignored.
      - union: A trigger to add, such as { "type": "cron", "cron": "0 9 * * 1-5" } for 9:00 AM on weekdays, or { "type": "event", "event": "project.created" } for each new project.
        - object
          - `type` 'cron', required
          - `cron` string, required: A five-field cron expression (minute, hour, day of month, month, day of week), such as 0 9 * * 1-5 for 9:00 AM on weekdays or 30 16 * * 5 for 4:30 PM on Fridays. A trigger can fire at most once an hour, and macros such as @daily and a seconds field aren't supported.
          - `timezone` string: The IANA time zone the cron expression is read in, such as America/New_York. Defaults to your time zone in Parley.
        - object
          - `type` 'event', required
          - `event` 'project.created' | 'account.created' | 'contact.created', required: What happens in Parley to start a run: someone creates a project, an account, or a contact. Records that email and calendar sync create don't count.
    - `remove` string[]: IDs of triggers to remove, as listed on the automation. IDs the automation doesn't have are ignored.
  - `status` 'active' | 'paused': paused puts every trigger on hold and keeps the automation and its run history. active resumes them.
  - `projectId` string, nullable: A project to run the automation in, which needs edit access to it. Pass null to run it across the organization.

## Response `200`

OK

- Automation
  - `id` string, required: The automation ID.
  - `name` string, required: The automation name.
  - `description` string, nullable, required: A short summary of what the automation does, or null.
  - `status` 'active' | 'paused', required: active: the automation runs when its triggers fire. paused: its triggers are on hold, and the automation only runs when someone starts a run.
  - `nextRunAt` string, date-time, nullable, required: When a trigger next starts a run, or null for an automation that is paused or has no scheduled trigger.
  - `project` ProjectRef, required: The project's type, ID, and name.
    - `type` 'project', required
    - `id` string, required: Its ID.
    - `name` string, required: The project name.
  - `lastRun` object, nullable, required: The most recent run, or null for an automation that has never run.
    - `id` string, required: The run ID.
    - `status` 'pending' | 'running' | 'succeeded' | 'failed' | 'canceled' | 'timed_out', required: pending: queued and not yet started. running: in progress. succeeded, failed, canceled, and timed_out are final.
    - `startedAt` string, date-time, nullable, required: When the run started.
    - `endedAt` string, date-time, nullable, required: When the run finished.
  - `createdAt` string, date-time, required: When the automation was created.
  - `updatedAt` string, date-time, required: When the automation or its triggers were last changed.
  - `triggers` AutomationTrigger[], required: What starts the automation on its own, oldest first. Empty for an automation that only runs when someone starts a run.
    - union: Something that starts a run. cron: a schedule. event: something that happens in Parley. slack_message: a new top-level post in a Slack channel. slack_reaction: a reaction to a message in a Slack channel. More types will be added, so skip any type you do not recognize.
      - CronTrigger
        - `id` string, required: The trigger ID.
        - `type` 'cron', required
        - `cron` string, required: A five-field cron expression (minute, hour, day of month, month, day of week), such as 0 9 * * 1-5 for 9:00 AM on weekdays or 30 16 * * 5 for 4:30 PM on Fridays.
        - `timezone` string, required: The IANA time zone the cron expression is read in, such as America/New_York.
      - EventTrigger
        - `id` string, required: The trigger ID.
        - `type` 'event', required
        - `event` 'project.created' | 'account.created' | 'contact.created', required: What happens in Parley to start a run: someone creates a project, an account, or a contact. Records that email and calendar sync create don't count.
      - SlackMessageTrigger
        - `id` string, required: The trigger ID.
        - `type` 'slack_message', required
        - `channelId` string, required: The ID of the Slack channel the trigger watches.
        - `mentions` object[], required: Only posts that mention one of these people or user groups start a run. Empty for every new post.
          - `type` 'user' | 'user_group', required
          - `id` string, required: The Slack user or user group ID.
      - SlackReactionTrigger
        - `id` string, required: The trigger ID.
        - `type` 'slack_reaction', required
        - `channelId` string, required: The ID of the Slack channel the trigger watches.
        - `reaction` string, required: The emoji, such as white_check_mark, that starts a run when someone in the Slack workspace reacts with it.
  - `instructions` string, required: The automation's instructions: the prompt Parley's assistant carries out on every run.

## Other responses

- `400`: The request was invalid. VALIDATION_FAILED, INVALID_REFERENCE, INVALID_TRIGGER.
- `401`: Missing or invalid credentials. UNAUTHORIZED.
- `403`: You don't have permission. FORBIDDEN.
- `404`: Not found. NOT_FOUND.
- `429`: Too many requests, or a usage limit was reached. TOO_MANY_REQUESTS.

---

[API](https://skmtc.dev/parley/apis/parley-api.md) - [All operations](https://skmtc.dev/parley/apis/parley-api/llms.txt) - [OpenAPI document](https://skmtc.dev/parley/apis/parley-api/revisions/6b78aeee07bc?raw)
