# Create Recurring Task

POST https://services.leadconnectorhq.com/projects/recurring-tasks

Creates one recurring task definition. There is no list endpoint and no list binding. The schedule uses `rruleOptions` (`intervalType`, not a raw RRULE string). `owners` and `contactIds` are the recurring fields — task create uses `assignees` and `contactId`. Requires `projects/tasks.recurring.write`.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `projects/tasks.recurring.write`

## Parameters

### Header Parameters

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

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | No | Location id. **Required for `channel: APP`.** Ignored for OAuth/PIT — those use the location on the auth token. Do not send in path, body, or headers. |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2023-02-21"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/projects/recurring-tasks": {
      "post": {
        "summary": "Create Recurring Task",
        "operationId": "createRecurringTask",
        "description": "Creates one recurring task definition. There is no list endpoint and no list binding. The schedule uses `rruleOptions` (`intervalType`, not a raw RRULE string). `owners` and `contactIds` are the recurring fields — task create uses `assignees` and `contactId`. Requires `projects/tasks.recurring.write`.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2023-02-21"
              ]
            }
          },
          {
            "name": "locationId",
            "required": false,
            "in": "query",
            "description": "Location id. **Required for `channel: APP`.** Ignored for OAuth/PIT — those use the location on the auth token. Do not send in path, body, or headers.",
            "schema": {
              "example": "ve9EPM428h8b87FE9C12Kg",
              "type": "string",
              "description": "Location id. Required for APP channel (`?locationId=`). Ignored for OAuth/PIT (token location is used). Do not send in path, body, or headers."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecurringTaskCreateDTO"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsRecurringTaskResponseDto"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsRecurringTaskResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — missing scope or no access to this space, folder, list, or task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found — space, folder, list, task, comment, or recurring task missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "projects/tasks.recurring.write"
            ]
          }
        ]
      }
    }
  },
  "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"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "RecurringTaskCreateDTO": {
        "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",
                    "description": "Recurrence interval unit. Allowed: `yearly`, `monthly`, `weekly`, `daily`, `hourly`."
                  },
                  "interval": {
                    "type": "number",
                    "example": 2,
                    "description": "Recurrence interval count"
                  },
                  "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",
                    "description": "Day of week for weekly recurrence. Allowed: `MO`, `TU`, `WE`, `TH`, `FR`, `SA`, `SU`."
                  },
                  "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"
          }
        },
        "required": [
          "title",
          "rruleOptions"
        ],
        "title": "RecurringTaskCreateDTO"
      },
      "ProjectsRecurringTaskResponseDto": {
        "type": "object",
        "description": "Recurring task definition",
        "properties": {
          "recurringTask": {
            "type": "object",
            "description": "Recurring task record",
            "properties": {
              "id": {
                "type": "string",
                "description": "Recurring task id",
                "example": "6a102435124ecfb348bd5511"
              },
              "title": {
                "type": "string",
                "description": "Title used for spawned occurrence tasks",
                "example": "Daily standup prep"
              },
              "locationId": {
                "type": "string",
                "description": "Location id",
                "example": "ve9EPM428h8b87FE9C12Kg"
              },
              "deleted": {
                "type": "boolean",
                "description": "Whether the recurring task is deleted",
                "example": false
              },
              "dueAfterSeconds": {
                "type": "number",
                "description": "Seconds after occurrence start until due",
                "example": 3600
              },
              "rruleOptions": {
                "description": "Recurrence rule fields: `intervalType` (`yearly` | `monthly` | `weekly` | `daily` | `hourly`), `interval`, `startDate`, optional `endDate` or `count` (not both), `dayOfWeek` (`MO`…`SU`), `dayOfMonth` (1–31; short months clamp or skip per product calendar rules), and `dueAfterSeconds` on the rule. Prefer `dueAfterSeconds` on the recurring task root when both are present.",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "intervalType": {
                        "type": "string",
                        "enum": [
                          "yearly",
                          "monthly",
                          "weekly",
                          "daily",
                          "hourly"
                        ],
                        "example": "monthly",
                        "description": "Recurrence interval unit. Allowed: `yearly`, `monthly`, `weekly`, `daily`, `hourly`."
                      },
                      "interval": {
                        "type": "number",
                        "example": 2,
                        "description": "Recurrence interval count"
                      },
                      "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",
                        "description": "Day of week for weekly recurrence. Allowed: `MO`, `TU`, `WE`, `TH`, `FR`, `SA`, `SU`."
                      },
                      "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"
                  }
                ],
                "example": {
                  "intervalType": "daily",
                  "interval": 1,
                  "startDate": "2026-09-20T10:00:00.000Z"
                }
              }
            },
            "example": {
              "id": "6a102435124ecfb348bd5511",
              "title": "Daily standup prep",
              "locationId": "ve9EPM428h8b87FE9C12Kg",
              "deleted": false,
              "dueAfterSeconds": 3600,
              "rruleOptions": {
                "intervalType": "daily",
                "interval": 1,
                "startDate": "2026-09-20T10:00:00.000Z",
                "dueAfterSeconds": 3600
              }
            }
          }
        },
        "title": "ProjectsRecurringTaskResponseDto"
      },
      "ProjectsErrorResponseDto": {
        "type": "object",
        "description": "Error payload for non-2xx responses. Same shape on every Projects operation.\n\n`message` is a string, or a string array for validation failures.\n\n`error` is usually the HTTP reason phrase (`Bad Request`, `Unprocessable Entity`, …). Known domain values include `graph_scope_invalid` (Search list-scope failures).\n\nWhen `error` is `graph_scope_invalid`, `reason` discriminates the failure: `too_many_ids` | `non_list_type` | `duplicate_graph_scope`.",
        "required": [
          "statusCode",
          "message"
        ],
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code",
            "example": 422
          },
          "message": {
            "description": "Human-readable message, or a list of validation messages",
            "oneOf": [
              {
                "type": "string",
                "example": "Task is already in the destination list"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "example": [
                  "dueDate must be a string"
                ]
              }
            ],
            "example": null
          },
          "error": {
            "type": "string",
            "description": "HTTP reason phrase or domain code when present. Domain codes seen today: `graph_scope_invalid`. Otherwise Nest’s reason phrase.",
            "example": "graph_scope_invalid"
          },
          "reason": {
            "type": "string",
            "description": "Present when `error` is `graph_scope_invalid`. Discriminates Search list-scope failures. Allowed: `too_many_ids`, `non_list_type`, `duplicate_graph_scope`.",
            "enum": [
              "too_many_ids",
              "non_list_type",
              "duplicate_graph_scope"
            ],
            "example": "too_many_ids"
          }
        },
        "example": {
          "statusCode": 422,
          "message": "graph.id scope may not exceed 10 list IDs",
          "error": "graph_scope_invalid",
          "reason": "too_many_ids"
        },
        "title": "ProjectsErrorResponseDto"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X POST 'https://services.leadconnectorhq.com/projects/recurring-tasks' \
  -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: 'POST',
  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/projects/recurring-tasks', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/projects/recurring-tasks"

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.post(url, json=payload, headers=headers)
print(response.json())
```

**PHP**

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

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/projects/recurring-tasks',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  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
  .post("https://services.leadconnectorhq.com/projects/recurring-tasks")
  .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/projects/recurring-tasks"
  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("POST", 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/projects/recurring-tasks")

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

request = Net::HTTP::Post.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/projects/recurring-tasks' -Method 'POST' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
