# Create Note — Cloze

> Creates a note in Cloze. See the documentation.

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

## Description

Creates a note in Cloze. [See the documentation](https://api.cloze.com/api-docs/#!/Content/post_v1_createcontent).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `uniqueId` | `string` | Yes | A unique identifier for this content record. This will often be the unique Id in an external system so that updates can be matched up with the record in Cloze. |
| `source` | `string` | Yes | The source that this content record originally came from (Eg. todoist.com). Must be a valid domain. |
| `date` | `string` | No | When the content should show up in the timeline. Can be a string or a UTC timestamp in ms since the epoch. Eg. 2021-01-01 or 1609459200000. |
| `from` | `string` | No | From address for this content record (the address of the person created the record). This can be an email address, phone number, social handle or app link (Eg. na16.salesforce.com:006j000000Pkp1d) |
| `subject` | `string` | No | Subject of the communication record. |
| `body` | `string` | Yes | Body text of the communication record. |
| `additionalData` | `object` | No | Additional details for the note in JSON format. 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": "cloze",
      },
    },
  },
)

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: "cloze-create-note",
  arguments: {
    uniqueId: "Unique ID",
    source: "Source",
  },
})
```

**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: "cloze-create-note",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    cloze: { authProvisionId: "apn_xxxxxxx" },
    uniqueId: "Unique ID",
    source: "Source",
  },
})

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": "cloze-create-note",
    "configured_props": {
      "cloze": { "authProvisionId": "apn_xxxxxxx" },
      "uniqueId": "Unique ID",
      "source": "Source"
    }
  }'
```

---

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