---
title: POST /work-requests/{id}/tasks
slug: content-marketing-platform/api/post-work-requestsidtasks
docTags: 
createdAt: 2026-10-01T18:51:26.265Z
---

{
  "id": "8pCltD1z_t01YzeBfQd3q",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.cmp.optimizely.com/v3/work-requests/{id}/tasks",
    "servers": [
      {
        "url": "https://api.cmp.optimizely.com/v3/work-requests/{id}/tasks",
        "description": "v3 version of Optimizely CMP Open API"
      }
    ],
    "name": "POST /work-requests/{id}/tasks",
    "description": "<p>Experimental Create a new task from a work request.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "example": "da80cfd7bbf84959a8a981acbad996b3",
          "description": "Unique identifier of the work request"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Payload to create a task",
          "customType": "WorkRequestTaskRequest",
          "schema": [
            {
              "name": "title",
              "kind": "optional",
              "type": "string",
              "description": "Title of the task. If not provided. it will be populated by the work request title.",
              "example": "The awesome task"
            },
            {
              "name": "start_at",
              "kind": "optional",
              "type": "string<date-time>",
              "nullable": true,
              "description": "<p>Start date and time of the task, in ISO 8601 UTC format (2020-02-10T10:40</p><div></div>). If <code>workflow_id</code> is present and the workflow has step duration, then either <code>start_at</code> or <code>due_at</code> is required. If both <code>start_at</code> and <code>due_at</code> is provided with a <code>workflow_id</code> that has step duration, then the <code>start_at</code> field will be ignored.<p></p>",
              "example": "2022-12-01T06:00:00Z",
              "format": "date-time"
            },
            {
              "name": "due_at",
              "kind": "optional",
              "type": "string<date-time>",
              "nullable": true,
              "description": "<p>Due date and time of the task, in ISO 8601 UTC format (2020-02-10T10:40</p><div></div>). The <code>due_at</code> field is required if <code>workflow_id</code> is present and the workflow does not have step duration. If <code>workflow_id</code> is present and the workflow has step duration, then either <code>start_at</code> or <code>due_at</code> is required.<p></p>",
              "example": "2022-12-31T06:00:00Z",
              "format": "date-time"
            },
            {
              "name": "campaign_id",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "Unique identifier of parent campaign",
              "example": "8q7f910551b00a722e0418830cee6612"
            },
            {
              "name": "workflow_id",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "Unique identifier of workflow",
              "example": "8q7f910551b00a722e0418830cee6612"
            },
            {
              "name": "owner_id",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "<p>Unique identifier of the task owner. If passed as null, then the owner will be the token user.</p>",
              "example": "8q7f910551b00a722e0418830cee6612"
            },
            {
              "name": "asset_ids_without_field_inheritance",
              "kind": "optional",
              "type": "array",
              "description": "List of asset ids which will not inherit any fields.",
              "example": "[\"74f12a064b1611eda2fe02420ac8001d\"]",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "inherit_fields_from",
              "kind": "optional",
              "type": "string",
              "description": "<p>Specifies the source from which to inherit fields.</p>\n<p>Supported values:</p>\n<ul>\n<li><code>work_request</code> (default) : Fields are created from the work request</li>\n<li><code>workflow</code> : Fields are inherited from the workflow specified by <code>workflow_id</code></li>\n</ul>",
              "example": "work_request",
              "default": "work_request"
            },
            {
              "name": "exclude_empty_fields",
              "kind": "optional",
              "type": "boolean",
              "description": "<p>If <code>true</code>, work request custom fields and labels that have no value (for example, fields hidden by form logic) are not copied to the task. When <code>inherit_fields_from</code> is <code>workflow</code>, an empty work request value falls back to the workflow field's default value instead. Set to <code>false</code> to copy every work request field, including empty ones.</p>",
              "example": true,
              "default": true
            }
          ],
          "modelRef": "#/components/schemas/WorkRequestTaskRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "OAuth2",
          "name": "OAuth2",
          "kind": "optional",
          "type": "oauth2",
          "oauth2Flows": {
            "clientCredentials": {
              "tokenUrl": "https://accounts.cmp.optimizely.com/o/oauth2/v1/token",
              "scopes": {}
            },
            "authorizationCode": {
              "authorizationUrl": "https://accounts.cmp.optimizely.com/o/oauth2/v1/auth",
              "tokenUrl": "https://accounts.cmp.optimizely.com/o/oauth2/v1/token",
              "scopes": {
                "openid": "Grants the ability to receive a unique identifier for the user.",
                "profile": "Grants access to user profile information.",
                "offline_access": "Grants the ability to refresh access_token using the refresh token even when user is not present (not logged in)."
              }
            }
          },
          "requiredScopes": [
            "openid",
            "profile",
            "offline_access"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "Created a task from a work request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "WorkRequestTaskResponse",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier of the task",
                "example": "8q7f910551b00a722e0418830cee6612"
              },
              {
                "name": "title",
                "kind": "required",
                "type": "string",
                "description": "Title of the task",
                "example": "The awesome task"
              },
              {
                "name": "reference_id",
                "kind": "optional",
                "type": "string",
                "description": "Reference Id of the task",
                "example": "TSK-1111"
              },
              {
                "name": "start_at",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": true,
                "description": "<p>Start date of the task, in ISO 8601 UTC format (2022-12-01T06:00</p><div></div>)<p></p>",
                "example": "2022-12-01T06:00:00Z",
                "format": "date-time"
              },
              {
                "name": "due_at",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": true,
                "description": "<p>Due date of the task, in ISO 8601 UTC format (2022-12-31T06:00</p><div></div>)<p></p>",
                "example": "2022-12-31T06:00:00Z",
                "format": "date-time"
              },
              {
                "name": "owner_id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier of the owner",
                "example": "8q7f910551b00a722e0418830cee6612"
              },
              {
                "name": "links",
                "kind": "required",
                "type": "object",
                "description": "Meta links",
                "example": "",
                "schema": [
                  {
                    "name": "self",
                    "kind": "required",
                    "type": "string",
                    "description": "URL of the task",
                    "example": "https://api.cmp.optimizely.com/v3/tasks/8q7f910551b00a722e0418830cee6612"
                  },
                  {
                    "name": "owner",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "URL of the task owner",
                    "example": "https://api.cmp.optimizely.com/v3/users/8q7f910551b00a722e0418830cee6612"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/WorkRequestTaskResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Client error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"Unsupported arguments: a,b,c\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Authorization error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"Unauthorized\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "Permission error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"You do not have the permission to perform this operation\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Not found error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"Resource not found\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "422",
        "description": "Unprocessable entity error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"Resource cannot be processed\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "m6qUIJIRvRoPDhWxVrpoW",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.cmp.optimizely.com/v3/work-requests/{id}/tasks \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"inherit_fields_from\": \"work_request\",\n     \"exclude_empty_fields\": true\n     }'"
        },
        {
          "id": "IKODWqbCseCDNECMhT9Oi",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"inherit_fields_from\": \"work_request\",\n   \"exclude_empty_fields\": true\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.cmp.optimizely.com/v3/work-requests/{id}/tasks\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "mVTptl6R7NoabcCsVW0PC",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.cmp.optimizely.com/v3/work-requests/{id}/tasks\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"inherit_fields_from\": \"work_request\",\n   \"exclude_empty_fields\": true\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "RSqnL45dnnM3J-DVkBu-N",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.cmp.optimizely.com/v3/work-requests/{id}/tasks\"\n\npayload = json.dumps({\n   \"inherit_fields_from\": \"work_request\",\n   \"exclude_empty_fields\": True\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "m6qUIJIRvRoPDhWxVrpoW"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "// Created a task from a work request\n{\n  \"id\": \"8q7f910551b00a722e0418830cee6612\",\n  \"title\": \"The awesome task\",\n  \"reference_id\": \"TSK-1111\",\n  \"start_at\": \"2022-12-01T06:00:00Z\",\n  \"due_at\": \"2022-12-31T06:00:00Z\",\n  \"owner_id\": \"8q7f910551b00a722e0418830cee6612\",\n  \"links\": {\n    \"self\": \"https://api.cmp.optimizely.com/v3/tasks/8q7f910551b00a722e0418830cee6612\",\n    \"owner\": \"https://api.cmp.optimizely.com/v3/users/8q7f910551b00a722e0418830cee6612\"\n  }\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Client error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Authorization error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// Permission error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "response-4-404",
          "language": "404",
          "code": "// Not found error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "response-5-422",
          "language": "422",
          "code": "// Unprocessable entity error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-201"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}