Source: https://leadping.ai/docs/api-reference/automations/update-an-organization-lead-follow-up-automation

# Update an organization lead follow-up automation

**Automations**

Updates an automation for current-organization leads, changing triggers, message steps, routing, or active follow-up settings.

## Request

`PUT /automations/{id}`

### cURL

```bash
curl --request PUT \
  --url https://api.leadping.ai/automations/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>"
}'
```

### Python

```python
import requests

url = "https://api.leadping.ai/automations/{id}"

payload = { "name": "<string>" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://api.leadping.ai/automations/{id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n  \"name\": \"<string>\"\n}", false);
var response = await client.PutAsync(request);

Console.WriteLine("{0}", response.Content);
```

### Java

```java
HttpResponse<String> response = Unirest.put("https://api.leadping.ai/automations/{id}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"<string>\"\n}")
  .asString();
```

### JavaScript

```javascript
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({name: '<string>'})
};

fetch('https://api.leadping.ai/automations/{id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.leadping.ai/automations/{id}"

	payload := strings.NewReader("{\n  \"name\": \"<string>\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### PHP

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.leadping.ai/automations/{id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    'name' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

## Authorizations

### `Authorization`

- **Type:** `string`
- **Location:** `header`
- **Required:** Yes

Authorization header using the Bearer scheme. Accepted values are Leadping user JWT access tokens and WorkOS organization API keys beginning with `sk_`.

## Path Parameters

### `id`

- **Type:** `string`
- **Required:** Yes

The ID of the automation.

## Body

**Content type:** `application/json`  
Alternative content type: `application/*+json`

The automation request payload for the operation.

Defines the fields clients can send when working with automation configuration.

### `name`

- **Type:** `string`
- **Required:** Yes

Human-readable display name for the resource, subject to the API's maximum name length.

Maximum string length: `255`

### `description`

- **Type:** `null | string`

Human-readable description that explains this automation configuration request to API users.

### `enabled`

- **Type:** `null | boolean`

Indicates whether this automation configuration request is active and available in the Leadping API.

### `scope`

- **Type:** `null | string`

Scope that limits where this automation configuration request applies in Leadping.

### `visibility`

- **Type:** `null | string`

Visibility level that controls who can see this automation configuration request.

### `triggers`

- **Type:** `object[]`

Automation triggers that can start this workflow.

Show child attributes

### `conditionGroups`

- **Type:** `object[]`

Grouped automation conditions used to decide whether this workflow should run.

Show child attributes

### `actions`

- **Type:** `object[]`

Automation actions configured or returned for this workflow.

Show child attributes

### `connections`

- **Type:** `object[]`

Directed connections between nodes in this automation graph.

Show child attributes

### `version`

- **Type:** `integer<int32>`

Version number for this automation configuration request schema or saved configuration.

### `id`

- **Type:** `null | string`

Stable unique identifier of an existing resource to update; omit it when the API assigns an identifier during creation.

## Response

**Status:** `200`  
**Content type:** `application/json`

Returns the automation response.

Describes automation configuration data returned by Leadping.

### `isDemo`

- **Type:** `boolean`

### `description`

- **Type:** `null | string`

Human-readable description that explains this automation configuration response to API users.

### `enabled`

- **Type:** `null | boolean`

Indicates whether this automation configuration response is active and available in the Leadping API.

### `organizationId`

- **Type:** `null | string`

Organization ID that owns this automation.

### `createdByUserId`

- **Type:** `null | string`

User ID of the person who created this automation configuration response.

### `scope`

- **Type:** `null | string`

Scope that limits where this automation configuration response applies in Leadping.

### `visibility`

- **Type:** `null | string`

Visibility level that controls who can see this automation configuration response.

### `managementLevel`

- **Type:** `null | string`

Management level that controls whether Leadping or the organization owns this automation setting.

### `isSystemManaged`

- **Type:** `boolean`

Indicates whether Leadping manages this automation configuration response automatically instead of a user.

### `triggers`

- **Type:** `object[]`

Automation triggers that can start this workflow.

Show child attributes

### `conditionGroups`

- **Type:** `object[]`

Grouped automation conditions used to decide whether this workflow should run.

Show child attributes

### `actions`

- **Type:** `object[]`

Automation actions configured or returned for this workflow.

Show child attributes

### `connections`

- **Type:** `object[]`

Directed connections between nodes in this automation graph.

Show child attributes

### `lastRunAt`

- **Type:** `null | string<date-time>`

UTC timestamp when this automation last ran.

### `lastRunStatus`

- **Type:** `null | string`

Status from the most recent automation run.

### `version`

- **Type:** `integer<int32>`

Version number for this automation configuration response schema or saved configuration.

### `user`

- **Type:** `object | null`

Provides a compact API reference to another resource using its stable identifier and human-readable display name.

Show child attributes

### `organization`

- **Type:** `object | null`

Provides a compact API reference to another resource using its stable identifier and human-readable display name.

Show child attributes

### `name`

- **Type:** `string`

Human-readable display name of the resource.

### `id`

- **Type:** `string`

Stable unique identifier of the resource.

### `createdAt`

- **Type:** `string<date-time>`

UTC timestamp when the resource was created.

### `modifiedAt`

- **Type:** `null | string<date-time>`

UTC timestamp when the resource was last modified, or null when it has not been updated.

### Example response

```json
{
  "isDemo": true,
  "description": "<string>",
  "enabled": true,
  "organizationId": "<string>",
  "createdByUserId": "<string>",
  "scope": "<string>",
  "visibility": "<string>",
  "managementLevel": "<string>",
  "isSystemManaged": true,
  "triggers": [
    {
      "id": "<string>",
      "type": "<string>",
      "displayName": "<string>",
      "isEnabled": true,
      "settings": {}
    }
  ],
  "conditionGroups": [
    {
      "id": "<string>",
      "mode": "<string>",
      "conditions": [
        {
          "id": "<string>",
          "type": "<string>",
          "operator": "<string>",
          "isEnabled": true,
          "settings": {}
        }
      ]
    }
  ],
  "actions": [
    {
      "id": "<string>",
      "type": "<string>",
      "order": 123,
      "isEnabled": true,
      "settings": {}
    }
  ],
  "connections": [
    {
      "id": "<string>",
      "sourceNodeId": "<string>",
      "targetNodeId": "<string>",
      "weight": 123
    }
  ],
  "lastRunAt": "2023-11-07T05:31:56Z",
  "lastRunStatus": "<string>",
  "version": 123,
  "user": {
    "id": "<string>",
    "name": "<string>"
  },
  "organization": {
    "id": "<string>",
    "name": "<string>"
  },
  "name": "<string>",
  "id": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "modifiedAt": "2023-11-07T05:31:56Z"
}
```

## Error responses

### `400 Bad Request`

```json
{
  "type": "about:blank",
  "title": "Bad Request",
  "status": 400,
  "detail": "The request could not be completed."
}
```

### `401 Unauthorized`

```json
{
  "type": "about:blank",
  "title": "Unauthorized",
  "status": 401,
  "detail": "The request could not be completed."
}
```

### `403 Forbidden`

```json
{
  "type": "about:blank",
  "title": "Forbidden",
  "status": 403,
  "detail": "The request could not be completed."
}
```

### `404 Not Found`

```json
{
  "type": "about:blank",
  "title": "Not Found",
  "status": 404,
  "detail": "The request could not be completed."
}
```

### `429 Too Many Requests`

```json
{
  "type": "about:blank",
  "title": "Too Many Requests",
  "status": 429,
  "detail": "The request could not be completed."
}
```

[Previous: Get an organization lead follow-up automation](https://leadping.ai/docs/api-reference/automations/get-an-organization-lead-follow-up-automation)

[Next: Delete an organization lead follow-up automation](https://leadping.ai/docs/api-reference/automations/delete-an-organization-lead-follow-up-automation)
