---
title: "Create task mock"
method: POST
path: "/workflow_engine/mocks/tasks"
tags: ["Workflow Engine"]
---

# Create task mock

`POST /workflow_engine/mocks/tasks`

## Request

- Base URL: `https://example.itential.io`
- URL: `https://example.itential.io/workflow_engine/mocks/tasks`
- Auth: none declared

Creates a new task mock with the provided details.

## Request body

- WorkflowEngineTaskMockRequest
  - `name` string, required: The name of the mock task
  - `description` string: A description of the mock task
  - `serviceType` 'Application' | 'Adapter', required: Whether or not the mock is for an adapter or application service
  - `serviceName` string, required: The adapter or application service name that contains the method to mock
  - `method` string, required: The name of the method that is being mocked
  - `finishState` 'success' | 'failure' | 'error', required: The finish state of the mock
  - `delay` integer: The number of seconds to delay the completion of the mock
  - `response` union: The response for the mock that matches the return value for the task method
    - unknown[]
      - unknown
    - boolean
    - integer
    - number, double
    - object
    - string

## Response `200`

The newly created task mock object

- WorkflowEngineTaskMockResponse
  - `_id` string, uuid, required: The unique identifier for the mock task
  - `name` string, required: The name of the mock task
  - `description` string, required: A description of the mock task
  - `serviceType` 'Application' | 'Adapter', required: Whether or not the mock is for an adapter or application service
  - `serviceName` string, required: The adapter or application service name that contains the method to mock
  - `method` string, required: The name of the method that is being mocked
  - `finishState` 'success' | 'failure' | 'error', required: The finish state of the mock
  - `delay` integer, required: The number of seconds to delay the completion of the mock
  - `response` union, required: The response for the mock that matches the return value for the task method
    - unknown[]
      - unknown
    - boolean
    - integer
    - number, double
    - object
    - string
  - `created` string, date-time, required: The date and time when the mock was created
  - `createdBy` string, required: The id of user who created the mock task
  - `lastUpdated` string, date-time: The date and time when the mock was last updated
  - `lastUpdatedBy` string: The id of user who last updated the mock task

## Other responses

- `500`: Error response from API

## Changes

- **2026-10-31** `2095cc90e583`: 2 info
  - api tag `Workflow Engine` added
  - api tag `workflowEngine` removed

[Operation history](https://skmtc.dev/itential/apis/itential-2/changes/workflow_engine/mocks/tasks/post.md)

---

[API](https://skmtc.dev/itential/apis/itential-2.md) - [All operations](https://skmtc.dev/itential/apis/itential-2/llms.txt) - [OpenAPI document](https://skmtc.dev/itential/apis/itential-2/revisions/2095cc90e583?raw)
