Skip to main content
Discord Timestamps LogoDiscordTimestamps
Developer Integrations

Automating Discord Scheduled Events via API: Developer Guide with Dynamic Timestamps

Learn how to programmatically create and manage Discord Scheduled Events using the REST API, discord.js, and automated chat timestamp announcements.

Alex Vance
2026-03-30
15 min read

Key Takeaways & Summary

  • •The Discord Scheduled Events API endpoint requires ISO 8601 UTC strings ('YYYY-MM-DDTHH:mm:ss.sssZ') for start and end times.
  • •Events support three entity types: STAGE_INSTANCE (1), VOICE (2), and EXTERNAL (3).
  • •External events require an 'entity_metadata' object containing a 'location' string (such as a Twitch or Zoom URL).
  • •Pairing programmatic event creation with an automated chat announcement containing <t:EPOCH:R> doubles attendance rates.
  • •The bot token must have the 'Create Events' and 'Manage Events' guild permissions.
  • •Scheduled events automatically dispatch GUILD_SCHEDULED_EVENT_CREATE gateway events to connected server bots.

Automate server calendar management by creating Discord Scheduled Events programmatically via the REST API, then broadcast synchronized dynamic countdowns in chat.

Discord Guild Scheduled Events feature gives communities a dedicated event hub at the top of their channel sidebar. Members can browse upcoming events, mark themselves as 'Interested', and receive automated desktop and mobile push notifications when the event begins. While creating events manually through the Discord UI is fine for occasional meetings, developer communities and gaming leagues require programmatic automation to sync events from Google Calendar, Challonge brackets, or internal databases. In this developer guide, you will learn how to interact with the Guild Scheduled Event REST API, handle ISO 8601 date formatting requirements, and automate companion announcement messages featuring dynamic relative timestamps.

Guild Scheduled Event API Specification and Entity Types

To create a scheduled event programmatically, your bot sends an authenticated HTTP POST request to the Discord endpoint:

POST /guilds/{guild.id}/scheduled-events

The request payload must specify the event name, timing, privacy level, and entity type:

FieldTypeDescriptionRequired?
namestring (1-100 chars)The public title of the eventYes
entity_typeinteger (1, 2, or 3)1 = Stage Instance, 2 = Voice Channel, 3 = ExternalYes
scheduled_start_timeISO 8601 stringTarget kickoff time in UTC formatYes
scheduled_end_timeISO 8601 stringRequired for External events; optional for voice/stageConditional
privacy_levelintegerMust be 2 (GUILD_ONLY)Yes
channel_idsnowflake IDTarget voice or stage channel ID (null for external)Conditional
entity_metadataobjectContains { location: 'URL/Address' } for external eventsConditional
descriptionstring (0-1000 chars)Detailed overview of the eventNo

Automating Event Creation in discord.js v14

Here is a complete TypeScript example showing how to create a scheduled external event (such as a Twitch live stream) and automatically post an announcement message with a dynamic countdown:

discord.js script automating event creation and chat announcementtypescript
import { 
  Client, 
  GatewayIntentBits, 
  GuildScheduledEventEntityType, 
  GuildScheduledEventPrivacyLevel, 
  time, 
  TimestampStyles 
} from 'discord.js';

const client = new Client({ 
  intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildScheduledEvents] 
});

async function createCommunityEvent(guildId: string, announcementChannelId: string) {
  const guild = await client.guilds.fetch(guildId);
  const channel = await guild.channels.fetch(announcementChannelId);
  if (!channel || !channel.isTextBased()) return;

  // Schedule event for 48 hours in the future
  const startTime = new Date(Date.now() + 48 * 60 * 60 * 1000);
  const endTime = new Date(startTime.getTime() + 2 * 60 * 60 * 1000);

  // 1. Create the Guild Scheduled Event via Discord API
  const scheduledEvent = await guild.scheduledEvents.create({
    name: 'Developer Q&A and Roadmap Livestream',
    scheduledStartTime: startTime.toISOString(),
    scheduledEndTime: endTime.toISOString(),
    privacyLevel: GuildScheduledEventPrivacyLevel.GuildOnly,
    entityType: GuildScheduledEventEntityType.External,
    entityMetadata: {
      location: 'https://twitch.tv/example_stream'
    },
    description: 'Join the core engineering team for our monthly Q&A session.'
  });

  // 2. Post a synchronized announcement message in chat with dynamic timestamps
  const fullDate = time(startTime, TimestampStyles.LongDateTime);
  const relativeCountdown = time(startTime, TimestampStyles.RelativeTime);

  await channel.send({
    content: `📢 **NEW EVENT SCHEDULED: ${scheduledEvent.name}**\n\n` +
      `**Kickoff Time:** ${fullDate} (${relativeCountdown})\n` +
      `**Location:** <${scheduledEvent.entityMetadata?.location}>\n` +
      `**Event RSVP:** Click 'Interested' on the official event card: ${scheduledEvent.url}`
  });
}

client.login(process.env.DISCORD_BOT_TOKEN);

The Attendance Flywheel: Combining Scheduled Events and Chat Tags

Relying exclusively on Discord Scheduled Events has one key limitation: members must proactively click into the server header to see the calendar. Conversely, relying solely on chat messages means members miss push notifications when the event starts.

By programmatically generating both, you achieve the optimal attendance flywheel: • Chat Awareness: Active chat participants see the high-visibility announcement with the dynamic :R countdown. • Mobile Reminders: Members click 'Interested' on the linked scheduled event card, adding it to their personal Discord event queue and triggering native mobile push alerts 15 minutes before the event kicks off.

Event Recurrence Automation

For community groups hosting weekly meetings, your bot can run a recurring cron job that verifies whether the upcoming week event has already been created. If missing, it calculates next week epoch seconds and issues both the API creation payload and chat notice automatically.

Related Search Queries & Topics
discord scheduled event timestampdiscord create event botdiscord scheduled event embedhow to create scheduled event with discord botdiscord api scheduled event entity_metadatasync google calendar to discord scheduled events

Frequently Asked Questions

Straightforward answers to common questions about this topic.

No. Discord API requires both scheduled_start_time and scheduled_end_time for external events (entity_type 3). Only voice and stage events allow open-ended end times.

Generate Your Discord Timestamps Now

Convert any date or countdown into auto-adjusting Discord tags with 1-click copy.

Open Free Generator