# Update Recurring Task

PUT https://services.leadconnectorhq.com/locations/{locationId}/recurring-tasks/{id}

Update Recurring Task

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** No scopes required.

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | Yes | Recurring Task Id |
| `locationId` | string | Yes | Location Id |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2023-02-21"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/locations/{locationId}/recurring-tasks/{id}": {
      "put": {
        "summary": "Update Recurring Task",
        "operationId": "updateRecurringTask",
        "description": "Update Recurring Task",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2023-02-21"
              ]
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Recurring Task Id",
            "schema": {
              "example": "sx6wyHhbFdRXh302Lunr",
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "path",
            "description": "Location Id",
            "schema": {
              "example": "sx6wyHhbFdRXh302Lunr",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecurringTaskUpdateDTO"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringTaskSingleResponseDTO"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "RecurringTaskUpdateDTO": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "example": "Task Name",
            "description": "Name of the task"
          },
          "description": {
            "type": "string",
            "example": "Task Description",
            "description": "Description of the task"
          },
          "contactIds": {
            "example": [
              "sx6wyHhbFdRXh302Lunr"
            ],
            "description": "Contact Id",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "owners": {
            "example": [
              "sx6wyHhbFdRXh302Lunr"
            ],
            "description": "Assigned To",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rruleOptions": {
            "example": {
              "intervalType": "hourly",
              "interval": 1,
              "startDate": "2025-07-23T10:00:00.000Z",
              "dueAfterSeconds": 600
            },
            "description": "Recurring rules",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "intervalType": {
                    "type": "string",
                    "enum": [
                      "yearly",
                      "monthly",
                      "weekly",
                      "daily",
                      "hourly"
                    ],
                    "example": "monthly"
                  },
                  "interval": {
                    "type": "number",
                    "example": 2
                  },
                  "startDate": {
                    "type": "string",
                    "example": "2021-09-30T00:00:00.000Z",
                    "description": "Start Date"
                  },
                  "endDate": {
                    "type": "string",
                    "example": "2021-09-30T00:00:00.000Z",
                    "description": "End Date"
                  },
                  "dayOfMonth": {
                    "type": "number",
                    "description": "1, 2, 3, ..., 27, 31",
                    "example": 15
                  },
                  "dayOfWeek": {
                    "type": "string",
                    "enum": [
                      "MO",
                      "TU",
                      "WE",
                      "TH",
                      "FR",
                      "SA",
                      "SU"
                    ],
                    "example": "MO"
                  },
                  "monthOfYear": {
                    "type": "number",
                    "description": "1, 2, ....., 11, 12",
                    "example": 1
                  },
                  "count": {
                    "type": "number",
                    "description": "Max number of task executions",
                    "example": 10
                  },
                  "createTaskIfOverDue": {
                    "type": "boolean",
                    "example": true,
                    "description": "Create Task If Over Due"
                  },
                  "dueAfterSeconds": {
                    "type": "number",
                    "example": 23404000,
                    "description": "Due after seconds"
                  }
                },
                "required": [
                  "intervalType",
                  "interval",
                  "startDate",
                  "dueAfterSeconds"
                ],
                "title": "CustomRRulesOptions"
              }
            ]
          },
          "ignoreTaskCreation": {
            "type": "boolean",
            "example": true,
            "description": "Create initial task or not"
          }
        },
        "title": "RecurringTaskUpdateDTO"
      },
      "RecurringTaskSingleResponseDTO": {
        "type": "object",
        "properties": {
          "recurringTask": {
            "description": "Recurring Tasks",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "sx6wyHhbFdRXh302Lunr",
                    "description": "Recurring Task Id"
                  },
                  "title": {
                    "type": "string",
                    "example": "Task Name",
                    "description": "Name of the task"
                  },
                  "description": {
                    "type": "string",
                    "example": "Task Description",
                    "description": "Description of the task"
                  },
                  "locationId": {
                    "type": "string",
                    "example": "sx6wyHhbFdRXh302Lunr",
                    "description": "Location Id"
                  },
                  "updatedAt": {
                    "type": "string",
                    "example": "2021-04-15T10:00:00.000Z",
                    "description": "Updated At"
                  },
                  "createdAt": {
                    "type": "string",
                    "example": "2021-04-15T10:00:00.000Z",
                    "description": "Created At"
                  },
                  "rruleOptions": {
                    "example": {
                      "createTaskIfOverDue": false,
                      "interval": 1,
                      "intervalType": "hourly",
                      "startDate": "2024-10-29T12:34:03.000Z",
                      "dueAfterSeconds": 600,
                      "count": 550
                    },
                    "description": "Recurring rules",
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "intervalType": {
                            "type": "string",
                            "enum": [
                              "yearly",
                              "monthly",
                              "weekly",
                              "daily",
                              "hourly"
                            ],
                            "example": "monthly"
                          },
                          "interval": {
                            "type": "number",
                            "example": 2
                          },
                          "startDate": {
                            "type": "string",
                            "example": "2021-09-30T00:00:00.000Z",
                            "description": "Start Date"
                          },
                          "endDate": {
                            "type": "string",
                            "example": "2021-09-30T00:00:00.000Z",
                            "description": "End Date"
                          },
                          "dayOfMonth": {
                            "type": "number",
                            "description": "1, 2, 3, ..., 27, 31",
                            "example": 15
                          },
                          "dayOfWeek": {
                            "type": "string",
                            "enum": [
                              "MO",
                              "TU",
                              "WE",
                              "TH",
                              "FR",
                              "SA",
                              "SU"
                            ],
                            "example": "MO"
                          },
                          "monthOfYear": {
                            "type": "number",
                            "description": "1, 2, ....., 11, 12",
                            "example": 1
                          },
                          "count": {
                            "type": "number",
                            "description": "Max number of task executions",
                            "example": 10
                          },
                          "createTaskIfOverDue": {
                            "type": "boolean",
                            "example": true,
                            "description": "Create Task If Over Due"
                          },
                          "dueAfterSeconds": {
                            "type": "number",
                            "example": 23404000,
                            "description": "Due after seconds"
                          }
                        },
                        "required": [
                          "intervalType",
                          "interval",
                          "startDate",
                          "dueAfterSeconds"
                        ],
                        "title": "CustomRRulesOptions"
                      }
                    ]
                  },
                  "totalOccurrence": {
                    "type": "number",
                    "example": 10,
                    "description": "Total Occurrence"
                  },
                  "deleted": {
                    "type": "boolean",
                    "example": false,
                    "description": "Deleted"
                  },
                  "assignedTo": {
                    "type": "string",
                    "example": "sx6wyHhbFdRXh302Lunr",
                    "description": "Assigned To"
                  },
                  "contactId": {
                    "type": "string",
                    "example": "v5cEPM428h8vShlRW1KT",
                    "description": "Contact Id"
                  }
                },
                "required": [
                  "id",
                  "title",
                  "description",
                  "locationId",
                  "updatedAt",
                  "createdAt",
                  "rruleOptions",
                  "totalOccurrence",
                  "deleted"
                ],
                "title": "RecurringTaskResponseDTO"
              }
            ]
          }
        },
        "required": [
          "recurringTask"
        ],
        "title": "RecurringTaskSingleResponseDTO"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      }
    }
  }
}
```

## HighLevel SDK Examples

**Node.js** (`@gohighlevel/api-client`)

```javascript
import HighLevel from '@gohighlevel/api-client';

