> ## 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 scheduled event

> Create a voice, stage, or external Discord scheduled event.

`discord.createScheduledEvent` creates a voice, stage, or external Discord scheduled event.

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

export default automation("Create scheduled event", () => {
  onHttpRequest({ scope: "automation" })
  const scheduledStartTime = new Date(Date.now() + 86_400_000).toISOString()
  discord.createScheduledEvent({
    guildId: "123456789012345678",
    channelId: "234567890123456789",
    entityType: "voice",
    name: "Town hall",
    scheduledStartTime,
  })
})
```

## Inputs

Required server ID, `entityType`, `name`, and offset ISO `scheduledStartTime`. Voice/stage events require `channelId` and cannot set `location`; external events require `location` and `scheduledEndTime` and cannot set `channelId`. A supplied end time must be after the start time. Optional description and audit-log `reason`. Optional second argument `{ account }` selects the Discord binding.

## Output

Returns the created `DiscordScheduledEvent`.

## Discord behavior

Requires `CREATE_EVENTS`; stage events also depend on stage-channel permissions. `scheduledStartTime` must be in the future. Discord creates every new event with `scheduled` status. Create requests are not automatically replayed.
