# Create Appointment — Microsoft Dynamics 365 Sales

> Create a new appointment linked to an account with a required attendee (system user). Use List Appointment Categories for valid category values. See the documentation and the appointment entity reference

- Key: `microsoft_dynamics_365_sales-create-appointment`
- Type: Action (Write)
- Version: 0.0.3
- App: Microsoft Dynamics 365 Sales (`microsoft_dynamics_365_sales`) — https://pipedream.com/apps/microsoft-dynamics-365-sales.md
- This page (HTML): https://pipedream.com/apps/microsoft-dynamics-365-sales/actions/create-appointment
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/microsoft_dynamics_365_sales/actions/create-appointment/create-appointment.mjs

## Description

Create a new appointment linked to an account with a required attendee (system user). Use **List Appointment Categories** for valid category values. [See the documentation](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/create-entity-web-api) and the [appointment entity reference](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/reference/appointment)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `subject` | `string` | Yes | Title of the appointment (for example 1st Meeting with {Prospect Name}) |
| `scheduledstart` | `string` | Yes | Start in ISO 8601 (for example 2026-02-20T12:00:00Z) |
| `scheduledend` | `string` | Yes | End in ISO 8601, typically one hour after start |
| `regardingAccountId` | `string` | Yes | Account the appointment is regarding Options are loaded from the connected account. |
| `requiredAttendeeEmail` | `string` | Yes | Internal email address of the Dynamics system user (salesperson) to add as attendee |
| `category` | `integer` | No | Optional Category of Appointment (numeric option). Omit to let Dynamics use its default for your org 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_dynamics_365_sales",
      },
    },
  },
)

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_dynamics_365_sales-create-appointment",
  arguments: {
    subject: "Subject",
    scheduledstart: "Scheduled Start",
  },
})
```

**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_dynamics_365_sales-create-appointment",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    microsoft_dynamics_365_sales: { authProvisionId: "apn_xxxxxxx" },
    subject: "Subject",
    scheduledstart: "Scheduled Start",
  },
})

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_dynamics_365_sales-create-appointment",
    "configured_props": {
      "microsoft_dynamics_365_sales": { "authProvisionId": "apn_xxxxxxx" },
      "subject": "Subject",
      "scheduledstart": "Scheduled Start"
    }
  }'
```

---

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