# Create Note — Vitally

> Create a new note. See the documentation

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

## Description

Create a new note. [See the documentation](https://docs.vitally.io/pushing-data-to-vitally/rest-api/notes#create-a-note-post)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `accountId` | `string` | Yes | The ID of the Vitally Account to associate the Note with. Not to be confused with an External ID, this is the Vitally Account ID. Options are loaded from the connected account. |
| `organizationId` | `string` | Yes | The Vitally assigned ID of the Organization. Options are loaded from the connected account. |
| `note` | `string` | Yes | The body of the note, may include HTML. |
| `noteDate` | `string` | Yes | The timestamp of when the Note was created. Format: YYYY-MM-DDTHH:MM:mm:ss.SSSZ. |
| `externalId` | `string` | No | The unique ID of the Note in your system. |
| `subject` | `string` | No | The subject or title of the Note. |
| `authorId` | `string` | No | The ID of the Vitally User who created the Note. Options are loaded from the connected account. |
| `categoryId` | `string` | No | The ID of the Vitally Note Category the Note belongs to. Options are loaded from the connected account. |
| `tags` | `string[]` | No | An array of string tags to associate to the note. |
| `traits` | `object` | No | A key-value JSON object of custom note traits. |

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

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: "vitally-create-note",
  arguments: {
    accountId: "Account Id",
    organizationId: "Organization 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: "vitally-create-note",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    vitally: { authProvisionId: "apn_xxxxxxx" },
    accountId: "Account Id",
    organizationId: "Organization 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": "vitally-create-note",
    "configured_props": {
      "vitally": { "authProvisionId": "apn_xxxxxxx" },
      "accountId": "Account Id",
      "organizationId": "Organization Id"
    }
  }'
```

---

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