> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# createCalendarEvent

> Create a calendar event. The Commerce Agent reads MARKETING events near the current date as context when it answers shoppers and writes outbound marketing messages. Read calendarEventCatalog for the agenda item kinds each type accepts.

**Required scopes:** [`calendar_events_write`](/docs/api-reference/v3/reference/scopes#scope-calendar_events_write)

## Arguments

<ResponseField name="input" type={<a href="/docs/api-reference/v3/reference/commerce-agent/create-calendar-event-input">CreateCalendarEventInput!</a>} required>
  The event to create.

  <Expandable title="fields" lazyRender>
    <ResponseField name="agenda" type={<a href="/docs/api-reference/v3/reference/commerce-agent/calendar-agenda-item-input">[CalendarAgendaItemInput!]</a>}>
      Agenda items to attach, in order. Each sets exactly one kind key. At most 20.

      <Expandable title="fields" lazyRender>
        <ResponseField name="promotion" type={<a href="/docs/api-reference/v3/reference/commerce-agent/calendar-promotion-agenda-item-input">CalendarPromotionAgendaItemInput</a>}>
          A PROMOTION item.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="allDay" type="Boolean">
      Whether the event spans whole days in `timezone`. Defaults to false.
    </ResponseField>

    <ResponseField name="description" type="String">
      Notes about the event, at most 1000 characters. The Commerce Agent reads them for MARKETING events and may repeat them to shoppers, so keep internal notes out.
    </ResponseField>

    <ResponseField name="endAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
      When the event ends. Must not be before `startAt`.
    </ResponseField>

    <ResponseField name="startAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
      When the event starts.
    </ResponseField>

    <ResponseField name="timezone" type="String!" required>
      The IANA time zone the event is written in, such as `America/New_York`.
    </ResponseField>

    <ResponseField name="title" type="String!" required>
      The name of the event, 1 to 200 characters. The Commerce Agent reads it for MARKETING events and may repeat it to shoppers.
    </ResponseField>

    <ResponseField name="type" type={<a href="/docs/api-reference/v3/reference/commerce-agent/calendar-event-type">CalendarEventType</a>}>
      The part of the business the event belongs to. Defaults to MARKETING.
    </ResponseField>
  </Expandable>
</ResponseField>

## Returns

<ResponseField name="createCalendarEvent" type={<a href="/docs/api-reference/v3/reference/commerce-agent/calendar-event">CalendarEvent!</a>} required>
  Something happening for the brand on a known date, such as a sale, launch, or holiday, with an agenda of typed items that give it behavior. The Commerce Agent reads MARKETING events near the current date as context, both when it answers shoppers and when it writes outbound marketing messages, and may repeat what they say to shoppers.

  <Expandable title="fields" lazyRender>
    <ResponseField name="agenda" type={<a href="/docs/api-reference/v3/reference/commerce-agent/calendar-event-agenda-item">[CalendarEventAgendaItem!]!</a>} required>
      The typed items attached to this event, in order. A kind this API version does not model is returned as CalendarUnknownAgendaItem. Change them with `agendaOperations` on updateCalendarEvent.

      <Expandable title="fields" lazyRender>
        <ResponseField name="id" type="ID!" required>
          The id of this agenda item. Pass it to an `update` or `remove` agenda operation on updateCalendarEvent.
        </ResponseField>

        <ResponseField name="kind" type={<a href="/docs/api-reference/v3/reference/commerce-agent/calendar-agenda-item-kind">CalendarAgendaItemKind!</a>} required>
          What this item adds to the event.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="agendaJson" type={<a href="/docs/api-reference/v3/reference/common/json">[JSON!]!</a>} required>
      `agenda` with every field selected, as JSON: one element per item, in order, with `__typename`.
    </ResponseField>

    <ResponseField name="allDay" type="Boolean!" required>
      Whether the event spans whole days in `timezone` rather than specific times.
    </ResponseField>

    <ResponseField name="createdAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
      When the event was created.
    </ResponseField>

    <ResponseField name="description" type="String">
      Notes about the event. The Commerce Agent reads them for MARKETING events and may repeat them to shoppers, so keep internal notes out.
    </ResponseField>

    <ResponseField name="endAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
      When the event ends. Never before `startAt`.
    </ResponseField>

    <ResponseField name="id" type="ID!" required>
      The id of this calendar event.
    </ResponseField>

    <ResponseField name="startAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
      When the event starts.
    </ResponseField>

    <ResponseField name="status" type={<a href="/docs/api-reference/v3/reference/commerce-agent/calendar-event-status">CalendarEventStatus!</a>} required>
      Whether the event is upcoming, happening now, or ended.
    </ResponseField>

    <ResponseField name="timezone" type="String!" required>
      The IANA time zone the event was written in, such as `America/New_York`. `startAt` and `endAt` are instants; this is how to show them.
    </ResponseField>

    <ResponseField name="title" type="String!" required>
      The name of the event. The Commerce Agent reads it for MARKETING events and may repeat it to shoppers.
    </ResponseField>

    <ResponseField name="type" type={<a href="/docs/api-reference/v3/reference/commerce-agent/calendar-event-type">CalendarEventType!</a>} required>
      The part of the business this event belongs to.
    </ResponseField>

    <ResponseField name="updatedAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
      When the event or its agenda was last changed.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

```graphql theme={null}
mutation {
  createCalendarEvent(input: { ... }) {
    agendaJson
    allDay
    createdAt
    description
    endAt
    id
    startAt
    status
    # ...
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.