# UserTasks

User tasks are used to create tasks for users in the system.

## GET /v1/usertasks

> Get all user tasks in the system

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserTasks","description":"User tasks are used to create tasks for users in the system."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}}},"paths":{"/v1/usertasks":{"get":{"tags":["UserTasks"],"summary":"Get all user tasks in the system","parameters":[{"name":"page","in":"query","schema":{"type":"integer","format":"int32","default":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"integer","format":"int32"}}}}}}}}}
```

## POST /v1/usertasks

> Create a user task

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserTasks","description":"User tasks are used to create tasks for users in the system."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.UserTask.CreateUserTaskModel":{"type":"object","properties":{"Uid":{"type":"string","description":"Unique id of user task","format":"uuid","nullable":true},"AssignedUserGroups":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Ids of user groups to which the task is assigned","nullable":true},"AssignedUsers":{"type":"array","items":{"type":"string"},"description":"Ids of specific users to which the task is assigned","nullable":true},"Title":{"type":"string","description":"Title for the task","nullable":true},"Description":{"type":"string","description":"Description of the task","nullable":true},"Deadline":{"type":"string","description":"Deadline for the task, if any","format":"date-time","nullable":true},"AttachedEntities":{"type":"array","items":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskEntityModel"},"description":"Entities in the system attached to this task","nullable":true}},"additionalProperties":false,"description":"Model used to create a new user task"},"Struct.App.Api.Models.UserTask.UserTaskEntityModel":{"type":"object","properties":{"EntityType":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskEntityType"},"EntityId":{"type":"string","description":"Id of entity, represented as string to support non-integer ids in the future","nullable":true}},"additionalProperties":false,"description":"Represents an attached entity when creating or updating a user task"},"Struct.App.Api.Models.UserTask.UserTaskEntityType":{"enum":[0,1,2,3,4,5],"type":"integer","description":"Represents a type of an entity attached to a user task \n\n- `0` = **Category**: Category entity\n- `1` = **Product**: Product entity\n- `2` = **Variant**: Variant entity\n- `3` = **VariantGroup**: Variant groups entity\n- `4` = **Asset**: Asset entity\n- `5` = **GlobalListValue**: Global list value entity","format":"int32"},"Microsoft.AspNetCore.Mvc.ProblemDetails":{"type":"object","properties":{"Type":{"type":"string","nullable":true},"Title":{"type":"string","nullable":true},"Status":{"type":"integer","format":"int32","nullable":true},"Detail":{"type":"string","nullable":true},"Instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/v1/usertasks":{"post":{"tags":["UserTasks"],"summary":"Create a user task","requestBody":{"description":"User task to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.CreateUserTaskModel"}}}},"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## PUT /v1/usertasks

> Update a user task

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserTasks","description":"User tasks are used to create tasks for users in the system."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.UserTask.UpdateUserTaskModel":{"type":"object","properties":{"Uid":{"type":"string","description":"Unique id of the task","format":"uuid","nullable":true},"Deadline":{"type":"string","description":"Deadline for the task, if any","format":"date-time","nullable":true},"Title":{"type":"string","description":"Title for the task","nullable":true},"Description":{"type":"string","description":"Description of the task","nullable":true},"Status":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskStatus"},"AssignedUsers":{"type":"array","items":{"type":"string"},"description":"Ids of specific users to which the task is assigned","nullable":true},"AssignedUserGroups":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Ids of user groups to which the task is assigned","nullable":true},"AttachedEntities":{"type":"array","items":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskEntityModel"},"description":"Entities in the system attached to this task","nullable":true}},"additionalProperties":false,"description":"A task assigned to one or more users in the system"},"Struct.App.Api.Models.UserTask.UserTaskStatus":{"enum":[0,1,2,3,4],"type":"integer","description":"Represents a status of a user task \n\n- `0` = **New**: A new task that is not yet been processed\n- `1` = **ReOpened**: An otherwise completed task that has been re-opened\n- `2` = **InProgress**: A task that is currently being worked on\n- `3` = **AwaitingFeedback**: Task is awaiting feedback from someone\n- `4` = **Completed**: Task is completed","format":"int32"},"Struct.App.Api.Models.UserTask.UserTaskEntityModel":{"type":"object","properties":{"EntityType":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskEntityType"},"EntityId":{"type":"string","description":"Id of entity, represented as string to support non-integer ids in the future","nullable":true}},"additionalProperties":false,"description":"Represents an attached entity when creating or updating a user task"},"Struct.App.Api.Models.UserTask.UserTaskEntityType":{"enum":[0,1,2,3,4,5],"type":"integer","description":"Represents a type of an entity attached to a user task \n\n- `0` = **Category**: Category entity\n- `1` = **Product**: Product entity\n- `2` = **Variant**: Variant entity\n- `3` = **VariantGroup**: Variant groups entity\n- `4` = **Asset**: Asset entity\n- `5` = **GlobalListValue**: Global list value entity","format":"int32"},"Microsoft.AspNetCore.Mvc.ProblemDetails":{"type":"object","properties":{"Type":{"type":"string","nullable":true},"Title":{"type":"string","nullable":true},"Status":{"type":"integer","format":"int32","nullable":true},"Detail":{"type":"string","nullable":true},"Instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/v1/usertasks":{"put":{"tags":["UserTasks"],"summary":"Update a user task","requestBody":{"description":"User task to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UpdateUserTaskModel"}}}},"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## POST /v1/usertasks/batch

> Get a batch of user tasks by uids

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserTasks","description":"User tasks are used to create tasks for users in the system."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.UserTask.UserTask":{"type":"object","properties":{"Uid":{"type":"string","description":"Unique id of the task","format":"uuid"},"Created":{"type":"string","description":"Timestamp at which the task was created","format":"date-time"},"CreatedBy":{"type":"string","description":"Id of the user who created the task","nullable":true},"Deadline":{"type":"string","description":"Deadline for the task, if any","format":"date-time","nullable":true},"Title":{"type":"string","description":"Title for the task","nullable":true},"Description":{"type":"string","description":"Description of the task","nullable":true},"Status":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskStatus"},"AssignedUsers":{"type":"array","items":{"type":"string"},"description":"Ids of specific users to which the task is assigned","nullable":true},"AssignedUserGroups":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Ids of user groups to which the task is assigned","nullable":true},"Comments":{"type":"array","items":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskComment"},"description":"List of comments made by users to the task","nullable":true},"AttachedEntities":{"type":"array","items":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskEntity"},"description":"Entities in the system attached to this task","nullable":true}},"additionalProperties":false,"description":"A task assigned to one or more users in the system"},"Struct.App.Api.Models.UserTask.UserTaskStatus":{"enum":[0,1,2,3,4],"type":"integer","description":"Represents a status of a user task \n\n- `0` = **New**: A new task that is not yet been processed\n- `1` = **ReOpened**: An otherwise completed task that has been re-opened\n- `2` = **InProgress**: A task that is currently being worked on\n- `3` = **AwaitingFeedback**: Task is awaiting feedback from someone\n- `4` = **Completed**: Task is completed","format":"int32"},"Struct.App.Api.Models.UserTask.UserTaskComment":{"type":"object","properties":{"Uid":{"type":"string","description":"Unique id of the comment","format":"uuid","nullable":true},"Comment":{"type":"string","description":"The actual comment","nullable":true},"UserId":{"type":"string","description":"Id of the user who created the comment","nullable":true},"Name":{"type":"string","description":"Name of the user who created the comment","nullable":true},"Created":{"type":"string","description":"Timestamp of when the comment was created","format":"date-time"},"LastModified":{"type":"string","description":"Timestamp for the last modification of the comment","format":"date-time","nullable":true},"IsSystemGenerated":{"type":"boolean","description":"Indicates whether the comment was generated automatically by the system"}},"additionalProperties":false,"description":"Represents a comment made to a user task"},"Struct.App.Api.Models.UserTask.UserTaskEntity":{"type":"object","properties":{"EntityType":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskEntityType"},"EntityId":{"type":"string","description":"Id of entity, represented as string to support non-integer ids in the future","nullable":true},"Status":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskEntityStatus"}},"additionalProperties":false,"description":"Represents an attached entity to a user task"},"Struct.App.Api.Models.UserTask.UserTaskEntityType":{"enum":[0,1,2,3,4,5],"type":"integer","description":"Represents a type of an entity attached to a user task \n\n- `0` = **Category**: Category entity\n- `1` = **Product**: Product entity\n- `2` = **Variant**: Variant entity\n- `3` = **VariantGroup**: Variant groups entity\n- `4` = **Asset**: Asset entity\n- `5` = **GlobalListValue**: Global list value entity","format":"int32"},"Struct.App.Api.Models.UserTask.UserTaskEntityStatus":{"enum":[0,1],"type":"integer","description":"Represents a status of an attached entity on a user task \n\n- `0` = **Unhandled**: The entity attached to the task has not yet been handled\n- `1` = **Handled**: The entity attached to the task has been handled","format":"int32"}}},"paths":{"/v1/usertasks/batch":{"post":{"tags":["UserTasks"],"summary":"Get a batch of user tasks by uids","requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"type":"string","format":"uuid"}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTask"}}}}}}}}}}
```

