---
title: "Add Subtask to Request using Subtask Template"
method: POST
path: "/api/datasubject/v2/requestqueues/{requestQueueRefId}/subtasks/template"
tags: ["Subtasks"]
---

# Add Subtask to Request using Subtask Template

`POST /api/datasubject/v2/requestqueues/{requestQueueRefId}/subtasks/template`

## Request

- Base URL: `https://hostname`
- URL: `https://hostname/api/datasubject/v2/requestqueues/{requestQueueRefId}/subtasks/template`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://{hostname}/api/access/v1/oauth/token` scopes: `DSAR`, `DSAR_WRITE`

Use this API to add a subtask to a request using a subtask template. The subtask template name must be provided to create the subtask with the template's configuration.

## Path parameters

- `requestQueueRefId` string, required: Request queue reference Id

## Request body

- PrivacyAutomationDataSubjectRequestDSRAutomationSubTaskFromTemplateV2Dto
  - `templateName` string: Name of the subtask template to use.
  - `workflowDetailId` string, uuid: Workflow detail ID

## Response `201`

Created

- PrivacyAutomationDataSubjectRequestDSRAutomationSubTaskV2Dto
  - `subTaskId` string, uuid: The subtask unique ID
  - `requestQueueRefId` string: The request reference ID
  - `taskName` string: Name of the task
  - `status` 'OPEN' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED' | 'READY_FOR_REVIEW' | 'PROCESSING' | 'NOT_RUN': Current status of the subtask
  - `type` 'USER_TASK' | 'SYSTEM_TASK': Type of the subtask
  - `deadline` string, date-time: Deadline for the subtask
  - `reminder` string, date-time: Reminder date for the subtask
  - `assignee` string: Person assigned to the subtask
  - `workflowDetailId` string, uuid: Workflow detail ID
  - `workflowStatus` integer: Workflow status code
  - `description` string: Description of the subtask
  - `required` boolean: Whether the subtask is required
  - `integrationSystemId` string, uuid: Integration system ID
  - `integrationWorkflowId` string, uuid: Integration workflow ID
  - `manualRun` boolean
  - `commentRequired` boolean
  - `resolutionRequired` boolean

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `429`: Too Many Requests. For more information, see [API Rate Limits](https://developer.onetrust.com/onetrust/reference/rate-limits-overview).
- `500`: Internal Server Error

---

[API](https://skmtc.dev/onetrust/apis/privacy-automation-data-subject-request-dsr-automation.md) - [All operations](https://skmtc.dev/onetrust/apis/privacy-automation-data-subject-request-dsr-automation/llms.txt) - [OpenAPI document](https://skmtc.dev/onetrust/apis/privacy-automation-data-subject-request-dsr-automation/revisions/612f0b39b904?raw)
