# Create Task — DoneDone

> Create a new task in the selected project. See the documentation

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

## Description

Create a new task in the selected project. [See the documentation](https://app.swaggerhub.com/apis-docs/DoneDone/DoneDone-2-Public-API/1.0.0-oas3#/Tasks/post__account_id__internal_projects__internal_project_id__tasks)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `accountId` | `string` | Yes | The ID of an account Options are loaded from the connected account. |
| `projectId` | `string` | Yes | The ID of a project Options are loaded from the connected account. |
| `title` | `string` | Yes | The title of the task |
| `statusId` | `string` | Yes | The ID of a task status Options are loaded from the connected account. |
| `priorityId` | `string` | Yes | The ID of a task priority Options are loaded from the connected account. |
| `description` | `string` | No | The description of the task |
| `dueDate` | `string` | No | The due date of the task. Example: Oct 15, 2019 |
| `assigneeId` | `string` | No | The ID of an assignee Options are loaded from the connected account. |
| `tags` | `string[]` | No | The tags of the task Options are loaded from the connected account. |
| `watcherIds` | `string[]` | No | The IDs of the watchers of the task Options are loaded from the connected account. |
| `atMentionIds` | `string[]` | No | The IDs of the users that are mentioned in the task Options are loaded from the connected account. |
| `linkableTaskIds` | `string[]` | No | The IDs of the tasks that can be linked to the task Options are loaded from the connected account. |
| `conversationId` | `string` | No | The ID of the originating conversation Options are loaded from the connected account. |

## 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": "donedone",
      },
    },
  },
)

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: "donedone-create-task",
  arguments: {
    accountId: "Account ID",
    projectId: "Project 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: "donedone-create-task",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    donedone: { authProvisionId: "apn_xxxxxxx" },
    accountId: "Account ID",
    projectId: "Project 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": "donedone-create-task",
    "configured_props": {
      "donedone": { "authProvisionId": "apn_xxxxxxx" },
      "accountId": "Account ID",
      "projectId": "Project ID"
    }
  }'
```

---

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