---
title: "PATCH /ver2/TaskService.svc/tasks/{taskId}"
method: PATCH
path: "/ver2/TaskService.svc/tasks/{taskId}"
tags: ["Task"]
---

# PATCH /ver2/TaskService.svc/tasks/{taskId}

`PATCH /ver2/TaskService.svc/tasks/{taskId}`

## Request

- Base URL: `https://api.enviance.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.enviance.com/ver2/TaskService.svc/tasks/{taskId}`
- Auth: none declared
- TypeScript: <https://skmtc.dev/enviance/apis/restapi/docs/ver2/TaskService.svc/tasks/:taskId/patch.ts> (a function with typed inputs; its response is checked against the schema)

Updates the properties of a simple (single occurrence) Task definition, potentially moving it to a new Location. Updating the object Location(s) of a Task effectively moves that Task to the new Location(s).

**Security:** Requires Manage Tasks right. 

**SDK API:**  `envianceSdk.tasks.updateTask(taskId, taskInfo, onsuccess, onerror)`

```
PATCH /ver2/TaskService.svc/tasks/9ca22677-2670-41a9-bafd-3b2825592863 HTTP/1.1
Content-Type: application/json; charset=UTF-8
 
{
  "taskInfo": {
    "name": "Check Valves Monthly",
    "description": "Perform a spot check every month on the steam valves.",
    "dueDate": "2012-12-08T09:00:00",
    "timeZone": "USA Pacific",
    "objects": [
      "/A Facility/A Unit/A POI/Check Valves",
      "/A Facility/A Unit/B POI/Check Valves",
      "/A Facility/A Unit/C POI/Check Valves"
    ]
  }
}

```



envianceSdk.tasks.updateTask
```
[
  "F04DD9CA-35CA-4579-A266-5050660D7012",
  {
    "name": "Task 1 updated",
    "description": "updated.",
    "timeZone": {
      "name": "Pacific Time (US \u0026 Canada) (UTC-08:00) (With DST)"
    },
    "assignor": "eoleg2",
    "assignees": [
      {
        "userIdOrName": "eoleg1"
      }
    ],
    "calendars": [
      "System",
      "My"
    ],
    "objects": [
      "/Area 1"
    ],
    "schedules": [
      {
        "startDate": "2014-02-22T00:00:00",
        "recurrenceType": "Monthly",
        "startTime": "00:00:00",
        "recurrenceInterval": 1,
        "dayOfMonth": 31
      }
    ],
    "notifications": [
      {
        "conditions": {
          "immediately": true,
          "whenDismissed": true,
          "byDueDate": {
            "conditionType": "IntervalBefore",
            "intervalValue": 5,
            "intervalType": "Hour"
          },
          "byCompletionStatus": {
            "comparisonLogic": "\u003E=",
            "completionPercent": 30
          }
        },
        "recipients": {
          "toAssignees": true,
          "toAssignor": true,
          "users": [
            "067A42E1-8FD4-4ADA-A7F5-0007473469AA"
          ],
          "groups": [
            "503DFFD2-FB1F-412E-B9C5-034796E4653D"
          ]
        },
        "deliveryMethod": "InboxAndEmail",
        "comments": "Notification comment 1"
      }
    ]
  },
  "onsuccess",
  "onerror"
]
```

## Path parameters

- `taskId` string, required

## Headers

- `EnvApi-Systemid` string
- `EnvApi-Packageid` string
- `EnvApi-Udf-DateTime-Iso-In-CustomFields` string
- `EnvApi-Udf-DateTime-ReadInUserTz` string
- `EnvApi-Udf-Value-Invariant` string
- `EnvApi-Localization-All` string
- `x-client-request-id` string

## Request body

