# Update Automation

> PATCH /automations/:id — rename, enable or disable, re-point the domain or trigger, or replace the connection graph.

`PATCH /automations/:id`

Updates an automation. Set `status` to `enabled` to start creating runs for matching events, or `disabled` to stop new runs. You can also rename via `name`, re-point the sending `domain` or the `trigger` event, and replace the connection graph via `connections`. Returns the full updated automation object, including steps and connections.

**Body parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | No | A new name for the automation. |
| `status` | string | No | One of `enabled` or `disabled`. Enabling requires at least one step besides the trigger. |
| `domain` | string | No | Re-point the automation at another of your sending domains. Only allowed while the automation is `disabled`. Re-pointing also moves the contact pool to the new domain's. |
| `trigger` | string | No | Re-point the trigger at a different event name. Only allowed while the automation is `disabled`. Custom event names must not start with the reserved `sendping:` prefix; the built-in `sendping:schedule` scheduled trigger is the one exception. |
| `trigger_config` | object | No | The `sendping:schedule` trigger’s schedule — an object `{ at, timezone }` that runs the automation **once** for every contact in the domain’s audience at that time. `at` is an ISO 8601 instant that must be in the future and at most 366 days ahead; `timezone` is the IANA timezone name it was picked in (e.g. `America/New_York`). |
| `trigger_key` | string | No | Optional key for the trigger step in the graph (used by the canvas editor). Only meaningful alongside `trigger`; defaults to the existing key, or `trigger`. |
| `connections` | array | No | Replaces the [connections](https://www.sendping.co/docs/automations/connections) between steps. Only allowed while the automation is `disabled`. Cyclic graphs are rejected. |

> **Note:** Structural edits — steps, connections, `trigger`, and `domain` — require the automation to be **disabled**. Disable it first, make your changes, then re-enable it.

**Node.js**

```js
import { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

const { data, error } = await mb.automations.update('c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd', { "status": "enabled" });
console.log({ data, error });
```

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

SendPing::Automations.update("c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd", {
  "status": "enabled"
})
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

$sendping->automations->update('c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd', [
  'status' => "enabled"
]);
```

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

sendping.Automations.update("c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd", {
  "status": "enabled"
})
```

**Go**

```go
import "github.com/shekhu10/sendping-sdks/sendping-go"

client := sendping.NewClient("mb_xxxxxxxxx")

automation, err := client.Automations.Update("c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd", &sendping.UpdateAutomationRequest{
    Status: "enabled",
})
```

**Rust**

```rust
use sendping::{SendPing, UpdateAutomationOptions};

let mb = SendPing::new("mb_xxxxxxxxx");

let params = UpdateAutomationOptions::new().with_status("enabled");
let _automation = mb.automations.update("c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd", params).await?;
```

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;
import co.sendping.requests.UpdateAutomationRequest;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

SendPingResponse response = sendping.automations().update(
        "c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd",
        UpdateAutomationRequest.builder().status("enabled").build());
```

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

var resp = await sendping.AutomationUpdateAsync(
    "c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd",
    new AutomationUpdateOptions { Status = "enabled" });
```

**cURL**

```bash
curl -X PATCH 'https://www.sendping.co/api/automations/c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd' \
  -H 'Authorization: Bearer mb_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{ "status": "enabled" }'
```

**CLI**

```bash
sendping automations update c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd \
  --status 'enabled'
```

### Response

```json
{
  "object": "automation",
  "id": "c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd",
  "audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "domain": "yourdomain.com",
  "name": "Welcome series",
  "trigger": "user.created",
  "status": "enabled",
  "trigger_config": null,
  "trigger_key": "start",
  "steps": [
    {
      "key": "start",
      "type": "trigger",
      "config": { "event_name": "user.created", "domain": "yourdomain.com" }
    },
    {
      "id": "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
      "key": "welcome",
      "type": "send_email",
      "position": 0,
      "config": {
        "template": { "id": "34a080c9-b17d-4187-ad80-5af20266e535" }
      }
    }
  ],
  "connections": [
    { "from": "start", "to": "welcome", "type": "default" }
  ],
  "created_at": "2026-06-23T10:00:00.000Z",
  "updated_at": "2026-06-23T10:01:00.000Z"
}
```