const ghl = new HighLevel({
  privateIntegrationToken: '<PRIVATE_INTEGRATION_TOKEN>'
});

const body = {
  "title": "Task Name",
  "description": "Task Description",
  "contactIds": [
    "sx6wyHhbFdRXh302Lunr"
  ],
  "owners": [
    "sx6wyHhbFdRXh302Lunr"
  ],
  "rruleOptions": {
    "intervalType": "hourly",
    "interval": 1,
    "startDate": "2025-07-23T10:00:00.000Z",
    "dueAfterSeconds": 600
  },
  "ignoreTaskCreation": true
};

const response = await ghl.locations.updateRecurringTask('<ID>', '<LOCATIONID>', body);
console.log(response);
```

**Python** (`gohighlevel-api-client`)

```python
from highlevel import HighLevel

client = HighLevel(
    private_integration_token='<PRIVATE_INTEGRATION_TOKEN>'
)

body = {
    "title": "Task Name",
    "description": "Task Description",
    "contactIds": [
        "sx6wyHhbFdRXh302Lunr"
    ],
    "owners": [
        "sx6wyHhbFdRXh302Lunr"
    ],
    "rruleOptions": {
        "intervalType": "hourly",
        "interval": 1,
        "startDate": "2025-07-23T10:00:00.000Z",
        "dueAfterSeconds": 600
    },
    "ignoreTaskCreation": true
}

response = await client.locations.update_recurring_task('<ID>', '<LOCATIONID>', body=body)
print(response)
```

**PHP** (`gohighlevel/api-client`)

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

use HighLevel\HighLevel;
use HighLevel\HighLevelConfig;

$config = new HighLevelConfig([
    'privateIntegrationToken' => '<PRIVATE_INTEGRATION_TOKEN>'
]);
$ghl = new HighLevel($config);

$body = [
    'title' => 'Task Name',
    'description' => 'Task Description',
    'contactIds' => [
        'sx6wyHhbFdRXh302Lunr'
    ],
    'owners' => [
        'sx6wyHhbFdRXh302Lunr'
    ],
    'rruleOptions' => [
        'intervalType' => 'hourly',
        'interval' => 1,
        'startDate' => '2025-07-23T10:00:00.000Z',
        'dueAfterSeconds' => 600
    ],
    'ignoreTaskCreation' => true
];

$response = $ghl->locations->updateRecurringTask('<ID>', '<LOCATIONID>', $body);
echo json_encode($response, JSON_PRETTY_PRINT);
```

