> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Create calendar access rule

> Share a Google Calendar with a user, group, domain, or the public.

`createCalendarAccessRule` grants one principal or public scope a calendar role.

## Example

```ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { createCalendarAccessRule } from "automate.ax/google-calendar"

export default automation("Share a team calendar", () => {
  onHttpRequest({ scope: "automation" })

  createCalendarAccessRule({
    calendar: "Team Calendar",
    scope: { type: "group", value: "launch@example.com" },
    role: "writer",
    sendNotifications: true,
  })
})
```

## Inputs

| Property            | Type                                                                            | Required | Default         | Description                                                                     |
| ------------------- | ------------------------------------------------------------------------------- | -------- | --------------- | ------------------------------------------------------------------------------- |
| `scope`             | `{ type: "user" \| "group" \| "domain"; value: string } \| { type: "default" }` | Yes      | —               | Recipient or public scope. `default` means public and must not include a value. |
| `role`              | `"none" \| "freeBusyReader" \| "reader" \| "writer" \| "owner"`                 | Yes      | —               | Permission to grant.                                                            |
| `calendar`          | `string`                                                                        | No       | `"primary"`     | Exact title or ID.                                                              |
| `sendNotifications` | `boolean`                                                                       | No       | Google default  | Whether Google emails the recipient.                                            |
| `account`           | Google account reference                                                        | No       | Project default | Connected account.                                                              |

## Output

Returns the created `{ id, role, scope }`. Preserve `id` for updates or deletion.

<Warning>
  A `default` scope can make the calendar public. Grant `owner` only when
  transferring owner-level control is intended and supported by Google.
</Warning>
