---
title: "Metadata and segment auto-enrollment"
method: PATCH
path: "/automations/{id}"
tags: ["Automations"]
---

# Metadata and segment auto-enrollment

`PATCH /automations/{id}`

## Request

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

Updates only the fields present in the body. `name` and `description` are internal labels (no recipient sees them) and change WITHOUT creating a new version: a name fix must not leave contacts already inside on an older version. The name is not taken from the `journey`, or rewriting the DAG would bring back the name the automation was created with over a fix already made.

`enrollSegmentId` sets (or removes, with `null`) the segment that enrolls on its own: whoever matches its conditions enters the flow, without waiting for an event. It is how to run reactivation and win-back, which start from something that did NOT happen (no open in 60 days) and for which there is no event to emit. The run is hourly and enrollment stays once-per-contact, so nobody enters twice. Mind the difference between **absent** and **null**: a field you do not name stays as it is, `null` clears it. Required scope: `automations:write`.

## Path parameters

- `id` string, required: Automation ID.

## Request body

- UpdateAutomationInput
  - `name` string: Automation name. Internal label: no recipient sees it.
  - `description` string, nullable: Internal note about the automation. `null` clears it.
  - `enrollSegmentId` string, uuid, nullable: Segment that enrolls on its own: whoever starts matching its conditions enters the flow, without waiting for an event. Only applies to active automations; `null` turns off auto-enrollment without touching contacts already inside.

## Response `200`

Automation updated.

- object
  - `id` string, uuid, required
  - `name` string, required
  - `description` string, nullable, required
  - `enrollSegmentId` string, uuid, nullable, required
  - `enrollmentsOnOlderVersions` integer, required: Contacts in flight on an older version. Message content reaches them (it is re-read at every send), structure and waits do not.

## Other responses

- `401`: Missing or invalid token.
- `403`: Insufficient scope.
- `404`: Resource not found.
- `422`: Invalid input.

---

[API](https://skmtc.dev/sending/apis/sending-dev-api.md) · [All operations](https://skmtc.dev/sending/apis/sending-dev-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sending/apis/sending-dev-api/revisions/9fe78d2918a1?raw)
