> ## 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 permission

> Share a Drive file with a user, group, domain, or anyone.

`googleDrive.createPermission` shares a Drive file with a user, group, domain, or anyone.

## Example

```ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { googleDrive } from "automate.ax/google-drive"

export default automation("Create permission", () => {
  onDashboardRun({ title: "Create permission" })
  googleDrive.createPermission({
    fileId: "file-id",
    type: "user",
    role: "writer",
    emailAddress: "ada@example.com",
  })
})
```

## Inputs

Provide `fileId`, `type`, and `role`. Roles can be `organizer`, `fileOrganizer`, `writer`, `commenter`, or `reader`. User and group permissions require `emailAddress`; domain permissions require `domain`. `expirationTime` is optional for user and group permissions and unavailable for domain and anyone permissions. Google requires an expiration in the future and no more than one year away. Notification fields are optional. A second argument with `account` selects a Google Account.

## Output

Returns the created normalized permission.
