# Create Task — Microsoft 365 Planner

> Create a new task in Microsoft 365 Planner. See the documentation

- Key: `microsoft_365_planner-create-task`
- Type: Action (Write)
- Version: 0.0.5
- App: Microsoft 365 Planner (`microsoft_365_planner`) — https://pipedream.com/apps/microsoft-365-planner.md
- This page (HTML): https://pipedream.com/apps/microsoft-365-planner/actions/create-task
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/microsoft_365_planner/actions/create-task/create-task.mjs

## Description

Create a new task in Microsoft 365 Planner. [See the documentation](https://learn.microsoft.com/en-us/graph/api/planner-post-tasks)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `groupId` | `string` | Yes | The group container of the plan Options are loaded from the connected account. |
| `planId` | `string` | Yes | Identifier of a plan Options are loaded from the connected account. |
| `title` | `string` | Yes | The title of the task |
| `dueDateTime` | `string` | No | Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z |
| `bucketId` | `string` | No | Identifier of a bucket Options are loaded from the connected account. |
| `assigneeIds` | `string[]` | No | Array of assignee Ids 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": "microsoft_365_planner",
      },
    },
  },
)

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: "microsoft_365_planner-create-task",
  arguments: {
    groupId: "Group",
    planId: "Plan",
  },
})
```

**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: "microsoft_365_planner-create-task",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    microsoft_365_planner: { authProvisionId: "apn_xxxxxxx" },
    groupId: "Group",
    planId: "Plan",
  },
})

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": "microsoft_365_planner-create-task",
    "configured_props": {
      "microsoft_365_planner": { "authProvisionId": "apn_xxxxxxx" },
      "groupId": "Group",
      "planId": "Plan"
    }
  }'
```

---

- App: https://pipedream.com/apps/microsoft-365-planner.md · All apps: https://pipedream.com/apps
