# Create Event — Add to Calendar PRO

> Create an event in a group. See the documentation

- Key: `add_to_calendar_pro-create-event`
- Type: Action (Write)
- Version: 0.0.3
- App: Add to Calendar PRO (`add_to_calendar_pro`) — https://pipedream.com/apps/add-to-calendar-pro.md
- This page (HTML): https://pipedream.com/apps/add-to-calendar-pro/actions/create-event
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/add_to_calendar_pro/actions/create-event/create-event.mjs

## Description

Create an event in a group. [See the documentation](https://docs.add-to-calendar-pro.com/api/events#add-an-event)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `groupProKey` | `string` | No | The pro key of the group to add the event to. Either this or newEventGroupName is required. Options are loaded from the connected account. |
| `newEventGroupName` | `string` | No | Create a new group for the event with the name provided. Either this or groupProKey is required. |
| `titleEventSeries` | `string` | No | The title of the event series |
| `simplifiedRecurrence` | `boolean` | No | Set false, if you go for the "recurrence" field, which takes an RRULE; and true if you use the other recurrence fields |
| `recurrence` | `string` | No | An RRULE. Use in combination with "Simplified Recurrence" being set to false. |
| `recurrenceSimpleType` | `string` | No | Use in combination with "Simplified Recurrence" being set to true. |
| `recurrenceInterval` | `integer` | No | The interval of the recurrence |
| `recurrenceByDay` | `string` | No | Example: 2MO,TU for the second Monday and each Tuesday |
| `recurrenceByMonth` | `string` | No | Example: 1,2,12 for Jan, Feb, and Dec |
| `recurrenceByMonthDay` | `string` | No | Example: 3,23 for the 3rd and 23rd day of the month |
| `recurrenceCount` | `integer` | No | The count of the recurrence |
| `recurrenceWeekStart` | `string` | No | The week start of the recurrence. Example: MO for Monday |
| `iCalFileName` | `string` | No | Overriding the ics file name |
| `rsvp` | `boolean` | No | Whether the event is an RSVP event |
| `distribution` | `boolean` | No | Whether the event is distributed to all group members |
| `hideButton` | `boolean` | No | Whether the Add to Calendar button is hidden |
| `cta` | `boolean` | No | Whether the event has a call to action |
| `styleId` | `integer` | No | The ID of a style Options are loaded from the connected account. |
| `landingPageTemplateId` | `integer` | No | The ID of a landing page template Options are loaded from the connected account. |
| `rsvpTemplateId` | `integer` | No | The ID of an RSVP template Options are loaded from the connected account. |
| `ctaTemplateId` | `integer` | No | The ID of a Call to Action template Options are loaded from the connected account. |
| `numberOfDates` | `integer` | Yes | The number of dates to create for the event |

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

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: "add_to_calendar_pro-create-event",
  arguments: {
    groupProKey: "Group Pro Key",
    newEventGroupName: "New Event Group Name",
  },
})
```

**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: "add_to_calendar_pro-create-event",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    add_to_calendar_pro: { authProvisionId: "apn_xxxxxxx" },
    groupProKey: "Group Pro Key",
    newEventGroupName: "New Event Group Name",
  },
})

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": "add_to_calendar_pro-create-event",
    "configured_props": {
      "add_to_calendar_pro": { "authProvisionId": "apn_xxxxxxx" },
      "groupProKey": "Group Pro Key",
      "newEventGroupName": "New Event Group Name"
    }
  }'
```

---

- App: https://pipedream.com/apps/add-to-calendar-pro.md · All apps: https://pipedream.com/apps
