Discord Scheduled Events API

Operations on guild scheduled events

OpenAPI Specification

discord-scheduled-events-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Discord Interactions Application Commands Scheduled Events API
  description: The Discord Interactions API enables applications to create and respond to application commands (slash commands), message components, and modals. It supports both Gateway-based and webhook-based interaction handling, allowing bots to build rich, interactive user experiences within Discord.
  version: '10'
  contact:
    name: Discord Support
    url: https://support-dev.discord.com/hc/en-us
    email: support@discord.com
  termsOfService: https://discord.com/developers/docs/policies-and-agreements/developer-terms-of-service
servers:
- url: https://discord.com/api/v10
  description: Discord API v10
security:
- BotToken: []
tags:
- name: Scheduled Events
  description: Operations on guild scheduled events
paths:
  /guilds/{guild_id}/scheduled-events:
    get:
      operationId: listGuildScheduledEvents
      summary: Discord List guild scheduled events
      description: Returns a list of guild scheduled event objects.
      tags:
      - Scheduled Events
      parameters:
      - $ref: '#/components/parameters/guildId'
      - name: with_user_count
        in: query
        schema:
          type: boolean
      responses:
        '200':
          description: List of scheduled events
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GuildScheduledEvent'
        4XX:
          $ref: '#/components/responses/ClientError'
    post:
      operationId: createGuildScheduledEvent
      summary: Discord Create guild scheduled event
      description: Create a guild scheduled event.
      tags:
      - Scheduled Events
      parameters:
      - $ref: '#/components/parameters/guildId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateScheduledEventRequest'
      responses:
        '200':
          description: Scheduled event created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GuildScheduledEvent'
        4XX:
          $ref: '#/components/responses/ClientError'
components:
  schemas:
    CreateScheduledEventRequest:
      type: object
      required:
      - name
      - privacy_level
      - scheduled_start_time
      - entity_type
      properties:
        channel_id:
          $ref: '#/components/schemas/Snowflake'
        entity_metadata:
          type: object
          properties:
            location:
              type: string
        name:
          type: string
        privacy_level:
          type: integer
        scheduled_start_time:
          type: string
          format: date-time
        scheduled_end_time:
          type: string
          format: date-time
        description:
          type: string
        entity_type:
          type: integer
        image:
          type: string
    User:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/Snowflake'
        username:
          type: string
        discriminator:
          type: string
        global_name:
          type: string
          nullable: true
        avatar:
          type: string
          nullable: true
        bot:
          type: boolean
        system:
          type: boolean
        mfa_enabled:
          type: boolean
        banner:
          type: string
          nullable: true
        accent_color:
          type: integer
          nullable: true
        locale:
          type: string
        verified:
          type: boolean
        email:
          type: string
          nullable: true
        flags:
          type: integer
        premium_type:
          type: integer
        public_flags:
          type: integer
        avatar_decoration_data:
          type: object
          nullable: true
      required:
      - id
      - username
    Snowflake:
      type: string
      description: Discord unique ID represented as a string
      pattern: ^[0-9]+$
    GuildScheduledEvent:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/Snowflake'
        guild_id:
          $ref: '#/components/schemas/Snowflake'
        channel_id:
          $ref: '#/components/schemas/Snowflake'
        creator_id:
          $ref: '#/components/schemas/Snowflake'
        name:
          type: string
        description:
          type: string
          nullable: true
        scheduled_start_time:
          type: string
          format: date-time
        scheduled_end_time:
          type: string
          format: date-time
          nullable: true
        privacy_level:
          type: integer
        status:
          type: integer
          description: 1=SCHEDULED, 2=ACTIVE, 3=COMPLETED, 4=CANCELED
        entity_type:
          type: integer
          description: 1=STAGE_INSTANCE, 2=VOICE, 3=EXTERNAL
        entity_id:
          $ref: '#/components/schemas/Snowflake'
        entity_metadata:
          type: object
          nullable: true
          properties:
            location:
              type: string
        creator:
          $ref: '#/components/schemas/User'
        user_count:
          type: integer
        image:
          type: string
          nullable: true
      required:
      - id
      - guild_id
      - name
      - scheduled_start_time
      - privacy_level
      - status
      - entity_type
  responses:
    ClientError:
      description: Client error response
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: integer
              message:
                type: string
              errors:
                type: object
  parameters:
    guildId:
      name: guild_id
      in: path
      required: true
      schema:
        type: string
      description: The ID of the guild (Snowflake)
  securitySchemes:
    BotToken:
      type: http
      scheme: bearer
      description: Bot token authentication
externalDocs:
  description: Discord Interactions Documentation
  url: https://discord.com/developers/docs/interactions/overview