## Code Examples

**cURL**

```bash
curl -L -X PUT 'https://services.leadconnectorhq.com/locations/<locationId>/recurring-tasks/<id>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2023-02-21' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "title": "Task Name",
  "description": "Task Description",
  "contactIds": [
    "sx6wyHhbFdRXh302Lunr"
  ],
  "owners": [
    "sx6wyHhbFdRXh302Lunr"
  ],
  "rruleOptions": {
    "intervalType": "hourly",
    "interval": 1,
    "startDate": "2025-07-23T10:00:00.000Z",
    "dueAfterSeconds": 600
  },
  "ignoreTaskCreation": true
}'
```

**Node.js**

```javascript
const options = {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: '2023-02-21',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "title": "Task Name",
      "description": "Task Description",
      "contactIds": [
        "sx6wyHhbFdRXh302Lunr"
      ],
      "owners": [
        "sx6wyHhbFdRXh302Lunr"
      ],
      "rruleOptions": {
        "intervalType": "hourly",
        "interval": 1,
        "startDate": "2025-07-23T10:00:00.000Z",
        "dueAfterSeconds": 600
      },
      "ignoreTaskCreation": true
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/locations/<locationId>/recurring-tasks/<id>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/locations/{locationId}/recurring-tasks/{id}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2023-02-21"
}

payload = {
    "title": "Task Name",
    "description": "Task Description",
    "contactIds": [
        "sx6wyHhbFdRXh302Lunr"
    ],
    "owners": [
        "sx6wyHhbFdRXh302Lunr"
    ],
    "rruleOptions": {
        "intervalType": "hourly",
        "interval": 1,
        "startDate": "2025-07-23T10:00:00.000Z",
        "dueAfterSeconds": 600
    },
    "ignoreTaskCreation": true
}

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

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/locations/<locationId>/recurring-tasks/<id>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2023-02-21',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "title": "Task Name",
  "description": "Task Description",
  "contactIds": [
    "sx6wyHhbFdRXh302Lunr"
  ],
  "owners": [
    "sx6wyHhbFdRXh302Lunr"
  ],
  "rruleOptions": {
    "intervalType": "hourly",
    "interval": 1,
    "startDate": "2025-07-23T10:00:00.000Z",
    "dueAfterSeconds": 600
  },
  "ignoreTaskCreation": true
}',
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .put("https://services.leadconnectorhq.com/locations/<locationId>/recurring-tasks/<id>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2023-02-21")
  .header("Content-Type", "application/json")
  .body("{\"title\":\"Task Name\",\"description\":\"Task Description\",\"contactIds\":[\"sx6wyHhbFdRXh302Lunr\"],\"owners\":[\"sx6wyHhbFdRXh302Lunr\"],\"rruleOptions\":{\"intervalType\":\"hourly\",\"interval\":1,\"startDate\":\"2025-07-23T10:00:00.000Z\",\"dueAfterSeconds\":600},\"ignoreTaskCreation\":true}")
  .asString();
```

**Go**

```go
package main

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

func main() {
  url := "https://services.leadconnectorhq.com/locations/<locationId>/recurring-tasks/<id>"
  payload := strings.NewReader(`{
  "title": "Task Name",
  "description": "Task Description",
  "contactIds": [
    "sx6wyHhbFdRXh302Lunr"
  ],
  "owners": [
    "sx6wyHhbFdRXh302Lunr"
  ],
  "rruleOptions": {
    "intervalType": "hourly",
    "interval": 1,
    "startDate": "2025-07-23T10:00:00.000Z",
    "dueAfterSeconds": 600
  },
  "ignoreTaskCreation": true
}`)
  req, _ := http.NewRequest("PUT", url, payload)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2023-02-21")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/locations/<locationId>/recurring-tasks/<id>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "2023-02-21"
request["Content-Type"] = "application/json"
request.body = '{
  "title": "Task Name",
  "description": "Task Description",
  "contactIds": [
    "sx6wyHhbFdRXh302Lunr"
  ],
  "owners": [
    "sx6wyHhbFdRXh302Lunr"
  ],
  "rruleOptions": {
    "intervalType": "hourly",
    "interval": 1,
    "startDate": "2025-07-23T10:00:00.000Z",
    "dueAfterSeconds": 600
  },
  "ignoreTaskCreation": true
}'

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2023-02-21"
}

$body = '{
  "title": "Task Name",
  "description": "Task Description",
  "contactIds": [
    "sx6wyHhbFdRXh302Lunr"
  ],
  "owners": [
    "sx6wyHhbFdRXh302Lunr"
  ],
  "rruleOptions": {
    "intervalType": "hourly",
    "interval": 1,
    "startDate": "2025-07-23T10:00:00.000Z",
    "dueAfterSeconds": 600
  },
  "ignoreTaskCreation": true
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/locations/<locationId>/recurring-tasks/<id>' -Method 'PUT' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
