{
  "openapi": "3.0.1",
  "info": {
    "title": "Workspace Task",
    "description": "Create and administer the workspace task.",
    "version": "9.1.20.0",
    "x-introduced": "9.1.0.0"
  },
  "servers": [
    {
      "url": "https://{hostname}:{port}/rest/admin/v2",
      "variables": {
        "port": {
          "default": "443",
          "enum": [
            "443",
            "8000"
          ]
        },
        "hostname": {
          "default": "localhost",
          "enum": [
            "localhost",
            "test.hcl.com"
          ]
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Workspace Task",
      "description": "Create and administer the workspace task group."
    }
  ],
  "paths": {
    "/workspace-task-groups/{taskGroupId}/tasks/{taskId}/complete": {
      "post": {
        "summary": "Complete a task. The task must be in \"TODO\" status before it can be completed.",
        "tags": [
          "Workspace Task"
        ],
        "parameters": [
          {
            "name": "taskGroupId",
            "in": "path",
            "description": "The unique numeric ID for identifying the task group.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/task[1]/taskIdentifier/externalIdentifier/taskGroupIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/task[1]/taskIdentifier/externalIdentifier/taskGroupIdentifier/uniqueID"
          },
          {
            "name": "taskId",
            "in": "path",
            "description": "The unique numeric ID for identifying the task.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/task[1]/taskIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/task[1]/taskIdentifier/uniqueID"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "Complete",
        "x-expression-template": "/Task[1]",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "processTask",
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.ProcessTaskType"
      }
    },
    "/workspace-task-groups/{taskGroupId}/tasks/{taskId}/reactivate": {
      "post": {
        "summary": "Reactivate a completed task.",
        "tags": [
          "Workspace Task"
        ],
        "parameters": [
          {
            "name": "taskGroupId",
            "in": "path",
            "description": "The unique numeric ID for identifying the task group.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/task[1]/taskIdentifier/externalIdentifier/taskGroupIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/task[1]/taskIdentifier/externalIdentifier/taskGroupIdentifier/uniqueID"
          },
          {
            "name": "taskId",
            "in": "path",
            "description": "The unique numeric ID for identifying the task.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/task[1]/taskIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/task[1]/taskIdentifier/uniqueID"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "ReturnToActive",
        "x-expression-template": "/Task[1]",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "processTask",
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.ProcessTaskType"
      }
    },
    "/workspace-task-groups/{taskGroupId}/tasks/{taskId}/reject": {
      "post": {
        "summary": "Reject a completed task.",
        "tags": [
          "Workspace Task"
        ],
        "parameters": [
          {
            "name": "taskGroupId",
            "in": "path",
            "description": "The unique numeric ID for identifying the task group.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/task[1]/taskIdentifier/externalIdentifier/taskGroupIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/task[1]/taskIdentifier/externalIdentifier/taskGroupIdentifier/uniqueID"
          },
          {
            "name": "taskId",
            "in": "path",
            "description": "The unique numeric ID for identifying the task.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/task[1]/taskIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/task[1]/taskIdentifier/uniqueID"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "Reject",
        "x-expression-template": "/Task[1]",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "processTask",
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.ProcessTaskType"
      }
    },
    "/workspace-tasks": {
      "post": {
        "summary": "Create a task.",
        "tags": [
          "Workspace Task"
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Task"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The operation is successful.",
            "headers": {
              "Location": {
                "description": "The URI of the task.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {},
            "x-entity-path": "dataArea/task[1]/taskIdentifier/uniqueID"
          }
        },
        "x-action-code": "Create",
        "x-expression-template": "/Task[1]",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "processTask",
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.ProcessTaskType",
        "x-codegen-request-body-name": "body"
      }
    },
    "/workspace-tasks/by-fields": {
      "get": {
        "summary": "Search tasks by fields: status, name, identifier and due day.",
        "tags": [
          "Workspace Task"
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "query",
            "description": "The unique identifier for identifying the task.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDueDate",
            "in": "query",
            "description": "The start date of the due that you want to search. The date must be entered as a timestamp in the following format: \"YYYY-MM-DD\".",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "The task name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "The task status. Values: \"0: inactive\", \"1: working\", \"2: completed\".",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "toDueDate",
            "in": "query",
            "description": "The end date of the due that you want to search. The date must be entered as a timestamp in the following format: \"YYYY-MM-DD\".",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "The task type. Value: 1=content contributor, 2=approver.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/maxItems"
            },
            "x-entity-path": "dataArea/get/maxItems"
          },
          {
            "name": "offset",
            "in": "query",
            "description": "The position within the resulting dataset where the query begins returning item records. If the offset is \"5\", the records that returned begin with the sixth record that matches the query parameters. If the offset is \"0\", the records that are returned begin with the first record that matches the query parameters.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/recordSetStartNumber"
            },
            "x-entity-path": "dataArea/get/recordSetStartNumber"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskCollection"
                }
              }
            },
            "x-entity-path": "dataArea/task"
          }
        },
        "x-expression-builder-class": "com.ibm.commerce.rest.admin.v2.content.util.ContentSearchExpressionBuilder",
        "x-expression-builder-method": "formatExpression",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "getTask",
        "x-parameters": {
          "accessProfile": "IBM_Admin_All",
          "template": "/Task[search(name='$name$' and identifier='$identifier$' and status = '$status$' and dueDate >= '$fromDueDate$' and dueDate <= '$toDueDate$' and type = '$type$')]"
        },
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.GetTaskType"
      }
    },
    "/workspace-tasks/by-status": {
      "get": {
        "summary": "Get tasks by task status.",
        "tags": [
          "Workspace Task"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "The task status. Values: TODO, COMPLETED, APPROVED and CANCELED.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/maxItems"
            },
            "x-entity-path": "dataArea/get/maxItems"
          },
          {
            "name": "offset",
            "in": "query",
            "description": "The position within the resulting dataset where the query begins returning item records. If the offset is \"5\", the records that returned begin with the sixth record that matches the query parameters. If the offset is \"0\", the records that are returned begin with the first record that matches the query parameters.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/recordSetStartNumber"
            },
            "x-entity-path": "dataArea/get/recordSetStartNumber"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskCollection"
                }
              }
            },
            "x-entity-path": "dataArea/task"
          }
        },
        "x-expression-template": "{_wcf.ap=IBM_Admin_Details;_wcf.maxRecords=0}/Task[@status='{status}']",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "getTask",
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.GetTaskType"
      }
    },
    "/workspace-tasks/by-task-group-id": {
      "get": {
        "summary": "Get tasks by task group IDs.",
        "tags": [
          "Workspace Task"
        ],
        "parameters": [
          {
            "name": "taskGroupId",
            "in": "query",
            "description": "The unique numeric ID for identifying the task.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/maxItems"
            },
            "x-entity-path": "dataArea/get/maxItems"
          },
          {
            "name": "offset",
            "in": "query",
            "description": "The position within the resulting dataset where the query begins returning item records. If the offset is \"5\", the records that returned begin with the sixth record that matches the query parameters. If the offset is \"0\", the records that are returned begin with the first record that matches the query parameters.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/recordSetStartNumber"
            },
            "x-entity-path": "dataArea/get/recordSetStartNumber"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskCollection"
                }
              }
            },
            "x-entity-path": "dataArea/task"
          }
        },
        "x-expression-template": "{_wcf.ap=IBM_Admin_Details}/Task[TaskIdentifier[ExternalIdentifier[TaskGroupIdentifier[(UniqueID='{taskGroupId}')]]]]",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "getTask",
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.GetTaskType"
      }
    },
    "/workspace-tasks/by-type-identifier-or-name": {
      "get": {
        "summary": "Search tasks by basic search term: type, name or identifier.",
        "tags": [
          "Workspace Task"
        ],
        "parameters": [
          {
            "name": "searchText",
            "in": "query",
            "description": "The task name or task identifier.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "The type of task, 1: content contributor, 2: approver.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/maxItems"
            },
            "x-entity-path": "dataArea/get/maxItems"
          },
          {
            "name": "offset",
            "in": "query",
            "description": "The position within the resulting dataset where the query begins returning item records. If the offset is \"5\", the records that returned begin with the sixth record that matches the query parameters. If the offset is \"0\", the records that are returned begin with the first record that matches the query parameters.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/recordSetStartNumber"
            },
            "x-entity-path": "dataArea/get/recordSetStartNumber"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskCollection"
                }
              }
            },
            "x-entity-path": "dataArea/task"
          }
        },
        "x-expression-builder-class": "com.ibm.commerce.rest.bod.util.AdvancedSearchExpressionBuilder",
        "x-expression-builder-method": "formatExpression",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "getTask",
        "x-parameters": {
          "accessProfile": "IBM_Admin_All",
          "template": "/Task[search(name='$searchText$' and identifier='$searchText$' and type = '$type$' and searchType = 'task-basic')]"
        },
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.GetTaskType"
      }
    },
    "/workspace-tasks/{id}": {
      "get": {
        "summary": "Get task details by task ID.",
        "tags": [
          "Workspace Task"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the task.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            },
            "x-entity-path": "dataArea/task[1]"
          }
        },
        "x-expression-template": "{_wcf.ap=IBM_Admin_Details}/Task/TaskIdentifier[UniqueID='{id}']",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "getTask",
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.GetTaskType"
      },
      "delete": {
        "summary": "Delete a task.",
        "tags": [
          "Workspace Task"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the task.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/task[1]/taskIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/task[1]/taskIdentifier/uniqueID"
          }
        ],
        "responses": {
          "204": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "Delete",
        "x-expression-template": "/Task[1]",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "processTask",
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.ProcessTaskType"
      },
      "patch": {
        "summary": "Update a task.",
        "tags": [
          "Workspace Task"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the task.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/task[1]/taskIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/task[1]/taskIdentifier/uniqueID"
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Task"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "Change",
        "x-expression-template": "/Task[1]",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "changeTask",
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.ChangeTaskType",
        "x-codegen-request-body-name": "body"
      }
    }
  },
  "components": {
    "schemas": {
      "Task": {
        "type": "object",
        "properties": {
          "approvedDateTime": {
            "type": "string",
            "description": "The date and time when the task was approved. The date must be entered as a timestamp in the following ISO8601 format: \"YYYY-MM-DDThh:mm:ssZ\".",
            "format": "date-time",
            "x-entity-path": "approvalDate"
          },
          "completedDateTime": {
            "type": "string",
            "description": "The date and time when the task was completed. The date must be entered as a timestamp in the following ISO8601 format: \"YYYY-MM-DDThh:mm:ssZ\".",
            "format": "date-time",
            "x-entity-path": "completionDate"
          },
          "description": {
            "type": "string",
            "description": "The task description.",
            "x-entity-path": "taskDescription/description"
          },
          "dueDateTime": {
            "type": "string",
            "description": "The date and time when the task is due. The date must be entered as a timestamp in the following ISO8601 format: \"YYYY-MM-DDThh:mm:ssZ\".",
            "format": "date-time",
            "x-entity-path": "dueDate"
          },
          "id": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the task.",
            "format": "int64",
            "readOnly": true,
            "x-entity-path": "taskIdentifier/uniqueID"
          },
          "identifier": {
            "type": "string",
            "description": "The unique identifier for identifying the task.",
            "readOnly": true,
            "x-entity-path": "taskIdentifier/externalIdentifier/identifier"
          },
          "name": {
            "type": "string",
            "description": "The task name.",
            "x-entity-path": "taskDescription/name"
          },
          "status": {
            "type": "string",
            "description": "The task status. Values: INACTIVE, TODO, COMPLETE.",
            "readOnly": true
          },
          "taskGroupId": {
            "type": "integer",
            "description": "The unique identifier for identifying the task group.",
            "format": "int64",
            "x-entity-path": "taskIdentifier/externalIdentifier/taskGroupIdentifier/uniqueID"
          },
          "taskMemberId": {
            "type": "integer",
            "description": "The member id of the task.",
            "format": "int64",
            "x-entity-path": "taskMembers/taskMember[1]/member/uniqueID"
          },
          "usage": {
            "type": "string",
            "description": "The task usage.",
            "readOnly": true
          }
        },
        "description": "A task.",
        "x-entity-class": "com.ibm.commerce.content.facade.datatypes.TaskType"
      },
      "TaskCollection": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Task"
            }
          }
        },
        "description": "A collection of tasks."
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ],
  "x-components": {}
}
