# Create Task — Salespype

> Creates a new task in Salespype. See the documentation

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

## Description

Creates a new task in Salespype. [See the documentation](https://documenter.getpostman.com/view/5101444/2s93Y3u1Eb#a9c6449a-b844-465c-a342-deea01e52c3f)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `contactId` | `string` | Yes | The unique identifier of the contact Options are loaded from the connected account. |
| `task` | `string` | Yes | The task description |
| `taskTypeId` | `string` | Yes | The unique identifier of the task type Options are loaded from the connected account. |
| `date` | `string` | Yes | The date for the task. E.g. 2021-02-20 |
| `time` | `string` | Yes | The time for the task. E.g. 34:00:34 |
| `duration` | `string` | Yes | The duration of the task. E.g. 34:00:34 |
| `note` | `string` | Yes | Additional notes for the task |

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

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: "salespype-create-task",
  arguments: {
    contactId: "Contact ID",
    task: "Task",
  },
})
```

**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: "salespype-create-task",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    salespype: { authProvisionId: "apn_xxxxxxx" },
    contactId: "Contact ID",
    task: "Task",
  },
})

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": "salespype-create-task",
    "configured_props": {
      "salespype": { "authProvisionId": "apn_xxxxxxx" },
      "contactId": "Contact ID",
      "task": "Task"
    }
  }'
```

---

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