- UpdateTask
  - `taskInfo` EnvianceRestServicesVer2TasksTaskInfo
    - `id` string, guid
    - `name` string
    - `description` string
    - `createdBy` string
    - `createdOn` string, date-time
    - `dueDate` string, date-time
    - `timeZone` EnvianceRestServicesCommonTimeZoneInfo
      - `id` integer
      - `name` string
      - `stdOffset` integer
      - `dstOffset` integer
      - `currentOffset` integer
    - `templateIdOrName` string
    - `assignor` string
    - `assignees` EnvianceRestServicesCommonAssigneeV2[]
      - `userIdOrName` string
      - `groupIdOrName` string
    - `calendars` string[]
    - `objects` string[]
    - `documents` string[]
    - `schedules` EnvianceRestServicesVer2TasksSchedulesTaskScheduleInfo[]
      - `recurrenceType` 'Hourly' | 'Daily' | 'Weekly' | 'Monthly' | 'Yearly' | 'AfterLastCompletion', enum
      - `startDate` string, date-time
      - `endDate` string, date-time
      - `startTime` string
      - `endTime` string
      - `recurrenceInterval` EnvianceRestServicesVer2TasksSchedulesRecurrenceIntervalInfoExt
      - `dayOfMonth` EnvianceRestServicesVer2TasksSchedulesDayOfMonthInfoExt
      - `monthOfYear` integer
      - `TalLogicVersion` integer
    - `notifications` EnvianceRestServicesVer2TasksNotificationsTaskNotificationInfo[]
      - `conditions` EnvianceRestServicesVer2TasksNotificationsNotificationConditions
        - `immediately` boolean
        - `whenDismissed` boolean
        - `byDueDate` EnvianceRestServicesVer2TasksNotificationsDueDateCondition
          - `conditionType` 'IntervalBefore' | 'IntervalAfter' | 'PastDue', enum
          - `intervalType` 'QuarterHour' | 'Hour' | 'Day' | 'Week' | 'Month' | 'Year', enum
          - `intervalValue` integer
        - `byCompletionStatus` EnvianceRestServicesVer2TasksNotificationsCompletionStatusCondition
          - `completionPercent` integer
          - `comparisonLogic` string
          - `onlyWhenPastDue` boolean
      - `templateIdOrName` string
      - `recipients` EnvianceRestServicesVer2TasksNotificationsNotificationRecipients
        - `toAssignees` boolean
        - `toAssignor` boolean
        - `users` string[]
        - `groups` string[]
      - `deliveryMethod` 'Inbox' | 'Email' | 'InboxAndEmail', enum
      - `comments` string
    - `workflowtrigger` EnvianceRestServicesVer2TasksTriggeringTaskWorkflowInfo
      - `isautoclosetask` boolean
      - `workflows` EnvianceRestServicesVer2TasksTriggeringWorkflowTriggerInfo[]
        - `workflowtypeidorname` string, required
        - `workflowname` string
        - `isusetaskname` boolean
        - `calendars` string[]
        - `duedateflags` string[], required
        - `duedateamount` EnvianceRestServicesVer2TasksTriggeringDueDateInfo
          - `value` integer, required
          - `hours` string, required
          - `period` string, required
        - `timetocreateoptions` EnvianceRestServicesVer2TasksTriggeringTimeToCreateInfo[], required
          - `category` string, required
          - `value` EnvianceRestServicesVer2TasksTriggeringTimeToCreateValue
            - `past` boolean
            - `operation` string
            - `value` integer
            - `hours` string
            - `period` string
            - `percent` integer
            - `compare` string
        - `assignee` EnvianceRestServicesCommonAssigneeV2[]
          - `userIdOrName` string
          - `groupIdOrName` string
    - `suppressNotificationsBefore` string, date-time

## Response `default`

not available

---

[API](https://skmtc.dev/enviance/apis/restapi.md) - [All operations](https://skmtc.dev/enviance/apis/restapi/llms.txt) - [OpenAPI document](https://skmtc.dev/enviance/apis/restapi/revisions/45b2200a8cf2?raw)