## GET /v1/usertasks/{uid}

> Get a user task from its uid

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserTasks","description":"User tasks are used to create tasks for users in the system."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.UserTask.UserTask":{"type":"object","properties":{"Uid":{"type":"string","description":"Unique id of the task","format":"uuid"},"Created":{"type":"string","description":"Timestamp at which the task was created","format":"date-time"},"CreatedBy":{"type":"string","description":"Id of the user who created the task","nullable":true},"Deadline":{"type":"string","description":"Deadline for the task, if any","format":"date-time","nullable":true},"Title":{"type":"string","description":"Title for the task","nullable":true},"Description":{"type":"string","description":"Description of the task","nullable":true},"Status":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskStatus"},"AssignedUsers":{"type":"array","items":{"type":"string"},"description":"Ids of specific users to which the task is assigned","nullable":true},"AssignedUserGroups":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Ids of user groups to which the task is assigned","nullable":true},"Comments":{"type":"array","items":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskComment"},"description":"List of comments made by users to the task","nullable":true},"AttachedEntities":{"type":"array","items":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskEntity"},"description":"Entities in the system attached to this task","nullable":true}},"additionalProperties":false,"description":"A task assigned to one or more users in the system"},"Struct.App.Api.Models.UserTask.UserTaskStatus":{"enum":[0,1,2,3,4],"type":"integer","description":"Represents a status of a user task \n\n- `0` = **New**: A new task that is not yet been processed\n- `1` = **ReOpened**: An otherwise completed task that has been re-opened\n- `2` = **InProgress**: A task that is currently being worked on\n- `3` = **AwaitingFeedback**: Task is awaiting feedback from someone\n- `4` = **Completed**: Task is completed","format":"int32"},"Struct.App.Api.Models.UserTask.UserTaskComment":{"type":"object","properties":{"Uid":{"type":"string","description":"Unique id of the comment","format":"uuid","nullable":true},"Comment":{"type":"string","description":"The actual comment","nullable":true},"UserId":{"type":"string","description":"Id of the user who created the comment","nullable":true},"Name":{"type":"string","description":"Name of the user who created the comment","nullable":true},"Created":{"type":"string","description":"Timestamp of when the comment was created","format":"date-time"},"LastModified":{"type":"string","description":"Timestamp for the last modification of the comment","format":"date-time","nullable":true},"IsSystemGenerated":{"type":"boolean","description":"Indicates whether the comment was generated automatically by the system"}},"additionalProperties":false,"description":"Represents a comment made to a user task"},"Struct.App.Api.Models.UserTask.UserTaskEntity":{"type":"object","properties":{"EntityType":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskEntityType"},"EntityId":{"type":"string","description":"Id of entity, represented as string to support non-integer ids in the future","nullable":true},"Status":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTaskEntityStatus"}},"additionalProperties":false,"description":"Represents an attached entity to a user task"},"Struct.App.Api.Models.UserTask.UserTaskEntityType":{"enum":[0,1,2,3,4,5],"type":"integer","description":"Represents a type of an entity attached to a user task \n\n- `0` = **Category**: Category entity\n- `1` = **Product**: Product entity\n- `2` = **Variant**: Variant entity\n- `3` = **VariantGroup**: Variant groups entity\n- `4` = **Asset**: Asset entity\n- `5` = **GlobalListValue**: Global list value entity","format":"int32"},"Struct.App.Api.Models.UserTask.UserTaskEntityStatus":{"enum":[0,1],"type":"integer","description":"Represents a status of an attached entity on a user task \n\n- `0` = **Unhandled**: The entity attached to the task has not yet been handled\n- `1` = **Handled**: The entity attached to the task has been handled","format":"int32"}}},"paths":{"/v1/usertasks/{uid}":{"get":{"tags":["UserTasks"],"summary":"Get a user task from its uid","parameters":[{"name":"uid","in":"path","description":"Unique id of user task to get","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UserTask"}}}}}}}}}
```

## DELETE /v1/usertasks/{uid}

> Delete a user task

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserTasks","description":"User tasks are used to create tasks for users in the system."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Microsoft.AspNetCore.Mvc.ProblemDetails":{"type":"object","properties":{"Type":{"type":"string","nullable":true},"Title":{"type":"string","nullable":true},"Status":{"type":"integer","format":"int32","nullable":true},"Detail":{"type":"string","nullable":true},"Instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/v1/usertasks/{uid}":{"delete":{"tags":["UserTasks"],"summary":"Delete a user task","parameters":[{"name":"uid","in":"path","description":"Unique id of user task to delete","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## POST /v1/usertasks/{uid}/comments

> Create a comment on a user task

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserTasks","description":"User tasks are used to create tasks for users in the system."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.UserTask.CreateUserTaskCommentModel":{"type":"object","properties":{"Uid":{"type":"string","description":"Unique id of comment","format":"uuid","nullable":true},"Comment":{"type":"string","description":"Comment itself","nullable":true}},"additionalProperties":false,"description":"Model used to create comment on a user task"},"Microsoft.AspNetCore.Mvc.ProblemDetails":{"type":"object","properties":{"Type":{"type":"string","nullable":true},"Title":{"type":"string","nullable":true},"Status":{"type":"integer","format":"int32","nullable":true},"Detail":{"type":"string","nullable":true},"Instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/v1/usertasks/{uid}/comments":{"post":{"tags":["UserTasks"],"summary":"Create a comment on a user task","parameters":[{"name":"uid","in":"path","description":"Uid of user task","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"Comment to add to user task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.CreateUserTaskCommentModel"}}}},"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## PUT /v1/usertasks/{uid}/comments

> Update a comment on a user task

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserTasks","description":"User tasks are used to create tasks for users in the system."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Struct.App.Api.Models.UserTask.UpdateUserTaskCommentModel":{"type":"object","properties":{"Uid":{"type":"string","format":"uuid"},"Comment":{"type":"string","nullable":true}},"additionalProperties":false},"Microsoft.AspNetCore.Mvc.ProblemDetails":{"type":"object","properties":{"Type":{"type":"string","nullable":true},"Title":{"type":"string","nullable":true},"Status":{"type":"integer","format":"int32","nullable":true},"Detail":{"type":"string","nullable":true},"Instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/v1/usertasks/{uid}/comments":{"put":{"tags":["UserTasks"],"summary":"Update a comment on a user task","parameters":[{"name":"uid","in":"path","description":"Uid of user task","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"Comment to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Struct.App.Api.Models.UserTask.UpdateUserTaskCommentModel"}}}},"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```

## DELETE /v1/usertasks/{uid}/comments

> Delete a user task

```json
{"openapi":"3.0.1","info":{"title":"Struct PIM Public API","version":"1.0"},"tags":[{"name":"UserTasks","description":"User tasks are used to create tasks for users in the system."}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"","name":"Authorization","in":"header"}},"schemas":{"Microsoft.AspNetCore.Mvc.ProblemDetails":{"type":"object","properties":{"Type":{"type":"string","nullable":true},"Title":{"type":"string","nullable":true},"Status":{"type":"integer","format":"int32","nullable":true},"Detail":{"type":"string","nullable":true},"Instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/v1/usertasks/{uid}/comments":{"delete":{"tags":["UserTasks"],"summary":"Delete a user task","parameters":[{"name":"uid","in":"path","description":"Uid of user task","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"commentUid","in":"query","description":"Unique id of comment to delete","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"}}}}}}}}}
```
