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

> Create an invite to a Discord channel.

`discord.createInvite` create an invite to a Discord channel.

```ts automations/discord-create-invite.automation.ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { discord } from "automate.ax/discord"

export default automation("Create invite", () => {
  onHttpRequest({ scope: "automation" })
  discord.createInvite({
    channelId: "234567890123456789",
    maxAge: 86400,
    maxUses: 10,
    unique: true,
  })
})
```

## Inputs

Required `channelId`. Optional `maxAge` up to 604,800 seconds, `maxUses` up to 100, `temporary`, `unique`, and audit-log `reason`. Optional second argument `{ account }` selects the Discord binding.

## Output

Returns the created `DiscordInvite`.

## Discord behavior

Requires `CREATE_INSTANT_INVITE`; `unique: false` may reuse a matching invite.
