# Create Task — Nifty

> Creates a new task. See the documentation

- Key: `nifty-create-task`
- Type: Action (Write)
- Version: 0.0.2
- App: Nifty (`nifty`) — https://pipedream.com/apps/nifty.md
- This page (HTML): https://pipedream.com/apps/nifty/actions/create-task
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/nifty/actions/create-task/create-task.mjs

## Description

Creates a new task. [See the documentation](https://developers.niftypm.com/operation/operation-taskapicontroller_createtask)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `projectId` | `string` | Yes | The unique identifier for the project Options are loaded from the connected account. |
| `taskGroupId` | `string` | Yes | The unique identifier of a task group Options are loaded from the connected account. |
| `name` | `string` | Yes | The name of the task |
| `description` | `string` | No | A description of the task |
| `parentTaskId` | `string` | No | Enter a parent task ID to create this task as subtask of another task Options are loaded from the connected account. |
| `milestoneId` | `string` | No | The unique identifier of a milestone Options are loaded from the connected account. |
| `dueDate` | `string` | No | Due date of the task in ISO-8601 format |
| `startDate` | `string` | No | Start date of the task in ISO-8601 format |
| `assigneeIds` | `string[]` | No | An array of assignee IDs to assign to the task Options are loaded from the connected account. |
| `labelIds` | `string[]` | No | An array of unique identifiers for the labels Options are loaded from the connected account. |
| `additionalFields` | `object` | No | Additional fields to add to the task. See the documentation |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "nifty",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "nifty-create-task",
  arguments: {
    projectId: "Project ID",
    taskGroupId: "Task Group ID",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "nifty-create-task",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    nifty: { authProvisionId: "apn_xxxxxxx" },
    projectId: "Project ID",
    taskGroupId: "Task Group ID",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "nifty-create-task",
    "configured_props": {
      "nifty": { "authProvisionId": "apn_xxxxxxx" },
      "projectId": "Project ID",
      "taskGroupId": "Task Group ID"
    }
  }'
```

---

- App: https://pipedream.com/apps/nifty.md · All apps: https://pipedream.com/apps
